From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tonghao Zhang Subject: [PATCH v7 3/3] sock: Hide unused variable when !CONFIG_PROC_FS. Date: Thu, 14 Dec 2017 05:51:59 -0800 Message-ID: <1513259519-32332-3-git-send-email-xiangxia.m.yue@gmail.com> References: <1513259519-32332-1-git-send-email-xiangxia.m.yue@gmail.com> Cc: netdev@vger.kernel.org, Tonghao Zhang , Pavel Emelyanov To: xiyou.wangcong@gmail.com, davem@davemloft.net Return-path: Received: from mail-pf0-f193.google.com ([209.85.192.193]:40391 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752509AbdLNNwM (ORCPT ); Thu, 14 Dec 2017 08:52:12 -0500 Received: by mail-pf0-f193.google.com with SMTP id v26so3652874pfl.7 for ; Thu, 14 Dec 2017 05:52:11 -0800 (PST) In-Reply-To: <1513259519-32332-1-git-send-email-xiangxia.m.yue@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: When CONFIG_PROC_FS is disabled, we will not use the prot_inuse counter. This adds an #ifdef to hide the variable definition in that case. This is not a bugfix. But we can save bytes when there are many network namespace. Cc: Pavel Emelyanov Signed-off-by: Martin Zhang Signed-off-by: Tonghao Zhang --- include/net/netns/core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/netns/core.h b/include/net/netns/core.h index a5e8a66..36c2d99 100644 --- a/include/net/netns/core.h +++ b/include/net/netns/core.h @@ -13,8 +13,8 @@ struct netns_core { #ifdef CONFIG_PROC_FS int __percpu *sock_inuse; -#endif struct prot_inuse __percpu *prot_inuse; +#endif }; #endif -- 1.8.3.1