Content-Type: multipart/mixed; boundary="===============6157518879320379440==" MIME-Version: 1.0 From: Julia Lawall To: kbuild-all@lists.01.org Subject: [PATCH] elx: efct: fix zalloc-simple.cocci warnings Date: Sun, 12 Apr 2020 17:40:22 +0200 Message-ID: List-Id: --===============6157518879320379440== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: kbuild test robot Use zeroing allocator rather than allocator followed by memset with 0 Generated by: scripts/coccinelle/api/alloc/zalloc-simple.cocci CC: James Smart Signed-off-by: kbuild test robot Signed-off-by: Julia Lawall --- 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-ne= xt :::::: branch date: 4 hours ago :::::: commit date: 4 hours ago efct_xport.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) --- a/drivers/scsi/elx/efct/efct_xport.c +++ b/drivers/scsi/elx/efct/efct_xport.c @@ -41,11 +41,10 @@ efct_xport_alloc(struct efct *efct) { struct efct_xport *xport; - xport =3D kmalloc(sizeof(*xport), GFP_KERNEL); + xport =3D kzalloc(sizeof(*xport), GFP_KERNEL); if (!xport) return xport; - memset(xport, 0, sizeof(*xport)); xport->efct =3D efct; return xport; } @@ -685,12 +684,10 @@ efct_xport_control(struct efct_xport *xp context =3D va_arg(argp, void *); va_end(argp); - payload =3D kmalloc(sizeof(*payload), GFP_KERNEL); + payload =3D kzalloc(sizeof(*payload), GFP_KERNEL); if (!payload) return EFC_FAIL; - memset(payload, 0, sizeof(*payload)); - efct =3D node->efc->base; hw =3D &efct->hw; --===============6157518879320379440==--