Commit 1ef1b69b authored by Yury Norov's avatar Yury Norov

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: default avatarYury Norov <yury.norov@gmail.com>
Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
parent e18e5cbc
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment