From patchwork Thu Jan 28 16:39:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101050 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp586090lbb; Thu, 28 Jan 2016 08:40:24 -0800 (PST) X-Received: by 10.98.12.21 with SMTP id u21mr5890350pfi.36.1453999223930; Thu, 28 Jan 2016 08:40:23 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id kw9si17852324pab.63.2016.01.28.08.40.23; Thu, 28 Jan 2016 08:40:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161394AbcA1QkR (ORCPT + 4 others); Thu, 28 Jan 2016 11:40:17 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:57639 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161179AbcA1QkO (ORCPT ); Thu, 28 Jan 2016 11:40:14 -0500 Received: from wuerfel.localnet ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0MA5UH-1aE9RC1FjF-00BNMx; Thu, 28 Jan 2016 17:39:31 +0100 From: Arnd Bergmann To: "David S. Miller" Cc: Sergei Shtylyov , linux-arm-kernel@lists.infradead.org, Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , Patrick McHardy , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCHv2] ipv4: ipconfig: avoid unused ic_proto_used symbol Date: Thu, 28 Jan 2016 17:39:24 +0100 Message-ID: <2132183.67sfLfLqZb@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V03:K0:oUcPH2HW1loMouHHUnnTrY+G4quuUZbkzH7YEtXgx9ddzA3HqtZ pJLpScxKwi1XCOhMYYpM7bi5WPLw5O09c4oZmb25U5EMfa4TCnhSABrGG6yc4yb+LaWIjhl +LIX7UrEzfZ6LGR1QKIqhT9f1qPajQeIIbk7zrwIU1Uy7pJQ1dA3ewPRqOQAFZfnYdk/T9i MZf7RinBAYdGgEBwSe7Qw== X-UI-Out-Filterresults: notjunk:1; V01:K0:FRMAeNneDFg=:eTzJwZMtkjPcB47cvmdSQg 6dTzbuNBhABS+zlfRqJFfC4ve6INOPfMBYp+L6MimE4GeQ/5yjKZtuEfeRa6/gZF8KoVca99I 1Yp+o6EmeI468lMf7Oe8TgmSQEtmlewp0mlBBs7AHmVoXV22CDBDoY0MKzEpbDErlIA9vy0vO 0YtuBOcepJwuw33TfBnGmtBkU9oRKV8pLhMMgh/3DVMS3LMBaDDaEPZt6r2Th87FVXsgj55zO cP+mDQOge/qlJvznW86iQBRPQRVOrEgyblYTSCmTzYAolEQnq2KaA8n7IB1Rw2WjNzaFvVlbF 4UbMi8eiKaiCU0bWARv0TX5AX68diAipLOcNf21DVbnKur+Q7Mh6Dd6IuzciRc2LFCXJ5VDNl 9/OKkD+gs00ozjdA4nI7CbnQU1GqDGL1A5+erTNmN0gtiVThB6N6HaBEoYCBF5Rb8ys+vpubW gZwBK2nqVQ3E5dow1R561CfbA+tVV4y7K6i8h0WtcDUPTRVkYaevNXecVtkm0HLH3rQV0vBrQ 35HL21AX+b078Y/2iulng6myca5fem20czsUaocWMSmScBOS5MDNFmS3v9MAPLFfllxHPEF7v JSUBMBnr8O4AtrdDEzJBw+YL8wgIVnWNRcUFUFmZrexBC9Q8/EBtrGEyCyiriTaB88TGuVQyZ /a+CaLVnHvWBWqn+ynCmsz/04MZ3C3Hr4+Ab9qJcS+hNtQXIG/5ktvRUsJ6na0Fr6kp0FmXJn xQYU/0P5a8ppqU7T Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When CONFIG_PROC_FS, CONFIG_IP_PNP_BOOTP, CONFIG_IP_PNP_DHCP and CONFIG_IP_PNP_RARP are all disabled, we get a warning about the ic_proto_used variable being unused: net/ipv4/ipconfig.c:146:12: error: 'ic_proto_used' defined but not used [-Werror=unused-variable] This avoids the warning, by making the definition conditional on whether a dynamic IP configuration protocol is configured. If not, we know that the value is always zero, so we can optimize away the variable and all code that depends on it. Signed-off-by: Arnd Bergmann --- v2: fix typo in changelog diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index 67f7c9de0b16..2ed9dd2b5f2f 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c @@ -143,7 +143,11 @@ static char dhcp_client_identifier[253] __initdata; /* Persistent data: */ +#ifdef IPCONFIG_DYNAMIC static int ic_proto_used; /* Protocol used, if any */ +#else +#define ic_proto_used 0 +#endif static __be32 ic_nameservers[CONF_NAMESERVERS_MAX]; /* DNS Server IP addresses */ static u8 ic_domain[64]; /* DNS (not NIS) domain name */