Whamcloud - gitweb
Fix -Wunused-variable warnings
authorEric Biggers <ebiggers@google.com>
Wed, 16 Jun 2021 04:53:33 +0000 (21:53 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 7 Jul 2021 03:11:35 +0000 (23:11 -0400)
Fix all warnings about unused variables that were introduced since
e2fsprogs v1.45.4.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/extents.c
e2fsck/journal.c
e2fsck/rehash.c
lib/e2p/errcode.c
lib/e2p/fgetflags.c
lib/e2p/fsetflags.c
lib/ext2fs/mkjournal.c
misc/mke2fs.c

index 4e6e261..0274e05 100644 (file)
@@ -203,7 +203,7 @@ errcode_t rewrite_extent_replay(e2fsck_t ctx, struct extent_list *list,
        ext2_extent_handle_t    handle;
        unsigned int            i, ext_written;
        struct ext2fs_extent    *ex, extent;
-       blk64_t                 start_val, delta, blkcount;
+       blk64_t                 start_val, delta;
 
        /* Reset extent tree */
        inode->i_flags &= ~EXT4_EXTENTS_FL;
index af0effc..62a965a 100644 (file)
@@ -445,7 +445,6 @@ static int ex_len_compar(const void *arg1, const void *arg2)
 
 static void ex_sort_and_merge(struct extent_list *list)
 {
-       blk64_t ex_end;
        int i, j;
 
        if (list->count < 2)
@@ -493,7 +492,7 @@ static int ext4_modify_extent_list(e2fsck_t ctx, struct extent_list *list,
 {
        int ret;
        int i, offset;
-       struct ext2fs_extent add_ex = *ex, add_ex2;
+       struct ext2fs_extent add_ex = *ex;
 
        /* First let's create a hole from ex->e_lblk of length ex->e_len */
        for (i = 0; i < list->count; i++) {
@@ -641,9 +640,7 @@ static inline int tl_to_darg(struct dentry_info_args *darg,
 
 static int ext4_fc_handle_unlink(e2fsck_t ctx, struct ext4_fc_tl *tl, __u8 *val)
 {
-       struct ext2_inode inode;
        struct dentry_info_args darg;
-       ext2_filsys fs = ctx->fs;
        int ret;
 
        ret = tl_to_darg(&darg, tl, val);
@@ -735,7 +732,6 @@ static void ext4_fc_replay_fixup_iblocks(struct ext2_inode_large *ondisk_inode,
 
 static int ext4_fc_handle_inode(e2fsck_t ctx, __u8 *val)
 {
-       struct e2fsck_fc_replay_state *state = &ctx->fc_replay_state;
        int ino, inode_len = EXT2_GOOD_OLD_INODE_SIZE;
        struct ext2_inode_large *inode = NULL, *fc_inode = NULL;
        __le32 fc_ino;
index 204ff7d..7d30ff0 100644 (file)
@@ -287,7 +287,7 @@ static EXT2_QSORT_TYPE name_cf_cmp(const struct name_cmp_ctx *ctx,
 {
        const struct hash_entry *he_a = (const struct hash_entry *) a;
        const struct hash_entry *he_b = (const struct hash_entry *) b;
-       unsigned int he_a_len, he_b_len, min_len;
+       unsigned int he_a_len, he_b_len;
        int ret;
 
        he_a_len = ext2fs_dirent_name_len(he_a->dir);
index 27d4b15..7e42655 100644 (file)
@@ -34,7 +34,6 @@ static const char *err_string[] = {
 /* Return the name of an encoding or NULL */
 const char *e2p_errcode2str(int err)
 {
-       unsigned int i;
        static char buf[32];
 
        if (err < ARRAY_SIZE(err_string))
index 0f1a059..93e130c 100644 (file)
@@ -50,8 +50,8 @@
 
 int fgetflags (const char * name, unsigned long * flags)
 {
-       struct stat buf;
 #if HAVE_STAT_FLAGS && !(APPLE_DARWIN && HAVE_EXT2_IOCTLS)
+       struct stat buf;
 
        if (stat (name, &buf) == -1)
                return -1;
index 2851554..6455e38 100644 (file)
@@ -81,7 +81,6 @@ int fsetflags (const char * name, unsigned long flags)
        return syscall(SYS_fsctl, name, EXT2_IOC_SETFLAGS, &f, 0);
 #elif HAVE_EXT2_IOCTLS
        int fd, r, f, save_errno = 0;
-       struct stat buf;
 
        fd = open(name, OPEN_FLAGS);
        if (fd == -1) {
index bc8c57b..11d73e3 100644 (file)
@@ -604,7 +604,6 @@ errcode_t ext2fs_add_journal_inode2(ext2_filsys fs, blk_t num_blocks,
                                    blk64_t goal, int flags)
 {
        struct ext2fs_journal_params jparams;
-       errcode_t ret;
 
        jparams.num_journal_blocks = num_blocks;
        jparams.num_fc_blocks = 0;
index d5ab334..54aa340 100644 (file)
@@ -1577,7 +1577,9 @@ static void PRS(int argc, char *argv[])
        int             use_bsize;
        char            *newpath;
        int             pathlen = sizeof(PATH_SET) + 1;
+#ifdef HAVE_BLKID_PROBE_GET_TOPOLOGY
        struct device_param dev_param;
+#endif
 
        if (oldpath)
                pathlen += strlen(oldpath);