* [PATCH 2/3] liquidio: Replace vmalloc + memset with vzalloc
@ 2019-07-18 7:45 Chuhong Yuan
2019-07-18 18:55 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Chuhong Yuan @ 2019-07-18 7:45 UTC (permalink / raw)
Cc: Derek Chickles, Satanand Burla, Felix Manlunas, David S . Miller,
netdev, linux-kernel, Chuhong Yuan
Use vzalloc and vzalloc_node instead of using vmalloc and
vmalloc_node and then zeroing the allocated memory by
memset 0.
This simplifies the code.
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
drivers/net/ethernet/cavium/liquidio/request_manager.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/cavium/liquidio/request_manager.c b/drivers/net/ethernet/cavium/liquidio/request_manager.c
index fcf20a8f92d9..032224178b64 100644
--- a/drivers/net/ethernet/cavium/liquidio/request_manager.c
+++ b/drivers/net/ethernet/cavium/liquidio/request_manager.c
@@ -218,15 +218,13 @@ int octeon_setup_iq(struct octeon_device *oct,
return 0;
}
oct->instr_queue[iq_no] =
- vmalloc_node(sizeof(struct octeon_instr_queue), numa_node);
+ vzalloc_node(sizeof(struct octeon_instr_queue), numa_node);
if (!oct->instr_queue[iq_no])
oct->instr_queue[iq_no] =
- vmalloc(sizeof(struct octeon_instr_queue));
+ vzalloc(sizeof(struct octeon_instr_queue));
if (!oct->instr_queue[iq_no])
return 1;
- memset(oct->instr_queue[iq_no], 0,
- sizeof(struct octeon_instr_queue));
oct->instr_queue[iq_no]->q_index = q_index;
oct->instr_queue[iq_no]->app_ctx = app_ctx;
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/3] liquidio: Replace vmalloc + memset with vzalloc
2019-07-18 7:45 [PATCH 2/3] liquidio: Replace vmalloc + memset with vzalloc Chuhong Yuan
@ 2019-07-18 18:55 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-07-18 18:55 UTC (permalink / raw)
To: hslester96; +Cc: dchickles, sburla, fmanlunas, netdev, linux-kernel
From: Chuhong Yuan <hslester96@gmail.com>
Date: Thu, 18 Jul 2019 15:45:42 +0800
> Use vzalloc and vzalloc_node instead of using vmalloc and
> vmalloc_node and then zeroing the allocated memory by
> memset 0.
> This simplifies the code.
>
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-18 18:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-18 7:45 [PATCH 2/3] liquidio: Replace vmalloc + memset with vzalloc Chuhong Yuan
2019-07-18 18:55 ` David Miller
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).