Return-Path: Received: from mail-lj1-f193.google.com ([209.85.208.193]:41331 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728468AbeJVSKB (ORCPT ); Mon, 22 Oct 2018 14:10:01 -0400 MIME-Version: 1.0 References: <20181021171414.22674-1-miguel.ojeda.sandonis@gmail.com> <20181021171414.22674-3-miguel.ojeda.sandonis@gmail.com> In-Reply-To: From: Miguel Ojeda Date: Mon, 22 Oct 2018 11:51:59 +0200 Message-ID: Subject: Re: [PATCH 2/2] Compiler Attributes: auxdisplay: panel: use __fallthrough To: Joe Perches Cc: Greg KH , linux-kernel , Dan , Andreas Dilger , Masahiro Yamada , Michal Marek , Steven Rostedt , Mauro Carvalho Chehab , Olof Johansson , Konstantin Ryabitsev , David Miller , Andrey Ryabinin , Kees Cook , Thomas Gleixner , Ingo Molnar , Paul Lawrence , Sandipan Das , Andrey Konovalov , David Woodhouse , Will Deacon , Philippe Ombredanne , Paul Burton , David Rientjes , Willy Tarreau , Martin Sebor , Christopher Li , Jonathan Corbet , "Ted Ts'o" , Geert Uytterhoeven , Rasmus Villemoes , Arnd Bergmann , Dominique Martinet , Stefan Agner , Luc Van Oostenryck , Nick Desaulniers , Andrew Morton , Linus Torvalds , Linux Doc Mailing List , Ext4 Developers List , linux-sparse@vger.kernel.org, linux-kbuild@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-ext4-owner@vger.kernel.org List-ID: On Sun, Oct 21, 2018 at 8:11 PM Joe Perches wrote: > > On Sun, 2018-10-21 at 19:14 +0200, Miguel Ojeda wrote: > > Let gcc know these cases are meant to fall through to the next label > > by annotating them with the new __fallthrough statement attribute; > > and remove the comment since it conveys the same information > > (which was also parsed by gcc to suppress the warning). > > Instead of many individual conversion patches, > perhaps a script to do all the conversions at once. Note that this was only an example of the attribute (some people asked for an example when introducing another one, so I preemptively did it for this one). Doing the conversion (and how :-) I left it for afterwards, if people agree with the attribute. > > Maybe: > > pattern='(?:\/\*\s*fall(?:\s*|\s*\-\s*)thr(?:u|ough)\s*\*\/|\/\/\s*fall\s*thr(?:u|ough)\s*$)' > git grep -P -i --name-only "$pattern" -- '*.[ch]' | > xargs perl -p -i -e "s/$pattern/__fallthrough;/gi" By the way, I checked first if coccinelle could match input comments, but it doesn't, according to Julia. I am also thinking whether a compiler plugin could easily do this, but I don't have my hopes high given these are comments... Also, regardless of how it is done, the patches need to be sent individually to maintainers, no? I have a vague memory that big & automated conversions were a bit frozen upon in the kernel. Greg...? Cheers, Miguel