* [PATCH net-next] liquidio: Use vzalloc()
@ 2023-05-27 19:40 Christophe JAILLET
2023-05-30 7:34 ` Simon Horman
2023-05-30 11:10 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2023-05-27 19:40 UTC (permalink / raw)
To: Derek Chickles, Satanand Burla, Felix Manlunas, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, netdev
Use vzalloc() instead of hand writing it with vmalloc()+memset().
This is less verbose.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c | 4 +---
drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
index 9ed3d1ab2ca5..285d3825cad3 100644
--- a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
+++ b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
@@ -719,12 +719,10 @@ static int cn23xx_setup_pf_mbox(struct octeon_device *oct)
for (i = 0; i < oct->sriov_info.max_vfs; i++) {
q_no = i * oct->sriov_info.rings_per_vf;
- mbox = vmalloc(sizeof(*mbox));
+ mbox = vzalloc(sizeof(*mbox));
if (!mbox)
goto free_mbox;
- memset(mbox, 0, sizeof(struct octeon_mbox));
-
spin_lock_init(&mbox->lock);
mbox->oct_dev = oct;
diff --git a/drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c b/drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c
index fda49404968c..b3bd2767d3dd 100644
--- a/drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c
+++ b/drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c
@@ -279,12 +279,10 @@ static int cn23xx_setup_vf_mbox(struct octeon_device *oct)
{
struct octeon_mbox *mbox = NULL;
- mbox = vmalloc(sizeof(*mbox));
+ mbox = vzalloc(sizeof(*mbox));
if (!mbox)
return 1;
- memset(mbox, 0, sizeof(struct octeon_mbox));
-
spin_lock_init(&mbox->lock);
mbox->oct_dev = oct;
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] liquidio: Use vzalloc()
2023-05-27 19:40 [PATCH net-next] liquidio: Use vzalloc() Christophe JAILLET
@ 2023-05-30 7:34 ` Simon Horman
2023-05-30 11:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2023-05-30 7:34 UTC (permalink / raw)
To: Christophe JAILLET
Cc: Derek Chickles, Satanand Burla, Felix Manlunas, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, linux-kernel,
kernel-janitors, netdev
On Sat, May 27, 2023 at 09:40:08PM +0200, Christophe JAILLET wrote:
> Use vzalloc() instead of hand writing it with vmalloc()+memset().
> This is less verbose.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] liquidio: Use vzalloc()
2023-05-27 19:40 [PATCH net-next] liquidio: Use vzalloc() Christophe JAILLET
2023-05-30 7:34 ` Simon Horman
@ 2023-05-30 11:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-05-30 11:10 UTC (permalink / raw)
To: Christophe JAILLET
Cc: dchickles, sburla, fmanlunas, davem, edumazet, kuba, pabeni,
linux-kernel, kernel-janitors, netdev
Hello:
This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Sat, 27 May 2023 21:40:08 +0200 you wrote:
> Use vzalloc() instead of hand writing it with vmalloc()+memset().
> This is less verbose.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c | 4 +---
> drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c | 4 +---
> 2 files changed, 2 insertions(+), 6 deletions(-)
Here is the summary with links:
- [net-next] liquidio: Use vzalloc()
https://git.kernel.org/netdev/net-next/c/bb269633f3da
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:[~2023-05-30 11:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-27 19:40 [PATCH net-next] liquidio: Use vzalloc() Christophe JAILLET
2023-05-30 7:34 ` Simon Horman
2023-05-30 11:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).