aboutsummaryrefslogtreecommitdiffstats
path: root/mtdutils
diff options
context:
space:
mode:
authorEdwin Vane <edwin.vane@intel.com>2012-07-27 11:59:20 -0400
committerEdwin Vane <edwin.vane@intel.com>2012-08-21 16:03:11 -0400
commit76b6666f2491ea3be24a19cea59f894db6f8e22f (patch)
treec5254bd26291904b505d18f14f18d1f5c50c60a6 /mtdutils
parent3733d2185bbcedd9ef626907f1f32628986cc0f5 (diff)
downloadbootable_recovery-76b6666f2491ea3be24a19cea59f894db6f8e22f.zip
bootable_recovery-76b6666f2491ea3be24a19cea59f894db6f8e22f.tar.gz
bootable_recovery-76b6666f2491ea3be24a19cea59f894db6f8e22f.tar.bz2
Fixed warnings in libmtdutils
A few signed/unsigned comparison warnings were all that stood in the way of a clean clang build. Change-Id: Id8c47fcfa500a6ac164bddb855831cdc17d99847 Author: Edwin Vane <edwin.vane@intel.com> Reviewed-by: Tareq A Siraj <tareq.a.siraj@intel.com>
Diffstat (limited to 'mtdutils')
-rw-r--r--mtdutils/mtdutils.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mtdutils/mtdutils.c b/mtdutils/mtdutils.c
index e4d2a60..107cbb9 100644
--- a/mtdutils/mtdutils.c
+++ b/mtdutils/mtdutils.c
@@ -328,8 +328,8 @@ static int read_block(const MtdPartition *partition, int fd, char *data)
ssize_t mtd_read_data(MtdReadContext *ctx, char *data, size_t len)
{
- ssize_t read = 0;
- while (read < (int) len) {
+ size_t read = 0;
+ while (read < len) {
if (ctx->consumed < ctx->partition->erase_size) {
size_t avail = ctx->partition->erase_size - ctx->consumed;
size_t copy = len - read < avail ? len - read : avail;
@@ -350,7 +350,7 @@ ssize_t mtd_read_data(MtdReadContext *ctx, char *data, size_t len)
}
// Read the next block into the buffer
- if (ctx->consumed == ctx->partition->erase_size && read < (int) len) {
+ if (ctx->consumed == ctx->partition->erase_size && read < len) {
if (read_block(ctx->partition, ctx->fd, ctx->buffer)) return -1;
ctx->consumed = 0;
}
@@ -457,7 +457,7 @@ static int write_block(MtdWriteContext *ctx, const char *data)
if (retry > 0) {
fprintf(stderr, "mtd: wrote block after %d retries\n", retry);
}
- fprintf(stderr, "mtd: successfully wrote block at %llx\n", pos);
+ fprintf(stderr, "mtd: successfully wrote block at %lx\n", pos);
return 0; // Success!
}