Staging: Use kcalloc or kzalloc
authorJulia Lawall <julia@diku.dk>
Thu, 13 May 2010 20:00:05 +0000 (22:00 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 14 May 2010 21:02:56 +0000 (14:02 -0700)
commit7a6cb0d5497418599d2125b670926b75e673861c
treea698dc86695304ef6aefe4bc6d18fdad7f3770ee
parentb5a2104c98cb603f7053e4b0309fb88f15d6be86
Staging: Use kcalloc or kzalloc

Use kcalloc or kzalloc rather than the combination of kmalloc and memset.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,y,flags;
statement S;
type T;
@@

x =
-   kmalloc
+   kcalloc
           (
-           y * sizeof(T),
+           y, sizeof(T),
                flags);
 if (x == NULL) S
-memset(x, 0, y * sizeof(T));

@@
expression x,size,flags;
statement S;
@@

-x = kmalloc(size,flags);
+x = kzalloc(size,flags);
 if (x == NULL) S
-memset(x, 0, size);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
49 files changed:
drivers/staging/comedi/drivers/addi-data/addi_amcc_s5933.h
drivers/staging/comedi/drivers/addi-data/amcc_s5933_58.h
drivers/staging/comedi/drivers/icp_multi.h
drivers/staging/dream/pmem.c
drivers/staging/go7007/go7007-fw.c
drivers/staging/go7007/go7007-usb.c
drivers/staging/go7007/go7007-v4l2.c
drivers/staging/go7007/saa7134-go7007.c
drivers/staging/otus/zdusb.c
drivers/staging/panel/panel.c
drivers/staging/pohmelfs/config.c
drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c
drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c
drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_tkip.c
drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_wep.c
drivers/staging/rtl8187se/ieee80211/ieee80211_module.c
drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c
drivers/staging/rtl8192e/ieee80211/ieee80211_crypt.c
drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_ccmp.c
drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_tkip.c
drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_wep.c
drivers/staging/rtl8192e/ieee80211/ieee80211_module.c
drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c
drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c
drivers/staging/rtl8192su/ieee80211/ieee80211_crypt.c
drivers/staging/rtl8192su/ieee80211/ieee80211_crypt_ccmp.c
drivers/staging/rtl8192su/ieee80211/ieee80211_crypt_tkip.c
drivers/staging/rtl8192su/ieee80211/ieee80211_crypt_wep.c
drivers/staging/rtl8192su/ieee80211/ieee80211_module.c
drivers/staging/rtl8192su/ieee80211/ieee80211_softmac.c
drivers/staging/rtl8192su/ieee80211/ieee80211_wx.c
drivers/staging/rtl8192u/ieee80211/api.c
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
drivers/staging/rtl8192u/r8192U_core.c
drivers/staging/sm7xx/smtcfb.c
drivers/staging/vme/bridges/vme_ca91cx42.c
drivers/staging/vme/bridges/vme_tsi148.c
drivers/staging/vt6655/hostap.c
drivers/staging/vt6655/wpactl.c
drivers/staging/vt6656/hostap.c
drivers/staging/vt6656/wpactl.c
drivers/staging/wlan-ng/p80211conv.c
drivers/staging/wlan-ng/prism2fw.c