summaryrefslogtreecommitdiff
path: root/include/net/dsa.h
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@gmail.com>2019-10-21 16:51:29 -0400
committerJakub Kicinski <jakub.kicinski@netronome.com>2019-10-22 12:37:07 -0700
commit05f294a852358a46d9236cc777901f49a4f0ae85 (patch)
tree94bdc5aa04031d3c601b7a820339d0ddb0a5a2cf /include/net/dsa.h
parentd5a619bf60ecf910175606921b4610a2842c635e (diff)
downloadlwn-05f294a852358a46d9236cc777901f49a4f0ae85.tar.gz
lwn-05f294a852358a46d9236cc777901f49a4f0ae85.zip
net: dsa: allocate ports on touch
Allocate the struct dsa_port the first time it is accessed with dsa_port_touch, and remove the static dsa_port array from the dsa_switch structure. Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Diffstat (limited to 'include/net/dsa.h')
-rw-r--r--include/net/dsa.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index f572134eb5de..9bc1d3f71f89 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -277,9 +277,7 @@ struct dsa_switch {
*/
bool vlan_filtering;
- /* Dynamically allocated ports, keep last */
size_t num_ports;
- struct dsa_port ports[];
};
static inline struct dsa_port *dsa_to_port(struct dsa_switch *ds, int p)