netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wlcore: consolidate kmalloc + memset 0 into kzalloc
@ 2015-12-21 16:47 Nicholas Mc Guire
  2015-12-21 22:56 ` Julian Calaby
  2015-12-22  7:06 ` Souptick Joarder
  0 siblings, 2 replies; 5+ messages in thread
From: Nicholas Mc Guire @ 2015-12-21 16:47 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Eliad Peller, Johannes Berg, Arik Nemtsov, Tony Lindgren,
	Luciano Coelho, Eyal Reizer, Emmanuel Grumbach, linux-wireless,
	netdev, linux-kernel, Nicholas Mc Guire

This is an API consolidation only. The use of kmalloc + memset to 0
is equivalent to kzalloc.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---

Found by coccinelle script (relaxed version of
scripts/coccinelle/api/alloc/kzalloc-simple.cocci)

Patch was compile tested with: x86_64_defconfig +
CONFIG_WL12XX=m (implies CONFIG_WLCORE=m)

Patch is against linux-next (localversion-next is -next-20151221)

 drivers/net/wireless/ti/wlcore/main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index ec7f6af..dfc49bf 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -838,7 +838,7 @@ static void wl12xx_read_fwlog_panic(struct wl1271 *wl)
 
 	wl1271_info("Reading FW panic log");
 
-	block = kmalloc(wl->fw_mem_block_size, GFP_KERNEL);
+	block = kzalloc(wl->fw_mem_block_size, GFP_KERNEL);
 	if (!block)
 		return;
 
@@ -885,7 +885,6 @@ static void wl12xx_read_fwlog_panic(struct wl1271 *wl)
 			goto out;
 		}
 
-		memset(block, 0, wl->fw_mem_block_size);
 		ret = wlcore_read_hwaddr(wl, addr, block,
 					wl->fw_mem_block_size, false);
 
-- 
2.1.4

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

end of thread, other threads:[~2015-12-22  7:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-21 16:47 [PATCH] wlcore: consolidate kmalloc + memset 0 into kzalloc Nicholas Mc Guire
2015-12-21 22:56 ` Julian Calaby
2015-12-22  7:29   ` Nicholas Mc Guire
2015-12-22  7:52     ` Julian Calaby
2015-12-22  7:06 ` Souptick Joarder

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).