linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] qed: use kzalloc instead of kmalloc and memset
@ 2017-11-15 14:03 Colin King
  2017-11-15 15:07 ` Elior, Ariel
  2017-11-16  1:50 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2017-11-15 14:03 UTC (permalink / raw)
  To: Ariel Elior, everest-linux-l2, netdev; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Replace kmalloc followed by a memset with kzalloc

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
index 6e15d3c10ebf..fe7c1f230028 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
@@ -1277,11 +1277,10 @@ static struct qed_dcbx_get *qed_dcbnl_get_dcbx(struct qed_hwfn *hwfn,
 {
 	struct qed_dcbx_get *dcbx_info;
 
-	dcbx_info = kmalloc(sizeof(*dcbx_info), GFP_ATOMIC);
+	dcbx_info = kzalloc(sizeof(*dcbx_info), GFP_ATOMIC);
 	if (!dcbx_info)
 		return NULL;
 
-	memset(dcbx_info, 0, sizeof(*dcbx_info));
 	if (qed_dcbx_query_params(hwfn, dcbx_info, type)) {
 		kfree(dcbx_info);
 		return NULL;
-- 
2.14.1

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

* RE: [PATCH] qed: use kzalloc instead of kmalloc and memset
  2017-11-15 14:03 [PATCH] qed: use kzalloc instead of kmalloc and memset Colin King
@ 2017-11-15 15:07 ` Elior, Ariel
  2017-11-16  1:50 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Elior, Ariel @ 2017-11-15 15:07 UTC (permalink / raw)
  To: Colin King, Dept-Eng Everest Linux L2, netdev
  Cc: kernel-janitors, linux-kernel

> Subject: [PATCH] qed: use kzalloc instead of kmalloc and memset
> 
> From: Colin Ian King <colin.king@canonical.com>
> 
> Replace kmalloc followed by a memset with kzalloc
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Ariel Elior <aelior@cavium.com>

Thanks Colin,
Ariel

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

* Re: [PATCH] qed: use kzalloc instead of kmalloc and memset
  2017-11-15 14:03 [PATCH] qed: use kzalloc instead of kmalloc and memset Colin King
  2017-11-15 15:07 ` Elior, Ariel
@ 2017-11-16  1:50 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-11-16  1:50 UTC (permalink / raw)
  To: colin.king
  Cc: Ariel.Elior, everest-linux-l2, netdev, kernel-janitors, linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Wed, 15 Nov 2017 14:03:20 +0000

> From: Colin Ian King <colin.king@canonical.com>
> 
> Replace kmalloc followed by a memset with kzalloc
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

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

end of thread, other threads:[~2017-11-16  1:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-15 14:03 [PATCH] qed: use kzalloc instead of kmalloc and memset Colin King
2017-11-15 15:07 ` Elior, Ariel
2017-11-16  1:50 ` 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).