From patchwork Fri Feb 10 15:43:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Klauser X-Patchwork-Id: 726581 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3vKfRd05Qfz9s4s for ; Sat, 11 Feb 2017 02:45:49 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752665AbdBJPpf (ORCPT ); Fri, 10 Feb 2017 10:45:35 -0500 Received: from mail.zhinst.com ([212.126.164.98]:52784 "EHLO mail.zhinst.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752513AbdBJPpe (ORCPT ); Fri, 10 Feb 2017 10:45:34 -0500 Received: from ziws08.zhinst.com ([10.42.0.7]) by mail.zhinst.com (Kerio Connect 9.2.1) with ESMTP; Fri, 10 Feb 2017 16:43:55 +0100 From: Tobias Klauser To: davem@davemloft.net Cc: netdev@vger.kernel.org Subject: [PATCH net-next] net: make net_device members garp_port and mrp_port conditional Date: Fri, 10 Feb 2017 16:43:50 +0100 Message-Id: <20170210154350.11694-1-tklauser@distanz.ch> X-Mailer: git-send-email 2.11.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org garp_port is only used in net/802/garp.c which is only compiled with CONFIG_GARP enabled. Same goes for mrp_port which is only used in net/802/mrp.c with CONFIG_MRP enabled. Only include the two members in struct net_device if their respective CONFIG_* is enabled. This saves a few bytes in struct net_device in case CONFIG_GARP or CONFIG_MRP are not enabled. Signed-off-by: Tobias Klauser --- include/linux/netdevice.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 58afbd1cc659..7bb38f2c65c2 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1863,8 +1863,12 @@ struct net_device { struct pcpu_vstats __percpu *vstats; }; +#if IS_ENABLED(CONFIG_GARP) struct garp_port __rcu *garp_port; +#endif +#if IS_ENABLED(CONFIG_MRP) struct mrp_port __rcu *mrp_port; +#endif struct device dev; const struct attribute_group *sysfs_groups[4];