Whamcloud - gitweb
LU-16067 misc: cleanup compiler warnings
authorAndreas Dilger <adilger@whamcloud.com>
Tue, 2 Aug 2022 23:08:19 +0000 (17:08 -0600)
committerLi Dongyang <dongyangli@ddn.com>
Tue, 28 May 2024 05:53:20 +0000 (15:53 +1000)
Remove unused variables and various similar warnings.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I2a773d118960deb42f77c1ae8b038029e6f6cd18
Reviewed-by: Artem Blagodarenko <ablagodarenko@ddn.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
e2fsck/pass1.c
e2fsck/pass2.c
e2fsck/util.c
lib/ext2fs/ismounted.c

index 6039eaa..b26005b 100644 (file)
@@ -1760,7 +1760,6 @@ static int precreated_object(struct ext2_inode *inode)
 
 void e2fsck_pass1_run(e2fsck_t ctx)
 {
-       int     i;
        ext2_filsys fs = ctx->fs;
        ext2_ino_t      ino = 0;
        struct ext2_inode *inode = NULL;
@@ -1784,7 +1783,7 @@ void e2fsck_pass1_run(e2fsck_t ctx)
        dgrp_t          ra_group = 0;
        struct ea_quota ea_ibody_quota;
        struct process_inode_block *inodes_to_process;
-       int             process_inode_count, check_mmp;
+       int             process_inode_count, check_mmp = 0;
        e2fsck_t        global_ctx = ctx->global_ctx ? ctx->global_ctx : ctx;
        int             inode_exp = 0;
        time_t          tm;
@@ -2286,6 +2285,7 @@ void e2fsck_pass1_run(e2fsck_t ctx)
                        void *ehp;
 #ifdef WORDS_BIGENDIAN
                        __u32 tmp_block[EXT2_N_BLOCKS];
+                       int i;
 
                        for (i = 0; i < EXT2_N_BLOCKS; i++)
                                tmp_block[i] = ext2fs_swab32(inode->i_block[i]);
index 52d94c0..c414928 100644 (file)
@@ -2091,7 +2091,6 @@ int e2fsck_process_bad_inode(e2fsck_t ctx, ext2_ino_t dir,
        unsigned char           *frag, *fsize;
        struct problem_context  pctx;
        problem_t               problem = 0;
-       __u16                   badness = 0;
        unsigned int            flags = ctx->fs->flags;
 
        flags = ctx->fs->flags;
index 4d59702..01a3715 100644 (file)
@@ -107,7 +107,6 @@ void log_out(e2fsck_t ctx, const char *fmt, ...)
        int buf_size;
        int msg_size;
        int left_size;
-       int fmt_length = strlen(fmt);
 
 #ifdef HAVE_PTHREAD
        if ((ctx->options & E2F_OPT_MULTITHREAD) && ctx->global_ctx) {
index 5b99c5f..02d6e6b 100644 (file)
@@ -381,7 +381,8 @@ static int check_lustre_zfs(char *mnt_device, const char *real_devname)
                int line = 0;
                while (!feof(fp)) {
                        memset(buf, 0, PATH_MAX);
-                       fscanf(fp, "%s%*[^\n]", buf);
+                       if (fscanf(fp, "%s%*[^\n]", buf) < 1)
+                               break;
                        /* skip the first line */
                        if (line++ == 0)
                                continue;