diff mbox series

fs/ext4/super.c : fix two compile errors

Message ID 7ca8f790-c14e-6449-f3b5-4214d3fb1e61@googlemail.com
State Superseded
Headers show
Series fs/ext4/super.c : fix two compile errors | expand

Commit Message

Chris Clayton April 26, 2023, 9:20 p.m. UTC
dcbf87589d90 results in 2 build errors in fs/ext4/super.c because, in both affected
functions, a variable is left unused if CONFIG_QUOTA is not defined. The patch
below fixes this. It is compile tested only.

...
  CC      fs/ext4/super.o
fs/ext4/super.c: In function 'ext4_put_super':
fs/ext4/super.c:1262:13: error: unused variable 'i' [-Werror=unused-variable]
 1262 |         int i, err;
      |             ^
fs/ext4/super.c: In function '__ext4_fill_super':
fs/ext4/super.c:5200:22: error: unused variable 'i' [-Werror=unused-variable]
 5200 |         unsigned int i;
      |                      ^
cc1: all warnings being treated as errors
...

Fixes:  dcbf87589d90 (ext4: factor out ext4_flex_groups_free())
Signed-off-by: Chris Clayton <chris2553@googlemail.com>

Comments

Jason Yan April 27, 2023, 1:32 a.m. UTC | #1
On 2023/4/27 5:20, Chris Clayton wrote:
> dcbf87589d90 results in 2 build errors in fs/ext4/super.c because, in both affected
> functions, a variable is left unused if CONFIG_QUOTA is not defined. The patch
> below fixes this. It is compile tested only.
> 
> ...
>    CC      fs/ext4/super.o
> fs/ext4/super.c: In function 'ext4_put_super':
> fs/ext4/super.c:1262:13: error: unused variable 'i' [-Werror=unused-variable]
>   1262 |         int i, err;
>        |             ^
> fs/ext4/super.c: In function '__ext4_fill_super':
> fs/ext4/super.c:5200:22: error: unused variable 'i' [-Werror=unused-variable]
>   5200 |         unsigned int i;
>        |                      ^
> cc1: all warnings being treated as errors
> ...
> 
> Fixes:  dcbf87589d90 (ext4: factor out ext4_flex_groups_free())
> Signed-off-by: Chris Clayton<chris2553@googlemail.com>

There are already fixes. But still thank you for the patch.

http://patchwork.ozlabs.org/project/linux-ext4/patch/20230420-ext4-unused-variables-super-c-v1-1-138b6db6c21c@kernel.org/
http://patchwork.ozlabs.org/project/linux-ext4/patch/20230421070815.2260326-1-arnd@kernel.org/

Best wishes,
Jason
diff mbox series

Patch

--- linux.git/fs/ext4/super.c.orig      2023-04-26 21:36:22.624283246 +0100
+++ linux.git/fs/ext4/super.c   2023-04-26 21:38:52.888289558 +0100
@@ -1259,7 +1259,10 @@  static void ext4_put_super(struct super_
        struct ext4_sb_info *sbi = EXT4_SB(sb);
        struct ext4_super_block *es = sbi->s_es;
        int aborted = 0;
-       int i, err;
+#ifdef CONFIG_QUOTA
+       int i;
+#endif
+       int err;

        /*
         * Unregister sysfs before destroying jbd2 journal.
@@ -5197,7 +5200,9 @@  static int __ext4_fill_super(struct fs_c
        ext4_fsblk_t logical_sb_block;
        struct inode *root;
        int ret = -ENOMEM;
+#ifdef CONFIG_QUOTA
        unsigned int i;
+#endif
        int needs_recovery;
        int err = 0;
        ext4_group_t first_not_zeroed;