]> www.infradead.org Git - mtd-utils.git/commitdiff
ubi-utils: fix compilation warnings
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 16 Jan 2009 13:40:54 +0000 (15:40 +0200)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 16 Jan 2009 13:40:54 +0000 (15:40 +0200)
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
ubi-utils/new-utils/src/common.h
ubi-utils/new-utils/src/libscan.c
ubi-utils/new-utils/src/libubi.c
ubi-utils/new-utils/src/ubiformat.c
ubi-utils/new-utils/src/ubinize.c

index fdc69db5e3d0b1e0763642196b19085fb68e11db..56fa020d0225de234a34f5e93648eb89ac5ffdc1 100644 (file)
@@ -55,7 +55,8 @@ extern "C" {
 
 /* System error messages */
 #define sys_errmsg(fmt, ...)  ({                                            \
-       int _err = errno, _i;                                               \
+       int _err = errno;                                                   \
+       size_t _i;                                                           \
        fprintf(stderr, PROGRAM_NAME ": error!: " fmt "\n", ##__VA_ARGS__); \
        for (_i = 0; _i < sizeof(PROGRAM_NAME) + 1; _i++)                   \
                fprintf(stderr, " ");                                       \
index 34274984013960cd2db41c46a3edf856ba532518..da13b1b84d699267c8e2f1f0497615ad5f2cbb07 100644 (file)
@@ -154,7 +154,7 @@ int ubi_scan(struct mtd_info *mtd, struct ubi_scan_info **info, int verbose)
 
                        }
                } else {
-                       if (be32_to_cpu(hdr.vid_hdr_offset) != si->vid_hdr_offs) {
+                       if ((int)be32_to_cpu(hdr.vid_hdr_offset) != si->vid_hdr_offs) {
                                if (pr)
                                        printf("\n");
                                if (v)
@@ -168,7 +168,7 @@ int ubi_scan(struct mtd_info *mtd, struct ubi_scan_info **info, int verbose)
                                si->ec[eb] = EB_CORRUPTED;
                                continue;
                        }
-                       if (be32_to_cpu(hdr.data_offset) != si->data_offs) {
+                       if ((int)be32_to_cpu(hdr.data_offset) != si->data_offs) {
                                if (pr)
                                        printf("\n");
                                if (v)
index 2c80fea58e7a2bdeed578b5f559158c0ec690e30..88215d06c0f60b48215052d0f5faa67063420259 100644 (file)
@@ -1153,7 +1153,8 @@ int ubi_get_vol_info(libubi_t desc, const char *node, struct ubi_vol_info *info)
 int ubi_get_vol_info1_nm(libubi_t desc, int dev_num, const char *name,
                         struct ubi_vol_info *info)
 {
-       int i, err, nlen = strlen(name);
+       int i, err;
+       unsigned int nlen = strlen(name);
        struct ubi_dev_info dev_info;
 
        if (nlen == 0) {
index bf07e5e0291b133a3b1b15eebf30393a1f142370..0074c7a7f651335d43348928357baa699623d198 100644 (file)
@@ -309,8 +309,7 @@ static int drop_ffs(const struct mtd_info *mtd, const void *buf, int len)
         return len;
 }
 
-static int open_file(const struct mtd_info *mtd, struct ubi_scan_info *si,
-                    off_t *sz)
+static int open_file(off_t *sz)
 {
        int fd;
 
@@ -355,13 +354,12 @@ static int read_all(int fd, void *buf, size_t len)
        return 0;
 }
 
-static int flash_image(const struct mtd_info *mtd, const struct ubigen_info *ui,
-                      struct ubi_scan_info *si)
+static int flash_image(const struct mtd_info *mtd, struct ubi_scan_info *si)
 {
        int fd, img_ebs, eb, written_ebs = 0, divisor;
        off_t st_size;
 
-       fd = open_file(mtd, si, &st_size);
+       fd = open_file(&st_size);
        if (fd < 0)
                return fd;
 
@@ -608,7 +606,7 @@ int main(int argc, char * const argv[])
                        errmsg("VID header offset has to be multiple of min. I/O unit size");
                        goto out_close;
                }
-               if (args.vid_hdr_offs + UBI_VID_HDR_SIZE > mtd.eb_size) {
+               if (args.vid_hdr_offs + (int)UBI_VID_HDR_SIZE > mtd.eb_size) {
                        errmsg("bad VID header offset");
                        goto out_close;
                }
@@ -757,7 +755,7 @@ int main(int argc, char * const argv[])
        }
 
        if (args.image) {
-               err = flash_image(&mtd, &ui, si);
+               err = flash_image(&mtd, si);
                if (err < 0)
                        goto out_free;
 
index 4f3e8a194daa60416b71cdcc7c8f408d0a5e59db..00dc508b409522463929a236862e52a4039237ef 100644 (file)
@@ -261,7 +261,7 @@ static int parse_opt(int argc, char * const argv[])
                return errmsg("output file was not specified (use -h for help)");
 
        if (args.vid_hdr_offs) {
-               if (args.vid_hdr_offs + UBI_VID_HDR_SIZE >= args.peb_size)
+               if (args.vid_hdr_offs + (int)UBI_VID_HDR_SIZE >= args.peb_size)
                        return errmsg("bad VID header position");
                if (args.vid_hdr_offs % 8)
                        return errmsg("VID header offset has to be multiple of min. I/O unit size");