linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
To: Julia Lawall <julia.lawall-L2FTfq7BK8M@public.gmane.org>
Cc: Grant Likely
	<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Jonathan Cameron <jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>,
	linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/3] spi: Add helper functions for setting up transfers
Date: Thu, 10 Jan 2013 10:55:09 +0100	[thread overview]
Message-ID: <50EE8FFD.2000000@metafoo.de> (raw)
In-Reply-To: <alpine.DEB.2.02.1301100951060.2063-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>

On 01/10/2013 09:53 AM, Julia Lawall wrote:
>> +@r1@
>> +identifier fn;
>> +identifier xfers;
>> +@@
>> +fn(...)
>> +{
>> +	...
>> +(
>> +	struct spi_transfer xfers[...];
>> +|
>> +	struct spi_transfer xfers[];
>> +)
>> +	...
>> +}
> 
> Can it happen that there would be more than one spi_transfer or spi_message
> variable per function?  This semantic patch will only treat the case where
> there is only one, because the ... before an after the variable declaration
> won't match another declaration of the same form.
> 
> julia

I guess it could happen, but I would consider it to be very rare. There are
a few examples of multiple transfers in the kernel. But most of them look like

struct spi_message msg;
struct spi_transfer xfer_foo;
struct spi_transfer xfer_bar;

...
spi_message_add_tail(&xfer_foo, &msg);
spi_message_add_tail(&xfer_bar, &msg);

So the transformation can't be applied here anyway.

Do you have an idea how to change the rule to work with multiple
transfers/messages per function? If it would make the cocci file more
complex I wouldn't bother to take care of it, since it basically has no
practical use.

- Lars

  parent reply	other threads:[~2013-01-10  9:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-09 17:31 [PATCH 1/3] spi: Add helper functions for setting up transfers Lars-Peter Clausen
     [not found] ` <1357752671-30222-1-git-send-email-lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2013-01-09 17:31   ` [PATCH 2/3] iio: Use spi_sync_transfer() Lars-Peter Clausen
2013-01-09 17:31   ` [PATCH 3/3] staging:iio: " Lars-Peter Clausen
2013-01-09 19:20   ` [PATCH 1/3] spi: Add helper functions for setting up transfers Jonathan Cameron
2013-01-09 20:56     ` Lars-Peter Clausen
     [not found]       ` <50EDD96A.5080900-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2013-01-09 21:36         ` Jonathan Cameron
2013-01-10  8:53   ` Julia Lawall
     [not found]     ` <alpine.DEB.2.02.1301100951060.2063-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
2013-01-10  9:55       ` Lars-Peter Clausen [this message]
     [not found]         ` <50EE8FFD.2000000-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2013-01-10 10:28           ` Julia Lawall
2013-01-27  3:33   ` Mark Brown
     [not found]     ` <20130127033358.GA20672-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-02-05 14:07       ` Grant Likely
2013-02-06 19:20         ` Jonathan Cameron
     [not found]           ` <5112ACF5.3020906-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2013-02-09 11:14             ` Jonathan Cameron
2013-02-09 10:59         ` Jonathan Cameron

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=50EE8FFD.2000000@metafoo.de \
    --to=lars-qo5elluwu/uelga04laivw@public.gmane.org \
    --cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org \
    --cc=julia.lawall-L2FTfq7BK8M@public.gmane.org \
    --cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /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).