From patchwork Mon Jan 22 21:09:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10179331 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9758560224 for ; Mon, 22 Jan 2018 21:09:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 865831FF1E for ; Mon, 22 Jan 2018 21:09:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A23F28173; Mon, 22 Jan 2018 21:09:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 017371FF1E for ; Mon, 22 Jan 2018 21:09:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750973AbeAVVJg (ORCPT ); Mon, 22 Jan 2018 16:09:36 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:50367 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750909AbeAVVJg (ORCPT ); Mon, 22 Jan 2018 16:09:36 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MPp7i-1ehYpd0FSE-0054e8; Mon, 22 Jan 2018 22:09:23 +0100 From: Arnd Bergmann To: "J. Bruce Fields" , Jeff Layton Cc: Rasmus Villemoes , Arnd Bergmann , Chuck Lever , Trond Myklebust , Kinglong Mee , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [v2] NFSD: hide unused svcxdr_dupstr() Date: Mon, 22 Jan 2018 22:09:12 +0100 Message-Id: <20180122210919.1257261-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:nWJ/iQxwkxc3F/Rf0pkaHOC8gW1oKEPbskEdYfSi04r4a0WUnUH sKilSNlDqAzdbX/FtfATMu5iyRF1vkbJCQ+3M3ck1tgCNjnpi7YfH5JWjClHEp63qef+kPo CqxanZDpqYD15ACjJ0I8aLDEJG042nRVcLnKQ993UV/wMg25IdA9hqZ3Tdqh2B9JakUumx+ KBUMLLgq8pyQoT13H96og== X-UI-Out-Filterresults: notjunk:1; V01:K0:ullkLpgEv2U=:/1ZrteZi94bxhurmNpDEQI O2T5voS/HKhUEA1EY0r+p/pisseDpAqDY7zrOy3vvvnbJP/f48FeI/OkeY0lscIuCcR0yFsXK Cjg/WgsBrfnBHkFEUhqfkFhyUuZSqxMSVDZZetCHh6KgoD5YhTncyoc5ApHj+CdqCs3HmsyG0 E9YV7pSJ+o3MedvJkSEcENuz1NLJhRTcfKo4xFER+u85JA7r0fkIiMgMO/iwKarvyHl7v6Fsi Ss7aDxsSYe29vewBgvAbW5K4I6CLN6bLHHDTFdhDsH0rHljkgtVELIuTlbc+8KQTDYEvTISND PGrNnVZyjt3rD2kap7UyegJUGOiUBUTeHPQBXFHxHNjnfitPikImfcu6FTvJ6MU0zXHcD+as9 brys9b/CGN2CgjaeZOMOWRACi7F4un/cPRSCZDYfYs+HWAePzHFi5zw3YY/p6j4wfiaeIwhHz ze9y+E5VXTsfDPhyCQ1NDz9rZ034AafWEUmia0JQSppdU4UR1kVipaYY38cElvGaTZWEtw3aY rZiWVSKKFI3FNdWbpNupKDYOqYv+s1zoiMEugMTWvTBA1pxc/8lpo53o79C6d2uOvVBQ/tsZj 3v/6F1T0CId9dzGw/uAFp2eXK1XYYupZuA4lDFGcFPC3wEHLbnICb9Ih4lnVoYbHfh7OCH5jo J+CS8jCdtZ6gNciL6Kqtabr6lGST1iEKcDqlm7ktZa3ELnVLFeFvhdvtxcoz10jtdr6mHHzVy IPxVJ7Uqotc5dFaFCpsj53jCyShHQLuWGf7akA== Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Arnd Bergmann --- 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;