2022-07-09 14:52:11

by Christophe JAILLET

[permalink] [raw]
Subject: [PATCH] net: dsa: hellcreek: Use the bitmap API to allocate bitmaps

Use devm_bitmap_zalloc() instead of hand-writing them.

It is less verbose and it improves the semantic.

Signed-off-by: Christophe JAILLET <[email protected]>
---
drivers/net/dsa/hirschmann/hellcreek.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hirschmann/hellcreek.c
index ac1f3b3a7040..01f90994dedd 100644
--- a/drivers/net/dsa/hirschmann/hellcreek.c
+++ b/drivers/net/dsa/hirschmann/hellcreek.c
@@ -1894,11 +1894,8 @@ static int hellcreek_probe(struct platform_device *pdev)
if (!port->counter_values)
return -ENOMEM;

- port->vlan_dev_bitmap =
- devm_kcalloc(dev,
- BITS_TO_LONGS(VLAN_N_VID),
- sizeof(unsigned long),
- GFP_KERNEL);
+ port->vlan_dev_bitmap = devm_bitmap_zalloc(dev, VLAN_N_VID,
+ GFP_KERNEL);
if (!port->vlan_dev_bitmap)
return -ENOMEM;

--
2.34.1


2022-07-09 15:09:12

by Kurt Kanzenbach

[permalink] [raw]
Subject: Re: [PATCH] net: dsa: hellcreek: Use the bitmap API to allocate bitmaps

On Sat Jul 09 2022, Christophe JAILLET wrote:
> Use devm_bitmap_zalloc() instead of hand-writing them.
>
> It is less verbose and it improves the semantic.
>
> Signed-off-by: Christophe JAILLET <[email protected]>

Acked-by: Kurt Kanzenbach <[email protected]>


Attachments:
signature.asc (877.00 B)

2022-07-12 06:01:25

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH] net: dsa: hellcreek: Use the bitmap API to allocate bitmaps

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <[email protected]>:

On Sat, 9 Jul 2022 16:24:45 +0200 you wrote:
> Use devm_bitmap_zalloc() instead of hand-writing them.
>
> It is less verbose and it improves the semantic.
>
> Signed-off-by: Christophe JAILLET <[email protected]>
> ---
> drivers/net/dsa/hirschmann/hellcreek.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)

Here is the summary with links:
- net: dsa: hellcreek: Use the bitmap API to allocate bitmaps
https://git.kernel.org/netdev/net-next/c/e7bde1c581e4

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html