Skip to contentSkip to conversation

ext4: Elide an unused variable warning in ext4_put_super()

PATCH New Palmer Dabbelt 1 participant 2 messages Apr 30, 2023 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ext4: Elide an unused variable warning in ext4_put_super()

i is only used under CONFIG_QUOTA, so mark it as __maybe_unused to avoid a warning.

---
 fs/ext4/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/super.c +1 -1
index d03bf0ecf505..09f3e1d714d6 100644
@@ -1259,7 +1259,7 @@ static void ext4_put_super(struct super_block *sb)
 	struct ext4_sb_info *sbi = EXT4_SB(sb);
 	struct ext4_super_block *es = sbi->s_es;
 	int aborted = 0;
-	int i, err;
+	int __maybe_unused i, err;
 
 	/*
 	 * Unregister sysfs before destroying jbd2 journal.
Signature · 1 line
2.40.0
#1 lore raw

PATCH 2/2 ext4: Elide an unused variable warning in __ext4_fill_super()

i is only used under CONFIG_QUOTA, so mark it as __maybe_unused to avoid a warning.

---
 fs/ext4/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/super.c +1 -1
index 09f3e1d714d6..3bf2449befcc 100644
@@ -5197,7 +5197,7 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
 	ext4_fsblk_t logical_sb_block;
 	struct inode *root;
 	int ret = -ENOMEM;
-	unsigned int i;
+	unsigned int __maybe_unused i;
 	int needs_recovery;
 	int err = 0;
 	ext4_group_t first_not_zeroed;
Signature · 1 line
2.40.0