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>
This commit is contained in:

committed by
Jakub Kicinski

parent
d5a619bf60
commit
05f294a852
@@ -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)
|
||||
|
Reference in New Issue
Block a user