From: Julia Lawall <julia.lawall@lip6.fr>
To: Eva Rachel Retuya <eraretuya@gmail.com>
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 11:56:46 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.10.1609191153570.3203@hadrien> (raw)
In-Reply-To: <1474259034-10535-1-git-send-email-eraretuya@gmail.com>
> @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
next prev parent reply other threads:[~2016-09-19 9:56 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 ` Julia Lawall [this message]
2016-09-19 13:35 ` [Outreachy kernel] " Eva Rachel Retuya
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=alpine.DEB.2.10.1609191153570.3203@hadrien \
--to=julia.lawall@lip6.fr \
--cc=eraretuya@gmail.com \
--cc=gregkh@linuxfoundation.org \
--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.