From: Andreas Dilger Date: Wed, 23 Jul 2014 07:00:45 +0000 (-0600) Subject: LU-5307 build: fix unused/uninitialized variable warnings X-Git-Tag: v1.42.11.wc1 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=afe5fc27f1a9e7815bd2894d6fac8cd6f583d3ea;p=tools%2Fe2fsprogs.git LU-5307 build: fix unused/uninitialized variable warnings Fix a few warnings about unused and uninitialized variables. Also fix util/subst.c to include to avoid using undeclared functions gettimeofday() and futimes(). Signed-off-by: Andreas Dilger Change-Id: Id7deabf6eb1f59ce98ab2cb51b9bf5198c500c1e --- diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c index 2ee3c15..894d1b3 100644 --- a/debugfs/debugfs.c +++ b/debugfs/debugfs.c @@ -2391,7 +2391,6 @@ try_again: void do_dump_mmp(int argc EXT2FS_ATTR((unused)), char *argv[]) { - struct ext2_super_block *sb; struct mmp_struct *mmp_s; time_t t; errcode_t retval = 0; @@ -2399,8 +2398,6 @@ void do_dump_mmp(int argc EXT2FS_ATTR((unused)), char *argv[]) if (check_fs_open(argv[0])) return; - sb = current_fs->super; - if (current_fs->mmp_buf == NULL) { retval = ext2fs_get_mem(current_fs->blocksize, ¤t_fs->mmp_buf); diff --git a/e2fsck/pass5.c b/e2fsck/pass5.c index df5e3ed..5d97650 100644 --- a/e2fsck/pass5.c +++ b/e2fsck/pass5.c @@ -242,7 +242,6 @@ static void check_block_bitmaps(e2fsck_t ctx) problem_t problem, save_problem; int fixit, had_problem; errcode_t retval; - int csum_flag; int redo_flag = 0; char *actual_buf, *bitmap_buf; @@ -285,8 +284,6 @@ static void check_block_bitmaps(e2fsck_t ctx) goto errout; } - csum_flag = EXT2_HAS_RO_COMPAT_FEATURE(fs->super, - EXT4_FEATURE_RO_COMPAT_GDT_CSUM); redo_counts: had_problem = 0; save_problem = 0; diff --git a/lib/ext2fs/blkmap64_rb.c b/lib/ext2fs/blkmap64_rb.c index 4dcb03f..a1dde6d 100644 --- a/lib/ext2fs/blkmap64_rb.c +++ b/lib/ext2fs/blkmap64_rb.c @@ -83,7 +83,7 @@ static void print_tree(struct rb_root *root) static void check_tree(struct rb_root *root, const char *msg) { - struct rb_node *new_node, *node, *next; + struct rb_node *node; struct bmap_rb_extent *ext, *old = NULL; for (node = ext2fs_rb_first(root); node; diff --git a/lib/quota/mkquota.c b/lib/quota/mkquota.c index 58803d0..0ece088 100644 --- a/lib/quota/mkquota.c +++ b/lib/quota/mkquota.c @@ -580,7 +580,6 @@ out: errcode_t quota_compare_and_update(quota_ctx_t qctx, int qtype, int *usage_inconsistent) { - ext2_filsys fs = qctx->fs; struct quota_handle qh; struct scan_dquots_data scan_data; struct dquot *dq; diff --git a/misc/mk_hugefiles.c b/misc/mk_hugefiles.c index 41280f0..cc71d33 100644 --- a/misc/mk_hugefiles.c +++ b/misc/mk_hugefiles.c @@ -466,7 +466,7 @@ errcode_t mk_hugefiles(ext2_filsys fs, const char *device_name) unsigned long i; ext2_ino_t dir; errcode_t retval; - blk64_t fs_blocks, part_offset; + blk64_t fs_blocks, part_offset = 0; unsigned long align; int d, dsize; char *t; diff --git a/util/subst.c b/util/subst.c index 6244831..36eaa94 100644 --- a/util/subst.c +++ b/util/subst.c @@ -14,6 +14,9 @@ #include #include #include +#ifdef HAVE_SYS_TIME_H +#include +#endif #include #include #include