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.3 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 DEDF6C4BA06 for ; Thu, 27 Feb 2020 08:50:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BB17524683 for ; Thu, 27 Feb 2020 08:50:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728776AbgB0Iuz (ORCPT ); Thu, 27 Feb 2020 03:50:55 -0500 Received: from relay.sw.ru ([185.231.240.75]:52820 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728469AbgB0Iuz (ORCPT ); Thu, 27 Feb 2020 03:50:55 -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 1j7EsC-00043o-NO; Thu, 27 Feb 2020 11:50:24 +0300 Subject: Re: [PATCH] unix: define and set show_fdinfo only if procfs is enabled To: Tobias Klauser , "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Arnd Bergmann References: <20200226172953.16471-1-tklauser@distanz.ch> From: Kirill Tkhai Message-ID: <6ac440dc-8300-2c19-d9a1-6b92c1cf8b84@virtuozzo.com> Date: Thu, 27 Feb 2020 11:50:24 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200226172953.16471-1-tklauser@distanz.ch> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 26.02.2020 20:29, Tobias Klauser wrote: > Follow the pattern used with other *_show_fdinfo functions and only > define unix_show_fdinfo and set it in proto_ops if CONFIG_PROCFS > is set. > > Fixes: 3c32da19a858 ("unix: Show number of pending scm files of receive queue in fdinfo") > Signed-off-by: Tobias Klauser Reviewed-by: Kirill Tkhai > --- > net/unix/af_unix.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c > index 62c12cb5763e..aa6e2530e1ec 100644 > --- a/net/unix/af_unix.c > +++ b/net/unix/af_unix.c > @@ -682,6 +682,7 @@ static int unix_set_peek_off(struct sock *sk, int val) > return 0; > } > > +#ifdef CONFIG_PROCFS > static void unix_show_fdinfo(struct seq_file *m, struct socket *sock) > { > struct sock *sk = sock->sk; > @@ -692,6 +693,9 @@ static void unix_show_fdinfo(struct seq_file *m, struct socket *sock) > seq_printf(m, "scm_fds: %u\n", READ_ONCE(u->scm_stat.nr_fds)); > } > } > +#else > +#define unix_show_fdinfo NULL > +#endif > > static const struct proto_ops unix_stream_ops = { > .family = PF_UNIX, >