summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bcmsysport.c
diff options
context:
space:
mode:
authorYury Norov <yury.norov@gmail.com>2022-01-23 10:38:33 -0800
committerYury Norov <yury.norov@gmail.com>2022-05-02 06:30:39 -0700
commit1ef1b69beaad10aab85292b822c7cfed4fb01586 (patch)
tree8cd442e6b069953934b6bc987c587c9f1b09bc65 /drivers/net/ethernet/broadcom/bcmsysport.c
parente18e5cbc70f17029c3d028ee701cecc45b7618b4 (diff)
downloadlinux-1ef1b69beaad10aab85292b822c7cfed4fb01586.tar.bz2
net: systemport: don't use bitmap_weight() in bcm_sysport_rule_set()
Don't call bitmap_weight() if the following code can get by without it. Signed-off-by: Yury Norov <yury.norov@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bcmsysport.c')
-rw-r--r--drivers/net/ethernet/broadcom/bcmsysport.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index 60dde29974bf..5284a5c961db 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -2180,13 +2180,9 @@ static int bcm_sysport_rule_set(struct bcm_sysport_priv *priv,
if (nfc->fs.ring_cookie != RX_CLS_FLOW_WAKE)
return -EOPNOTSUPP;
- /* All filters are already in use, we cannot match more rules */
- if (bitmap_weight(priv->filters, RXCHK_BRCM_TAG_MAX) ==
- RXCHK_BRCM_TAG_MAX)
- return -ENOSPC;
-
index = find_first_zero_bit(priv->filters, RXCHK_BRCM_TAG_MAX);
if (index >= RXCHK_BRCM_TAG_MAX)
+ /* All filters are already in use, we cannot match more rules */
return -ENOSPC;
/* Location is the classification ID, and index is the position