Whamcloud - gitweb
build: fix unused/uninitialized variable warnings
authorAndreas Dilger <adilger@dilger.ca>
Sat, 26 Jul 2014 01:43:08 +0000 (21:43 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 26 Jul 2014 02:48:01 +0000 (22:48 -0400)
Fix a few warnings about unused and uninitialized variables.

Also fix util/subst.c to include <sys/time.h> to avoid using
undeclared functions gettimeofday() and futimes().

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/debugfs.c
e2fsck/pass5.c
lib/ext2fs/blkmap64_rb.c
lib/quota/mkquota.c
misc/mk_hugefiles.c
util/subst.c

index b41626c..b6ba1da 100644 (file)
@@ -2347,7 +2347,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;
@@ -2355,8 +2354,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,
                                        &current_fs->mmp_buf);
index b31490f..d0b1ced 100644 (file)
@@ -206,7 +206,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     old_desc_blocks = 0;
        int     count = 0;
        int     cmp_block = 0;
@@ -253,8 +252,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;
index 4dcb03f..a1dde6d 100644 (file)
@@ -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;
index 58803d0..0ece088 100644 (file)
@@ -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;
index 6bc25e6..7f1be2e 100644 (file)
@@ -468,7 +468,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;
index 6244831..36eaa94 100644 (file)
@@ -14,6 +14,9 @@
 #include <unistd.h>
 #include <string.h>
 #include <ctype.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>