summaryrefslogtreecommitdiff
path: root/drivers/staging/brcm80211
diff options
context:
space:
mode:
authorThomas Meyer <thomas@m3y3r.de>2011-08-06 13:26:29 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-23 13:13:17 -0700
commit5349d3d880cdfdeda918f6e84e490f2e86f9d810 (patch)
tree9fb612cb070664f42148570742384a56e0bb9bcf /drivers/staging/brcm80211
parent5a84d6ad4c9306afb467a600a4c6d7b50da49440 (diff)
staging: brcm80211: use kzalloc()
Use kzalloc rather than kmalloc followed by memset with 0 This considers some simple cases that are common and easy to validate Note in particular that there are no ...s in the rule, so all of the matched code has to be contiguous The semantic patch that makes this output is available in scripts/coccinelle/api/alloc/kzalloc-simple.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Acked-by: Roland Vossen <rvossen@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/brcm80211')
-rw-r--r--drivers/staging/brcm80211/brcmfmac/dhd_sdio.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 53d4825cc72..7632a0ebd97 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -5644,14 +5644,12 @@ brcmf_sdbrcm_chip_attach(struct brcmf_bus *bus, u32 regs)
BRCMF_TRACE(("%s: Enter\n", __func__));
/* alloc chip_info_t */
- ci = kmalloc(sizeof(struct chip_info), GFP_ATOMIC);
+ ci = kzalloc(sizeof(struct chip_info), GFP_ATOMIC);
if (NULL == ci) {
BRCMF_ERROR(("%s: malloc failed!\n", __func__));
return -ENOMEM;
}
- memset((unsigned char *)ci, 0, sizeof(struct chip_info));
-
/* bus/core/clk setup for register access */
/* Try forcing SDIO core to do ALPAvail request only */
clkset = SBSDIO_FORCE_HW_CLKREQ_OFF | SBSDIO_ALP_AVAIL_REQ;