mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@kernel.org>
To: Julia Lawall <julia.lawall@lip6.fr>,
	Mimi Zohar <zohar@linux.vnet.ibm.com>
Cc: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>,
	ming.lei@canonical.com, torvalds@linux-foundation.org,
	liam.r.girdwood@linux.intel.com, yang.jie@intel.com,
	tiwai@suse.de, dmitry.torokhov@gmail.com,
	joonas.lahtinen@linux.intel.com, teg@jklm.no,
	viro@zeniv.linux.org.uk, gregkh@linuxfoundation.org,
	kay@vrfy.org, dwmw2@infradead.org, linux-kernel@vger.kernel.org,
	yalin.wang2010@gmail.com, Jonathan Corbet <corbet@lwn.net>,
	Gilles Muller <Gilles.Muller@lip6.fr>,
	Nicolas Palix <nicolas.palix@imag.fr>,
	Michal Marek <mmarek@suse.com>,
	linux-doc@vger.kernel.org, cocci@systeme.lip6.fr,
	Alessandro Rubini <rubini@gnudd.com>,
	Kevin Cernekee <cernekee@gmail.com>, Jiri Slaby <jslaby@suse.com>,
	linux-serial@vger.kernel.org,
	Arend Van Spriel <arend@broadcom.com>
Subject: Re: [RFC] firmware: annotate thou shalt not request fw on init or probe
Date: Thu, 16 Jun 2016 22:56:16 +0200	[thread overview]
Message-ID: <20160616205616.GB11948@wotan.suse.de> (raw)
In-Reply-To: <alpine.DEB.2.02.1509030753140.2037@localhost6.localdomain6>

On Thu, Sep 03, 2015 at 07:56:33AM +0200, Julia Lawall wrote:
> 
> 
> On Thu, 3 Sep 2015, Luis R. Rodriguez wrote:
> 
> > On Sat, Aug 29, 2015 at 06:18:20PM +0200, Julia Lawall wrote:
> > > > +@ defines_module_init exists @
> > > > +declarer name module_init;
> > > > +identifier init;
> > > > +@@
> > > > +
> > > > +module_init(init);
> > > > +
> > > > +@ has_probe depends on defines_module_init @
> > > > +identifier drv_calls, drv_probe;
> > > > +type bus_driver;
> > > > +identifier probe_op =~ "(probe)";
> > > > +@@
> > > > +
> > > > +bus_driver drv_calls = {
> > > > +	.probe_op = drv_probe,
> > > > +};
> > > 
> > > I'm not sure that this is enough.  For example, there is the macro
> > > platform_driver_probe that initializes probe fields.  There is likewise
> > > module_platform_driver, which is a top-level declaration that encapsulates
> > > the module_init and the definition of the module_init function, which in
> > > turn calls platform_driver_probe.  There is also module_platform_driver,
> > > which encapsulates the module_init, but not the initialization of the probe
> > > field.  Are you concerned with any of these cases?
> > 
> > Yes, and also it would seem this would only capture simple one level of
> > routine indirection, for instance if probe called bar() and it was within
> > bar() that the driver code called a fw request call, that would not be picked
> > up, correct?
> 
> By default, Coccinelle is not interprocedural.  You can encode that in the 
> script, though.
> 
> Probably the most convenient approach would be to start with the the call, 
> and then work backward to the entry point.  I have code to do this, if and 
> when it turns out to be useful.

FYI folks, thanks to Coccinelle 1.0.5 this is now easily possible with
Python integration, a follow up patch will be submitted that uses this
mechanism to do a proper full search on the kernel.

  Luis

  reply	other threads:[~2016-06-16 20:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-29  1:18 Luis R. Rodriguez
2015-08-29 16:18 ` Julia Lawall
2015-09-03  1:35   ` Luis R. Rodriguez
2015-09-03  5:56     ` Julia Lawall
2016-06-16 20:56       ` Luis R. Rodriguez [this message]
2015-09-01 17:28 ` Josh Boyer
2015-09-03  1:37   ` Luis R. Rodriguez
2015-09-03 11:45 ` [Cocci] " SF Markus Elfring

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=20160616205616.GB11948@wotan.suse.de \
    --to=mcgrof@kernel.org \
    --cc=Gilles.Muller@lip6.fr \
    --cc=arend@broadcom.com \
    --cc=cernekee@gmail.com \
    --cc=cocci@systeme.lip6.fr \
    --cc=corbet@lwn.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=jslaby@suse.com \
    --cc=julia.lawall@lip6.fr \
    --cc=kay@vrfy.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=mcgrof@do-not-panic.com \
    --cc=ming.lei@canonical.com \
    --cc=mmarek@suse.com \
    --cc=nicolas.palix@imag.fr \
    --cc=rubini@gnudd.com \
    --cc=teg@jklm.no \
    --cc=tiwai@suse.de \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yalin.wang2010@gmail.com \
    --cc=yang.jie@intel.com \
    --cc=zohar@linux.vnet.ibm.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

all inboxes | Powered by JetHome®