summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2012-08-24 00:59:38 +0200
committerAndroid Git Automerger <android-git-automerger@android.com>2012-08-24 00:59:38 +0200
commit9383c8cb0bb9625590a48418b212d4a79e451e7d (patch)
treec8219dedb17b9af42e1b20324ae944d04df118ff
parentam 8876725f: am 0254d573: Merge "Fix multiple defined symbol errors" (diff)
parentam 6a693d57: Merge "Fixed warnings in libmtdutils" (diff)
downloadandroid_bootable_recovery-9383c8cb0bb9625590a48418b212d4a79e451e7d.tar
android_bootable_recovery-9383c8cb0bb9625590a48418b212d4a79e451e7d.tar.gz
android_bootable_recovery-9383c8cb0bb9625590a48418b212d4a79e451e7d.tar.bz2
android_bootable_recovery-9383c8cb0bb9625590a48418b212d4a79e451e7d.tar.lz
android_bootable_recovery-9383c8cb0bb9625590a48418b212d4a79e451e7d.tar.xz
android_bootable_recovery-9383c8cb0bb9625590a48418b212d4a79e451e7d.tar.zst
android_bootable_recovery-9383c8cb0bb9625590a48418b212d4a79e451e7d.zip
-rw-r--r--mtdutils/mtdutils.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mtdutils/mtdutils.c b/mtdutils/mtdutils.c
index e4d2a6064..107cbb9a8 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!
}