Commit b7ab39b3 authored by Claudiu Beznea's avatar Claudiu Beznea Committed by David S. Miller

net: macb: use hweight32() to count set bits in queue_mask

Use hweight32() to count set bits in queue_mask.
Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fec371f6
...@@ -3482,8 +3482,6 @@ static void macb_probe_queues(void __iomem *mem, ...@@ -3482,8 +3482,6 @@ static void macb_probe_queues(void __iomem *mem,
unsigned int *queue_mask, unsigned int *queue_mask,
unsigned int *num_queues) unsigned int *num_queues)
{ {
unsigned int hw_q;
*queue_mask = 0x1; *queue_mask = 0x1;
*num_queues = 1; *num_queues = 1;
...@@ -3498,10 +3496,7 @@ static void macb_probe_queues(void __iomem *mem, ...@@ -3498,10 +3496,7 @@ static void macb_probe_queues(void __iomem *mem,
/* bit 0 is never set but queue 0 always exists */ /* bit 0 is never set but queue 0 always exists */
*queue_mask |= readl_relaxed(mem + GEM_DCFG6) & 0xff; *queue_mask |= readl_relaxed(mem + GEM_DCFG6) & 0xff;
*num_queues = hweight32(*queue_mask);
for (hw_q = 1; hw_q < MACB_MAX_QUEUES; ++hw_q)
if (*queue_mask & (1 << hw_q))
(*num_queues)++;
} }
static int macb_clk_init(struct platform_device *pdev, struct clk **pclk, static int macb_clk_init(struct platform_device *pdev, struct clk **pclk,
......
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