From: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
To: Joe Perches <joe@perches.com>
Cc: Giuseppe Scrivano <gscrivan@redhat.com>,
kernelnewbies <kernelnewbies@kernelnewbies.org>,
kernel-janitors <kernel-janitors@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Julia Lawall <julia.lawall@inria.fr>,
Andy Whitcroft <apw@shadowen.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel-mentees@lists.linuxfoundation.org,
cocci <cocci@systeme.lip6.fr>
Subject: Re: [Linux-kernel-mentees] [Cocci] coccinelle: Convert comma to semicolons (was Re: [PATCH] checkpatch: Add test for comma use that should be semicolon)
Date: Fri, 21 Aug 2020 23:35:38 -0400 [thread overview]
Message-ID: <162653.1598067338@turing-police> (raw)
In-Reply-To: <744af177c09f8ce22c99d6e1df458bced558518b.camel@perches.com>
[-- Attachment #1.1: Type: text/plain, Size: 838 bytes --]
On Fri, 21 Aug 2020 18:08:08 -0700, Joe Perches said:
> (forwarding on to kernel-janitors/mentees and kernelnewbies)
>
> Just fyi for anyone that cares:
>
> A janitorial task for someone might be to use Julia's coccinelle
> script below to convert the existing instances of commas that
> separate statements into semicolons.
Note that you need to *really* check for possible changes in semantics.
It's *usually* OK to do that, but sometimes it's not...
for (i=0; i++, last++; !last) {
changing that comma to a ; will break the compile. In other cases, it can
introduce subtle bugs.
> > I do appreciate that coccinelle adds braces for multiple
> > expression comma use after an if.
> >
> > i.e.:
> > if (foo)
> > a = 1, b = 2;
> > becomes
> > if (foo) {
> > a = 1; b = 2;
> > }
Yeah. Like there, if you forget to add the {}.
[-- Attachment #1.2: Type: application/pgp-signature, Size: 832 bytes --]
[-- Attachment #2: Type: text/plain, Size: 201 bytes --]
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
next prev parent reply other threads:[~2020-08-22 4:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200818184107.f8af232fb58b17160c570874@linux-foundation.org>
[not found] ` <3bf27caf462007dfa75647b040ab3191374a59de.camel@perches.com>
[not found] ` <b0fd63e4b379eda69ee85ab098353582b8c054bb.camel@perches.com>
[not found] ` <alpine.DEB.2.22.394.2008201021400.2524@hadrien>
[not found] ` <a5713d8597065ef986f780499428fcc4cd31c003.camel@perches.com>
[not found] ` <alpine.DEB.2.22.394.2008201856110.2524@hadrien>
2020-08-22 1:08 ` [Linux-kernel-mentees] [Cocci] coccinelle: Convert comma to semicolons (was Re: [PATCH] checkpatch: Add test for comma use that should be semicolon) Joe Perches
2020-08-22 3:35 ` Valdis Klētnieks [this message]
2020-08-22 5:30 ` Joe Perches
2020-08-22 7:07 ` Julia Lawall
2020-09-24 20:19 ` Thomas Gleixner
2020-09-24 20:21 ` Julia Lawall
2020-09-24 20:33 ` Joe Perches
2020-09-24 21:53 ` Thomas Gleixner
2020-09-24 22:23 ` Joe Perches
2020-09-25 17:06 ` Julia Lawall
2020-09-25 17:26 ` Joe Perches
2020-09-26 19:11 ` Valdis Klētnieks
2020-09-27 17:08 ` Julia Lawall
2020-09-27 17:45 ` Joe Perches
2020-09-27 19:35 ` 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=162653.1598067338@turing-police \
--to=valdis.kletnieks@vt.edu \
--cc=akpm@linux-foundation.org \
--cc=apw@shadowen.org \
--cc=cocci@systeme.lip6.fr \
--cc=gscrivan@redhat.com \
--cc=joe@perches.com \
--cc=julia.lawall@inria.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=kernelnewbies@kernelnewbies.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).