mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Jiang Biao <benbjiang@tencent.com>
Cc: jack@suse.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs/quota: erase unused but set variable warning
Date: Thu, 25 Apr 2019 17:05:58 +0200	[thread overview]
Message-ID: <20190425150558.GA32215@quack2.suse.cz> (raw)
In-Reply-To: <20190424005857.82284-1-benbjiang@tencent.com>

On Wed 24-04-19 08:58:57, Jiang Biao wrote:
> Local variable *reserved* of remove_dquot_ref() is only used if
> define CONFIG_QUOTA_DEBUG, but not ebraced in CONFIG_QUOTA_DEBUG
> macro, which leads to unused-but-set-variable warning when compiling.
> 
> This patch ebrace it into CONFIG_QUOTA_DEBUG macro like what is done
> in add_dquot_ref().
> 
> Signed-off-by: Jiang Biao <benbjiang@tencent.com>

Thanks. I've added the patch to my tree.

								Honza

> ---
>  fs/quota/dquot.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
> index fc20e06c56ba..14ee4c6deba1 100644
> --- a/fs/quota/dquot.c
> +++ b/fs/quota/dquot.c
> @@ -1049,7 +1049,9 @@ static void remove_dquot_ref(struct super_block *sb, int type,
>  		struct list_head *tofree_head)
>  {
>  	struct inode *inode;
> +#ifdef CONFIG_QUOTA_DEBUG
>  	int reserved = 0;
> +#endif
>  
>  	spin_lock(&sb->s_inode_list_lock);
>  	list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
> @@ -1061,8 +1063,10 @@ static void remove_dquot_ref(struct super_block *sb, int type,
>  		 */
>  		spin_lock(&dq_data_lock);
>  		if (!IS_NOQUOTA(inode)) {
> +#ifdef CONFIG_QUOTA_DEBUG
>  			if (unlikely(inode_get_rsv_space(inode) > 0))
>  				reserved = 1;
> +#endif
>  			remove_inode_dquot_ref(inode, type, tofree_head);
>  		}
>  		spin_unlock(&dq_data_lock);
> -- 
> 2.17.2 (Apple Git-113)
> 
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

      reply	other threads:[~2019-04-25 15:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-24  0:58 Jiang Biao
2019-04-25 15:05 ` Jan Kara [this message]

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=20190425150558.GA32215@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=benbjiang@tencent.com \
    --cc=jack@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®