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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 AAC48C32751 for ; Wed, 31 Jul 2019 22:23:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 83E1A204EC for ; Wed, 31 Jul 2019 22:23:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729162AbfGaWXv (ORCPT ); Wed, 31 Jul 2019 18:23:51 -0400 Received: from smtprelay0206.hostedemail.com ([216.40.44.206]:33503 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726073AbfGaWXu (ORCPT ); Wed, 31 Jul 2019 18:23:50 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay01.hostedemail.com (Postfix) with ESMTP id E4277100E806B; Wed, 31 Jul 2019 22:23:48 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: arm44_786e4d119b04f X-Filterd-Recvd-Size: 3426 Received: from XPS-9350 (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; Wed, 31 Jul 2019 22:23:47 +0000 (UTC) Message-ID: Subject: Re: [PATCH] net: sctp: Rename fallthrough label to unhandled From: Joe Perches To: Neil Horman Cc: Vlad Yasevich , Marcelo Ricardo Leitner , "David S. Miller" , linux-sctp@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 31 Jul 2019 15:23:46 -0700 In-Reply-To: <20190731205804.GE9823@hmswarspite.think-freely.org> References: <20190731111932.GA9823@hmswarspite.think-freely.org> <20190731121646.GD9823@hmswarspite.think-freely.org> <20190731205804.GE9823@hmswarspite.think-freely.org> 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 Wed, 2019-07-31 at 16:58 -0400, Neil Horman wrote: > On Wed, Jul 31, 2019 at 09:35:31AM -0700, Joe Perches wrote: > > On Wed, 2019-07-31 at 08:16 -0400, Neil Horman wrote: > > > On Wed, Jul 31, 2019 at 04:32:43AM -0700, Joe Perches wrote: > > > > On Wed, 2019-07-31 at 07:19 -0400, Neil Horman wrote: > > > > > On Tue, Jul 30, 2019 at 10:04:37PM -0700, Joe Perches wrote: > > > > > > fallthrough may become a pseudo reserved keyword so this only use of > > > > > > fallthrough is better renamed to allow it. > > > > > > > > > > > > Signed-off-by: Joe Perches > > > > > Are you referring to the __attribute__((fallthrough)) statement that gcc > > > > > supports? If so the compiler should by all rights be able to differentiate > > > > > between a null statement attribute and a explicit goto and label without the > > > > > need for renaming here. Or are you referring to something else? > > > > > > > > Hi. > > > > > > > > I sent after this a patch that adds > > > > > > > > # define fallthrough __attribute__((__fallthrough__)) > > > > > > > > https://lore.kernel.org/patchwork/patch/1108577/ > > > > > > > > So this rename is a prerequisite to adding this #define. > > > > > > > why not just define __fallthrough instead, like we do for all the other > > > attributes we alias (i.e. __read_mostly, __protected_by, __unused, __exception, > > > etc) > > > > Because it's not as intelligible when used as a statement. > I think thats somewhat debatable. __fallthrough to me looks like an internal > macro, whereas fallthrough looks like a comment someone forgot to /* */ I'd rather see: switch (foo) { case FOO: bar |= baz; fallthrough; case BAR: bar |= qux; break; default: error(); } than switch (foo) { case FOO: bar |= baz; __fallthrough; case BAR: bar |= qux; break; default: error(); } or esoecially switch (foo) { case FOO: bar |= baz; /* fallthrough */; case BAR: bar |= qux; break; default: error(); } but , bikeshed ahoy!...