public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Joe Perches <joe@perches.com>
Cc: trivial@kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] convert comma to semicolon
Date: Thu, 08 Aug 2013 19:45:32 +0000	[thread overview]
Message-ID: <alpine.DEB.2.02.1308082144110.2013@localhost6.localdomain6> (raw)
In-Reply-To: <1375990998.2424.168.camel@joe-AO722>

On Thu, 8 Aug 2013, Joe Perches wrote:

> On Thu, 2013-08-08 at 21:32 +0200, Julia Lawall wrote:
> > These patches result from the following semantic patch
> > (http://coccinelle.lip6.fr/), which checks for expression statements
> > separated by , rather than by ;.  The rule is quite conservative in that it
> > only finds cases where this pattern appears after a statement that ends
> > with ;, to ensure that the expression statements do not form an if branch
> > or loop body.  Iteration is used to treat arbitrary sequences of commas.
> 
> Nice.

Thanks.

> Maybe there also some cases where a block close brace
> is followed by a statement , then statement ;
> 
> Like from fs/reiserfs/fix_node.c
> 
>    231          if ((unsigned int)cur_free >>    232              (vn->vn_size -
>    233               ((vi->vi_type & VI_TYPE_LEFT_MERGEABLE) ? IH_SIZE : 0))) {
>    234                  /* all contents of S[0] fits into L[0] */
>    235  
>    236                  RFALSE(vn->vn_mode = M_INSERT || vn->vn_mode = M_PASTE,
>    237                         "vs-8055: invalid mode or balance condition failed");
>    238  
>    239                  tb->lnum[0] = vn->vn_nr_item;
>    240                  tb->lbytes = -1;
>    241                  return;
>    242          }
>    243  
>    244          d_size = 0, ih_size = IH_SIZE;

I did think of a } as another safe case, but actually, I would not have 
done anything with this one because they are both on the same line.  But I 
was more thinking of i++, j++; which I saw somewhere.  This one is a bit 
more complicated. and would probably be better on separate lines.

Thanks for the feedback.

julia

      reply	other threads:[~2013-08-08 19:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-08 19:32 [PATCH] convert comma to semicolon Julia Lawall
2013-08-08 19:32 ` [PATCH] trivial: " Julia Lawall
2013-08-09  7:39   ` Richard Genoud
2013-08-09 15:16     ` Julia Lawall
2013-08-08 19:43 ` [PATCH] " Joe Perches
2013-08-08 19:45   ` Julia Lawall [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=alpine.DEB.2.02.1308082144110.2013@localhost6.localdomain6 \
    --to=julia.lawall@lip6.fr \
    --cc=joe@perches.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trivial@kernel.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