aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/dsa.h
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2017-10-26 11:22:56 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-28 00:00:09 +0900
commit02bc6e546e858b209c3ebe380a13a73b333b1b3f (patch)
treebb5750dc5daf1022a39028a48ce6e932a3888f2a /include/net/dsa.h
parentnet: dsa: use dsa_is_user_port everywhere (diff)
downloadlinux-dev-02bc6e546e858b209c3ebe380a13a73b333b1b3f.tar.xz
linux-dev-02bc6e546e858b209c3ebe380a13a73b333b1b3f.zip
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>
Diffstat (limited to 'include/net/dsa.h')
-rw-r--r--include/net/dsa.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 49701d958663..dc7728062396 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -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];