* [PATCH net-next] net: make net_device members garp_port and mrp_port conditional
@ 2017-02-10 15:43 Tobias Klauser
2017-02-14 3:03 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Tobias Klauser @ 2017-02-10 15:43 UTC (permalink / raw)
To: davem; +Cc: netdev
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 <tklauser@distanz.ch>
---
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];
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: make net_device members garp_port and mrp_port conditional
2017-02-10 15:43 [PATCH net-next] net: make net_device members garp_port and mrp_port conditional Tobias Klauser
@ 2017-02-14 3:03 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-02-14 3:03 UTC (permalink / raw)
To: tklauser; +Cc: netdev
From: Tobias Klauser <tklauser@distanz.ch>
Date: Fri, 10 Feb 2017 16:43:50 +0100
> 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 <tklauser@distanz.ch>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-02-14 3:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-10 15:43 [PATCH net-next] net: make net_device members garp_port and mrp_port conditional Tobias Klauser
2017-02-14 3:03 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).