Re: [STAGING] slicoss - use kzalloc

From: Jiri Slaby
Date: Tue Nov 04 2008 - 17:01:53 EST


On 11/04/2008 05:27 PM, Lior Dotan wrote:
> This patch uses kzalloc() where applicable.
>
> Signed-off-by: Lior Dotan <liodot@xxxxxxxxx>

/drivers/staging/slicoss/slicoss.c
=======================================
--- b/drivers/staging/slicoss/slicoss.c 2008-11-04 11:53:12.878116772 +0200
+++ a/drivers/staging/slicoss/slicoss.c 2008-11-04 12:08:40.800644774 +0200
@@ -2673,8 +2673,8 @@
staticÂintÂslic_card_init(structÂsliccar
#ifÂSLIC_DUMP_ENABLED
 ifÂ(!card->dumpbuffer)Â{
-Â Â card->dumpbufferÂ=Âkmalloc(DUMP_PAGE_SIZE,ÂGFP_ATOMIC);
+Â Â card->dumpbufferÂ=Âkzalloc(DUMP_PAGE_SIZE,ÂGFP_ATOMIC);
  ASSERT(card->dumpbuffer);
  ifÂ(card->dumpbufferÂ==ÂNULL)
@@ -2683,8 +2683,7 @@
staticÂintÂslic_card_init(structÂsliccar
 Â*ÂÂSmearÂtheÂsharedÂmemoryÂstructureÂandÂthenÂobtain
 Â*ÂÂtheÂPHYSICALÂaddressÂofÂthisÂstructure
 Â*/
-Â memset(card->dumpbuffer,Â0,ÂDUMP_PAGE_SIZE);


It's wrong, the function in called multiple times, the memset was called every
time, now it would be called only for the first time.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/