kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Julia Lawall <julia.lawall@inria.fr>,
	Denis Efremov <efremov@linux.com>,
	Coccinelle <cocci@systeme.lip6.fr>
Cc: Michal Marek <michal.lkml@markovi.net>,
	Gilles Muller <Gilles.Muller@lip6.fr>,
	Nicolas Palix <nicolas.palix@imag.fr>,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: coccinelle: api: add device_attr_show script
Date: Mon, 15 Jun 2020 16:27:50 +0000	[thread overview]
Message-ID: <6ce5346f-127d-e2fd-c703-9adf21060e30@web.de> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2006151742090.23306@hadrien>

>> +virtual report, org, context, patch
>>
>> Is such a SmPL code variant more succinct?
>
> This doens't matter.

Can less duplicate code be a bit nicer?


>>> +ssize_t show(struct device *dev, struct device_attribute *attr, char *buf)
>>> +{
>>> +	<...
>>> +*	return snprintf@p(...);
>>> +	...>
>>> +}
>>
>> I suggest to reconsider the selection of the SmPL nest construct.
>> https://github.com/coccinelle/coccinelle/blob/e06b9156dfa02a28cf3cbf0913a10513f3d163ab/docs/manual/cocci_syntax.tex#L783
>>
>> Can the construct “<+... … ...+>” become relevant here?
>
> <... ...> is fine if the only thing that will be used afterwards is what
> is inside the <... ...>

I propose once more to distinguish better if the shown return statement
may be really treated as optional for such a source code search approach
(or not).

Regards,
Markus

      reply	other threads:[~2020-06-15 16:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15 14:04 [PATCH] coccinelle: api: add device_attr_show script Markus Elfring
2020-06-15 15:43 ` Julia Lawall
2020-06-15 16:27   ` Markus Elfring [this message]

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=6ce5346f-127d-e2fd-c703-9adf21060e30@web.de \
    --to=markus.elfring@web.de \
    --cc=Gilles.Muller@lip6.fr \
    --cc=cocci@systeme.lip6.fr \
    --cc=efremov@linux.com \
    --cc=julia.lawall@inria.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=nicolas.palix@imag.fr \
    /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).