Skip to content

Commit 3bbef91

Browse files
austindhkimtytso
authored andcommitted
ext4: remove an unused variable warning with CONFIG_QUOTA=n
The 'enable_quota' variable is only used in an CONFIG_QUOTA. With CONFIG_QUOTA=n, compiler causes a harmless warning: fs/ext4/super.c: In function ‘ext4_remount’: fs/ext4/super.c:5840:6: warning: variable ‘enable_quota’ set but not used [-Wunused-but-set-variable] int enable_quota = 0; ^~~~~ Move 'enable_quota' into the same #ifdef CONFIG_QUOTA block to remove an unused variable warning. Signed-off-by: Austin Kim <[email protected]> Reviewed-by: Jan Kara <[email protected]> Link: https://lore.kernel.org/r/20210824034929.GA13415@raspberrypi Signed-off-by: Theodore Ts'o <[email protected]>
1 parent d4ffeeb commit 3bbef91

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/ext4/super.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5726,10 +5726,10 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
57265726
struct ext4_sb_info *sbi = EXT4_SB(sb);
57275727
unsigned long old_sb_flags, vfs_flags;
57285728
struct ext4_mount_options old_opts;
5729-
int enable_quota = 0;
57305729
ext4_group_t g;
57315730
int err = 0;
57325731
#ifdef CONFIG_QUOTA
5732+
int enable_quota = 0;
57335733
int i, j;
57345734
char *to_free[EXT4_MAXQUOTAS];
57355735
#endif
@@ -5934,7 +5934,9 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
59345934
err = -EROFS;
59355935
goto restore_opts;
59365936
}
5937+
#ifdef CONFIG_QUOTA
59375938
enable_quota = 1;
5939+
#endif
59385940
}
59395941
}
59405942

0 commit comments

Comments
 (0)