elx: efct: fix zalloc-simple.cocci warnings
Subsystems (2)
PATCH 1/1 elx: efct: fix zalloc-simple.cocci warnings
From: kbuild test robot <[email protected]>
Use zeroing allocator rather than allocator followed by memset with 0
Generated by: scripts/coccinelle/api/alloc/zalloc-simple.cocci
CC James Smart <[email protected]>
Signed-off-by kbuild test robot <[email protected]>
Signed-off-by Julia Lawall <[email protected]>
---
url: https://github.com/0day-ci/linux/commits/James-Smart/efct-Broadcom-Emulex-FC-Target-driver/20200412-114125 base: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
:::::: branch date: 4 hours ago
:::::: commit date: 4 hours ago
efct_xport.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/scsi/elx/efct/efct_xport.c +2 -5
@@ -41,11 +41,10 @@ efct_xport_alloc(struct efct *efct) {struct efct_xport *xport; - xport =kmalloc (sizeof (*xport),GFP_KERNEL ); + xport =kzalloc (sizeof (*xport),GFP_KERNEL );if (!xport)return xport; -memset (xport,0 ,sizeof (*xport)); xport->efct = efct;return xport; }
@@ -685,12 +684,10 @@ efct_xport_control(struct efct_xport *xp context = va_arg(argp, void *);va_end (argp); - payload =kmalloc (sizeof (*payload),GFP_KERNEL ); + payload =kzalloc (sizeof (*payload),GFP_KERNEL );if (!payload)return EFC_FAIL ; -memset (payload,0 ,sizeof (*payload)); - efct = node->efc->base; hw = &efct->hw;