public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Jeff Layton <jlayton@kernel.org>,
	Rasmus Villemoes <rasmus.villemoes@prevas.dk>,
	Chuck Lever <chuck.lever@oracle.com>,
	Trond Myklebust <trond.myklebust@primarydata.com>,
	Kinglong Mee <kinglongmee@gmail.com>,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [v2] NFSD: hide unused svcxdr_dupstr()
Date: Tue, 23 Jan 2018 15:28:59 -0500	[thread overview]
Message-ID: <20180123202859.GA4484@fieldses.org> (raw)
In-Reply-To: <20180122210919.1257261-1-arnd@arndb.de>

Thanks, applied.--b.

On Mon, Jan 22, 2018 at 10:09:12PM +0100, Arnd Bergmann wrote:
> There is now only one caller left for svcxdr_dupstr() and this is inside
> of an #ifdef, so we can get a warning when the option is disabled:
> 
> fs/nfsd/nfs4xdr.c:241:1: error: 'svcxdr_dupstr' defined but not used [-Werror=unused-function]
> 
> This changes the remaining caller to use a nicer IS_ENABLED() check,
> which lets the compiler drop the unused code silently.
> 
> Fixes: e40d99e6183e ("NFSD: Clean up symlink argument XDR decoders")
> Suggested-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> v2: use IS_ENABLED() instead of an #ifdef
> ---
>  fs/nfsd/nfs4xdr.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index f51c9cccaf78..86a1a2450376 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -455,8 +455,8 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
>  	}
>  
>  	label->len = 0;
> -#ifdef CONFIG_NFSD_V4_SECURITY_LABEL
> -	if (bmval[2] & FATTR4_WORD2_SECURITY_LABEL) {
> +	if (IS_ENABLED(CONFIG_NFSD_V4_SECURITY_LABEL) &&
> +	    bmval[2] & FATTR4_WORD2_SECURITY_LABEL) {
>  		READ_BUF(4);
>  		len += 4;
>  		dummy32 = be32_to_cpup(p++); /* lfs: we don't use it */
> @@ -476,7 +476,6 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
>  		if (!label->data)
>  			return nfserr_jukebox;
>  	}
> -#endif
>  	if (bmval[2] & FATTR4_WORD2_MODE_UMASK) {
>  		if (!umask)
>  			goto xdr_error;
> -- 
> 2.9.0

      reply	other threads:[~2018-01-23 20:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-22 21:09 [PATCH] [v2] NFSD: hide unused svcxdr_dupstr() Arnd Bergmann
2018-01-23 20:28 ` J. Bruce Fields [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=20180123202859.GA4484@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=arnd@arndb.de \
    --cc=chuck.lever@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=kinglongmee@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=trond.myklebust@primarydata.com \
    /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