]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: add dsa_is_unused_port helper
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Thu, 26 Oct 2017 15:22:51 +0000 (11:22 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Oct 2017 15:00:09 +0000 (00:00 +0900)
commit2fd73cb991c4e64a2cbe67c47996a0d3afd6d1fd
tree4a75ab18d7dcce75a12d337fb10693a3821b444a
parent55f219167ba13f42f48903f9aca7d9bb03e1204d
net: dsa: add dsa_is_unused_port helper

As the comment above the chunk states, the b53 driver attempts to
disable the unused ports. But using ds->enabled_port_mask is misleading,
because this mask reports in fact the user ports.

To avoid confusion and fix this, this patch introduces an explicit
dsa_is_unused_port helper which ensures the corresponding bit is not
masked in any of the switch port masks.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/b53/b53_common.c
include/net/dsa.h