linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@inria.fr>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Joe Perches <joe@perches.com>,
	James Smart <james.smart@broadcom.com>,
	kernel-janitors@vger.kernel.org,
	Dick Kennedy <dick.kennedy@broadcom.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>,
	Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH 4/6] scsi: lpfc: use kzalloc
Date: Mon, 14 Mar 2022 12:50:48 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2203141247120.2561@hadrien> (raw)
In-Reply-To: <20220314113407.GM3293@kadam>



On Mon, 14 Mar 2022, Dan Carpenter wrote:

> On Sat, Mar 12, 2022 at 01:45:01PM -0800, Joe Perches wrote:
> > On Sat, 2022-03-12 at 11:27 +0100, Julia Lawall wrote:
> > > Use kzalloc instead of kmalloc + memset.
> > []
> > > diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c
> > []
> > > @@ -6272,10 +6272,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
> > >  				 phba->hba_debugfs_root,
> > >  				 phba, &lpfc_debugfs_op_slow_ring_trc);
> > >  		if (!phba->slow_ring_trc) {
> > > -			phba->slow_ring_trc = kmalloc(
> > > -				(sizeof(struct lpfc_debugfs_trc) *
> > > -				lpfc_debugfs_max_slow_ring_trc),
> > > -				GFP_KERNEL);
> > > +			phba->slow_ring_trc = kzalloc((sizeof(struct lpfc_debugfs_trc) * lpfc_debugfs_max_slow_ring_trc),
> > > +						      GFP_KERNEL);
> >
> > kcalloc
> >
>
> Did someone have a Coccinelle script that converted kzalloc() to
> kcalloc()?

Not sure if I have ever done that.  A long time ago, I made one that
starts with kmalloc and picks kzalloc or kcalloc.  Perhaps Kees did such a
thing?

I'll see if it would be useful.

julia

  reply	other threads:[~2022-03-14 11:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-12 10:26 [PATCH 0/6] use kzalloc Julia Lawall
2022-03-12 10:27 ` [PATCH 1/6] cifs: " Julia Lawall
2022-03-15  4:15   ` Steve French
2022-03-12 10:27 ` [PATCH 2/6] net/mlx4_en: " Julia Lawall
2022-03-14 12:37   ` Tariq Toukan
2022-03-12 10:27 ` [PATCH 3/6] ALSA: seq: oss: " Julia Lawall
2022-03-12 21:43   ` Joe Perches
2022-03-13  8:09   ` Takashi Iwai
2022-03-12 10:27 ` [PATCH 4/6] scsi: lpfc: " Julia Lawall
2022-03-12 21:45   ` Joe Perches
2022-03-14 11:34     ` Dan Carpenter
2022-03-14 11:50       ` Julia Lawall [this message]
2022-03-12 10:27 ` [PATCH 5/6] zd1201: " Julia Lawall
2022-03-16 15:29   ` Kalle Valo
2022-03-12 10:27 ` [PATCH 6/6] usb: raw-gadget: " Julia Lawall
2022-03-14 20:30 ` [PATCH 0/6] " patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.22.394.2203141247120.2561@hadrien \
    --to=julia.lawall@inria.fr \
    --cc=dan.carpenter@oracle.com \
    --cc=dick.kennedy@broadcom.com \
    --cc=harshit.m.mogalapalli@oracle.com \
    --cc=james.smart@broadcom.com \
    --cc=jejb@linux.ibm.com \
    --cc=joe@perches.com \
    --cc=keescook@chromium.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).