Content-Type: multipart/mixed; boundary="===============0624004871525292381==" 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:38:12 +0200 Message-ID: List-Id: --===============0624004871525292381== 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 --- There are four patches in all from 0-day, all with the same subject. Maybe you can just squash them. thanks, julia 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_hw_queues.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/drivers/scsi/elx/efct/efct_hw_queues.c +++ b/drivers/scsi/elx/efct/efct_hw_queues.c @@ -170,11 +170,10 @@ efct_hw_new_cq_set(struct hw_eq *eqs[], cqs[i] =3D NULL; for (i =3D 0; i < num_cqs; i++) { - cq =3D kmalloc(sizeof(*cq), GFP_KERNEL); + cq =3D kzalloc(sizeof(*cq), GFP_KERNEL); if (!cq) goto error; - memset(cq, 0, sizeof(*cq)); cqs[i] =3D cq; cq->eq =3D eqs[i]; cq->type =3D SLI_QTYPE_CQ; @@ -373,11 +372,10 @@ efct_hw_new_rq_set(struct hw_cq *cqs[], rqs[i] =3D NULL; for (i =3D 0, q_count =3D 0; i < num_rq_pairs; i++, q_count +=3D 2) { - rq =3D kmalloc(sizeof(*rq), GFP_KERNEL); + rq =3D kzalloc(sizeof(*rq), GFP_KERNEL); if (!rq) goto error; - memset(rq, 0, sizeof(*rq)); rqs[i] =3D rq; rq->instance =3D hw->hw_rq_count++; rq->cq =3D cqs[i]; --===============0624004871525292381==--