From: Jan Kara <jack@suse.cz>
To: Austin Kim <austindh.kim@gmail.com>
Cc: tytso@mit.edu, adilger.kernel@dilger.ca,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
austin.kim@lge.com
Subject: Re: [PATCH] ext4: remove an unused variable warning with CONFIG_QUOTA=n
Date: Thu, 14 Oct 2021 11:26:04 +0200 [thread overview]
Message-ID: <20211014092604.GC15931@quack2.suse.cz> (raw)
In-Reply-To: <20210824034929.GA13415@raspberrypi>
On Tue 24-08-21 04:49:29, Austin Kim wrote:
> 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 <austindh.kim@gmail.com>
I guess this has fallen through the cracks. The fix looks good to me. Feel
free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/ext4/super.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 6b03e4281f6f..6adb570f4b31 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -5845,10 +5845,10 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
> struct ext4_sb_info *sbi = EXT4_SB(sb);
> unsigned long old_sb_flags, vfs_flags;
> struct ext4_mount_options old_opts;
> - int enable_quota = 0;
> ext4_group_t g;
> int err = 0;
> #ifdef CONFIG_QUOTA
> + int enable_quota = 0;
> int i, j;
> char *to_free[EXT4_MAXQUOTAS];
> #endif
> @@ -6053,7 +6053,9 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
> err = -EROFS;
> goto restore_opts;
> }
> +#ifdef CONFIG_QUOTA
> enable_quota = 1;
> +#endif
> }
> }
>
> --
> 2.20.1
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2021-10-14 9:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-24 3:49 [PATCH] ext4: remove an unused variable warning with CONFIG_QUOTA=n Austin Kim
2021-09-05 23:19 ` Austin Kim
2021-10-14 9:26 ` Jan Kara [this message]
2021-10-28 14:56 ` Theodore Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211014092604.GC15931@quack2.suse.cz \
--to=jack@suse.cz \
--cc=adilger.kernel@dilger.ca \
--cc=austin.kim@lge.com \
--cc=austindh.kim@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).