From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tonghao Zhang Subject: [PATCH v6 3/3] sock: Hide unused variable when !CONFIG_PROC_FS. Date: Sun, 10 Dec 2017 07:12:06 -0800 Message-ID: <1512918726-2731-3-git-send-email-xiangxia.m.yue@gmail.com> References: <1512918726-2731-1-git-send-email-xiangxia.m.yue@gmail.com> Cc: netdev@vger.kernel.org, Tonghao Zhang To: davem@davemloft.net, xiyou.wangcong@gmail.com, edumazet@google.com, willemb@google.com, xemul@openvz.org Return-path: Received: from mail-pl0-f65.google.com ([209.85.160.65]:40939 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752010AbdLJPM4 (ORCPT ); Sun, 10 Dec 2017 10:12:56 -0500 Received: by mail-pl0-f65.google.com with SMTP id 1so3096590pla.7 for ; Sun, 10 Dec 2017 07:12:56 -0800 (PST) In-Reply-To: <1512918726-2731-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