All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: dsa: hellcreek: Use the bitmap API to allocate bitmaps
@ 2022-07-09 14:24 Christophe JAILLET
  2022-07-09 15:00 ` Kurt Kanzenbach
  2022-07-12  5:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2022-07-09 14:24 UTC (permalink / raw)
  To: Kurt Kanzenbach, Andrew Lunn, Vivien Didelot, Florian Fainelli,
	Vladimir Oltean, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, netdev

Use devm_bitmap_zalloc() instead of hand-writing them.

It is less verbose and it improves the semantic.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: dsa: hellcreek: Use the bitmap API to allocate bitmaps
  2022-07-09 14:24 [PATCH] net: dsa: hellcreek: Use the bitmap API to allocate bitmaps Christophe JAILLET
@ 2022-07-09 15:00 ` Kurt Kanzenbach
  2022-07-12  5:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Kurt Kanzenbach @ 2022-07-09 15:00 UTC (permalink / raw)
  To: Christophe JAILLET, Andrew Lunn, Vivien Didelot,
	Florian Fainelli, Vladimir Oltean, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, netdev

[-- Attachment #1: Type: text/plain, Size: 274 bytes --]

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 <christophe.jaillet@wanadoo.fr>

Acked-by: Kurt Kanzenbach <kurt@linutronix.de>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: dsa: hellcreek: Use the bitmap API to allocate bitmaps
  2022-07-09 14:24 [PATCH] net: dsa: hellcreek: Use the bitmap API to allocate bitmaps Christophe JAILLET
  2022-07-09 15:00 ` Kurt Kanzenbach
@ 2022-07-12  5:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-07-12  5:50 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: kurt, andrew, vivien.didelot, f.fainelli, olteanv, davem,
	edumazet, kuba, pabeni, linux-kernel, kernel-janitors, netdev

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

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 <christophe.jaillet@wanadoo.fr>
> ---
>  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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-12  5:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-09 14:24 [PATCH] net: dsa: hellcreek: Use the bitmap API to allocate bitmaps Christophe JAILLET
2022-07-09 15:00 ` Kurt Kanzenbach
2022-07-12  5:50 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.