net: dsa: introduce dsa_user_ports helper
Introduce a dsa_user_ports() helper to return the ds->enabled_port_mask mask which is more explicit. This will also minimize diffs when touching this internal mask. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
4a5b85ffe2
commit
02bc6e546e
@@ -276,6 +276,11 @@ static inline bool dsa_is_user_port(struct dsa_switch *ds, int p)
|
||||
return !!(ds->enabled_port_mask & BIT(p));
|
||||
}
|
||||
|
||||
static inline u32 dsa_user_ports(struct dsa_switch *ds)
|
||||
{
|
||||
return ds->enabled_port_mask;
|
||||
}
|
||||
|
||||
static inline const struct dsa_port *dsa_to_port(struct dsa_switch *ds, int p)
|
||||
{
|
||||
return &ds->ports[p];
|
||||
|
||||
Reference in New Issue
Block a user