All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eva Rachel Retuya <eraretuya@gmail.com>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: gregkh@linuxfoundation.org, outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH] staging: most: hdm-usb: convert pr_warn() to dev_warn()
Date: Mon, 19 Sep 2016 21:35:17 +0800	[thread overview]
Message-ID: <20160919133516.GA4397@Socrates-DK> (raw)
In-Reply-To: <alpine.DEB.2.10.1609191153570.3203@hadrien>

On Mon, Sep 19, 2016 at 11:56:46AM +0200, Julia Lawall wrote:
> > @a@
> > identifier f, dev;
> > expression fmt, E;
> > @@
> >
> > f(...) {
> > 	...
> > 	struct device *dev = E;
> > 	<+... when != dev == NULL
> > - pr_warn(
> > + dev_warn(dev,
> > 		fmt, ...);
> > 	...+>
> > }
> 
> This is a good idea, but it is unnecessarily inefficient in the details.
> You don't use the function name f, so there is no need to match the entire
> function.  Matching the entire function causes Coccinelle to go through
> all of its possible control-flow paths (loops, conditional branches,
> etc.), which can be expensive.  You can instead just start at struct
> device *dev = E;.  Also, you don't do anything with fmt, so you can drop
> that, and just put ... for the remaining arguments.
> 
> julia

I appreciate the input. I'm going to amend my script according to what
you stated here. Do I have to send v2 for this patch?

Eva


  reply	other threads:[~2016-09-19 13:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-19  4:23 [PATCH] staging: most: hdm-usb: convert pr_warn() to dev_warn() Eva Rachel Retuya
2016-09-19  9:56 ` [Outreachy kernel] " Julia Lawall
2016-09-19 13:35   ` Eva Rachel Retuya [this message]
2016-09-19 13:37     ` Julia Lawall

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=20160919133516.GA4397@Socrates-DK \
    --to=eraretuya@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=julia.lawall@lip6.fr \
    --cc=outreachy-kernel@googlegroups.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.