From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Perches Date: Sat, 22 Aug 2020 05:30:21 +0000 Subject: Re: [Cocci] coccinelle: Convert comma to semicolons (was Re: [PATCH] checkpatch: Add test for comma Message-Id: <3836b482434bd0b9a609959d3696cc6113a93f2f.camel@perches.com> List-Id: References: <20200818184107.f8af232fb58b17160c570874@linux-foundation.org> <3bf27caf462007dfa75647b040ab3191374a59de.camel@perches.com> <744af177c09f8ce22c99d6e1df458bced558518b.camel@perches.com> <162653.1598067338@turing-police> In-Reply-To: <162653.1598067338@turing-police> MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: Valdis =?UTF-8?Q?Kl=C4=93tnieks?= Cc: Giuseppe Scrivano , kernelnewbies , kernel-janitors , LKML , Andy Whitcroft , Andrew Morton , linux-kernel-mentees@lists.linuxfoundation.org, cocci On Fri, 2020-08-21 at 23:35 -0400, Valdis Kl=C4=93tnieks wrote: > On Fri, 21 Aug 2020 18:08:08 -0700, Joe Perches said: > > (forwarding on to kernel-janitors/mentees and kernelnewbies) > >=20 > > Just fyi for anyone that cares: > >=20 > > 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. >=20 > Note that you need to *really* check for possible changes in semantics. > It's *usually* OK to do that, but sometimes it's not... >=20 > for (i=3D0; i++, last++; !last) { >=20 > changing that comma to a ; will break the compile. In other cases, it can > introduce subtle bugs. True enough for a general statement, though the coccinelle script Julia provided does not change a single instance of for loop expressions with commas. As far as I can tell, no logic defect is introduced by the script at all.