mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
net: dsa: don't use bitmap_weight() in b53_arl_read()
Don't call bitmap_weight() if the following code can get by without it. Signed-off-by: Yury Norov <[email protected]> Acked-by: Florian Fainelli <[email protected]>
This commit is contained in:
1 parent
ce522ba9ef
commit
e18e5cbc70
1 file changed
+1
-5
@@ -1624,12 +1624,8 @@ static int b53_arl_read(struct b53_device *dev, u64 mac,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (bitmap_weight(free_bins, dev->num_arl_bins) == 0)
|
||||
return -ENOSPC;
|
||||
|
||||
*idx = find_first_bit(free_bins, dev->num_arl_bins);
|
||||
|
||||
return -ENOENT;
|
||||
return *idx >= dev->num_arl_bins ? -ENOSPC : -ENOENT;
|
||||
}
|
||||
|
||||
static int b53_arl_op(struct b53_device *dev, int op, int port,
|
||||
|
||||
Reference in new issue
Block a user