From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCF5FC282DD for ; Wed, 8 Jan 2020 13:37:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8F4BA20692 for ; Wed, 8 Jan 2020 13:37:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727938AbgAHNh0 (ORCPT ); Wed, 8 Jan 2020 08:37:26 -0500 Received: from relay.sw.ru ([185.231.240.75]:59824 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726144AbgAHNh0 (ORCPT ); Wed, 8 Jan 2020 08:37:26 -0500 Received: from dhcp-172-16-24-104.sw.ru ([172.16.24.104]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1ipBWC-0005kp-73; Wed, 08 Jan 2020 16:37:04 +0300 Subject: Re: [PATCH] [net-next] socket: fix unused-function warning To: Arnd Bergmann , "David S. Miller" Cc: Jens Axboe , Willem de Bruijn , Deepa Dinamani , Johannes Berg , Al Viro , Pedro Tammela , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200107213609.520236-1-arnd@arndb.de> From: Kirill Tkhai Message-ID: <8bc0e3d2-c2e0-b4ab-63fa-8b124ab4d0f8@virtuozzo.com> Date: Wed, 8 Jan 2020 16:37:03 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20200107213609.520236-1-arnd@arndb.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08.01.2020 00:35, Arnd Bergmann wrote: > When procfs is disabled, the fdinfo code causes a harmless > warning: > > net/socket.c:1000:13: error: 'sock_show_fdinfo' defined but not used [-Werror=unused-function] > static void sock_show_fdinfo(struct seq_file *m, struct file *f) > > Change the preprocessor conditional to a compiler conditional > to avoid the warning and let the compiler throw away the > function itself. > > Fixes: b4653342b151 ("net: Allow to show socket-specific information in /proc/[pid]/fdinfo/[fd]") > Signed-off-by: Arnd Bergmann Thanks for fixing. Acked-by: Kirill Tkhai > --- > net/socket.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/net/socket.c b/net/socket.c > index 5230c9e1bdec..444a617819f0 100644 > --- a/net/socket.c > +++ b/net/socket.c > @@ -151,9 +151,7 @@ static const struct file_operations socket_file_ops = { > .sendpage = sock_sendpage, > .splice_write = generic_splice_sendpage, > .splice_read = sock_splice_read, > -#ifdef CONFIG_PROC_FS > - .show_fdinfo = sock_show_fdinfo, > -#endif > + .show_fdinfo = IS_ENABLED(CONFIG_PROC_FS) ? sock_show_fdinfo : NULL, > }; > > /* >