diff options
author | Alexander Beregalov <a.beregalov@gmail.com> | 2011-03-09 00:53:34 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-03-09 23:54:31 (GMT) |
commit | f4a0e6b1354cd0bec6aca405883cc45662511f03 (patch) | |
tree | bfc9d55f878ffa36ccef59fab3126a33cd01c458 /drivers/staging/bcm/Bcmchar.c | |
parent | 00b6fb2e31ac668795857c9609adc11e7964ed5a (diff) | |
download | linux-fsl-qoriq-f4a0e6b1354cd0bec6aca405883cc45662511f03.tar.xz |
staging: bcm: optimize kmalloc to kzalloc
Use kzalloc rather than kmalloc followed by memset with 0.
Found by coccinelle.
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/bcm/Bcmchar.c')
-rw-r--r-- | drivers/staging/bcm/Bcmchar.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/staging/bcm/Bcmchar.c b/drivers/staging/bcm/Bcmchar.c index 3d9055a..867dbf1 100644 --- a/drivers/staging/bcm/Bcmchar.c +++ b/drivers/staging/bcm/Bcmchar.c @@ -19,12 +19,10 @@ static int bcm_char_open(struct inode *inode, struct file * filp) PPER_TARANG_DATA pTarang = NULL; Adapter = GET_BCM_ADAPTER(gblpnetdev); - pTarang = (PPER_TARANG_DATA)kmalloc(sizeof(PER_TARANG_DATA), - GFP_KERNEL); + pTarang = kzalloc(sizeof(PER_TARANG_DATA), GFP_KERNEL); if (!pTarang) return -ENOMEM; - memset(pTarang, 0, sizeof(PER_TARANG_DATA)); pTarang->Adapter = Adapter; pTarang->RxCntrlMsgBitMask = 0xFFFFFFFF & ~(1 << 0xB); |