Whamcloud - gitweb
Quiet unused variable warnings
authorAndreas Dilger <adilger@dilger.ca>
Thu, 4 Aug 2022 17:18:32 +0000 (11:18 -0600)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 11 Aug 2022 14:11:09 +0000 (10:11 -0400)
Quiet various compiler warnings about unreferenced or unset variables.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/journal.c
lib/ext2fs/swapfs.c

index 12487e3..571de83 100644 (file)
@@ -620,7 +620,6 @@ static inline int tl_to_darg(struct dentry_info_args *darg,
                             struct  ext4_fc_tl *tl, __u8 *val)
 {
        struct ext4_fc_dentry_info fcd;
-       int tag = le16_to_cpu(tl->fc_tag);
 
        memcpy(&fcd, val, sizeof(fcd));
 
@@ -636,10 +635,10 @@ static inline int tl_to_darg(struct dentry_info_args *darg,
               darg->dname_len);
        darg->dname[darg->dname_len] = 0;
        jbd_debug(1, "%s: %s, ino %lu, parent %lu\n",
-               tag == EXT4_FC_TAG_CREAT ? "create" :
-               (tag == EXT4_FC_TAG_LINK ? "link" :
-               (tag == EXT4_FC_TAG_UNLINK ? "unlink" : "error")),
-               darg->dname, darg->ino, darg->parent_ino);
+                 le16_to_cpu(tl->fc_tag) == EXT4_FC_TAG_CREAT ? "create" :
+                 (le16_to_cpu(tl->fc_tag) == EXT4_FC_TAG_LINK ? "link" :
+                  (le16_to_cpu(tl->fc_tag) == EXT4_FC_TAG_UNLINK ? "unlink" :
+                   "error")), darg->dname, darg->ino, darg->parent_ino);
        return 0;
 }
 
@@ -652,11 +651,11 @@ static int ext4_fc_handle_unlink(e2fsck_t ctx, struct ext4_fc_tl *tl, __u8 *val)
        if (ret)
                return ret;
        ext4_fc_flush_extents(ctx, darg.ino);
-       ret = errcode_to_errno(
-                      ext2fs_unlink(ctx->fs, darg.parent_ino,
-                                    darg.dname, darg.ino, 0));
+       ret = errcode_to_errno(ext2fs_unlink(ctx->fs, darg.parent_ino,
+                                            darg.dname, darg.ino, 0));
        /* It's okay if the above call fails */
        free(darg.dname);
+
        return ret;
 }
 
index 1006b2d..cd160b3 100644 (file)
@@ -244,7 +244,7 @@ void ext2fs_swap_inode_full(ext2_filsys fs, struct ext2_inode_large *t,
                            int bufsize)
 {
        unsigned i, extra_isize, attr_magic;
-       int has_extents, has_inline_data, islnk, fast_symlink;
+       int has_extents = 0, has_inline_data = 0, islnk = 0, fast_symlink = 0;
        unsigned int inode_size;
        __u32 *eaf, *eat;