From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7CC2C19759 for ; Thu, 1 Aug 2019 20:47:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8455A206B8 for ; Thu, 1 Aug 2019 20:47:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387420AbfHAUrz (ORCPT ); Thu, 1 Aug 2019 16:47:55 -0400 Received: from smtprelay0005.hostedemail.com ([216.40.44.5]:49324 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725846AbfHAUrz (ORCPT ); Thu, 1 Aug 2019 16:47:55 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 4F2E0180A8152; Thu, 1 Aug 2019 20:47:53 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: hall48_444b58505c34e X-Filterd-Recvd-Size: 3249 Received: from XPS-9350.home (cpe-23-242-196-136.socal.res.rr.com [23.242.196.136]) (Authenticated sender: joe@perches.com) by omf10.hostedemail.com (Postfix) with ESMTPA; Thu, 1 Aug 2019 20:47:49 +0000 (UTC) Message-ID: Subject: Re: [RFC PATCH] compiler_attributes.h: Add 'fallthrough' pseudo keyword for switch/case use From: Joe Perches To: Miguel Ojeda , "H. Peter Anvin" Cc: Peter Zijlstra , Pavel Machek , Linus Torvalds , Kees Cook , Borislav Petkov , Thomas Gleixner , Ingo Molnar , "Gustavo A . R . Silva" , Arnaldo Carvalho de Melo , Kan Liang , Namhyung Kim , Jiri Olsa , Alexander Shishkin , Shawn Landden , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , linux-kernel Date: Thu, 01 Aug 2019 13:47:47 -0700 In-Reply-To: References: <1d2830aadbe9d8151728a7df5b88528fc72a0095.1564549413.git.joe@perches.com> <20190731171429.GA24222@amd> <765E740C-4259-4835-A58D-432006628BAC@zytor.com> <20190731184832.GZ31381@hirez.programming.kicks-ass.net> <20190801122429.GY31398@hirez.programming.kicks-ass.net> <0BCDEED9-0B72-4412-909F-76C20D54983E@zytor.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.5-0ubuntu0.18.10.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-08-01 at 22:26 +0200, Miguel Ojeda wrote: > On Thu, Aug 1, 2019 at 10:10 PM wrote: > > I'm not disagreeing... I think using a macro makes sense. > > It is either a macro or waiting for 5+ years (while we keep using the > comment style) :-) > > In case it helps to make one's mind about whether to go for it or not, > I summarized the advantages and a few other details in the patch I > sent in October: > > https://github.com/ojeda/linux/commit/668f011a2706ea555987e263f609a5deba9c7fc4 > > It would be nice, however, to discuss whether we want __fallthrough or > fallthrough. I was happy enough with either though after a bit of playing around with both, I think the pseudo-keyword reads quite a bit better. linux-kernel is a constrained code base and using underscored prefixes is not really necessary. For instance: _Bool is c99, but the kernel uses bool uint8_t also, but the kernel uses u8, etc... Yes it requires a bit of 'local knowledge', but simpler is better.