mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
net: dsa: use dsa_tree_for_each_cpu_port in dsa_tree_{setup,teardown}_master
More logic will be added to dsa_tree_setup_master() and dsa_tree_teardown_master() in upcoming changes. Reduce the indentation by one level in these functions by introducing and using a dedicated iterator for CPU ports of a tree. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
committed by
Paolo Abeni
parent
f41ec1fd1c
commit
5dc760d120
@@ -559,6 +559,10 @@ static inline bool dsa_is_user_port(struct dsa_switch *ds, int p)
|
||||
list_for_each_entry((_dp), &(_dst)->ports, list) \
|
||||
if (dsa_port_is_user((_dp)))
|
||||
|
||||
#define dsa_tree_for_each_cpu_port(_dp, _dst) \
|
||||
list_for_each_entry((_dp), &(_dst)->ports, list) \
|
||||
if (dsa_port_is_cpu((_dp)))
|
||||
|
||||
#define dsa_switch_for_each_port(_dp, _ds) \
|
||||
list_for_each_entry((_dp), &(_ds)->dst->ports, list) \
|
||||
if ((_dp)->ds == (_ds))
|
||||
|
||||
Reference in New Issue
Block a user