From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751463AbdBJDCN (ORCPT ); Thu, 9 Feb 2017 22:02:13 -0500 Received: from smtprelay0151.hostedemail.com ([216.40.44.151]:42776 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751025AbdBJDCM (ORCPT ); Thu, 9 Feb 2017 22:02:12 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1431:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2691:2828:3138:3139:3140:3141:3142:3352:3622:3867:3874:4321:5007:6119:7576:7903:10004:10400:10848:11026:11232:11473:11658:11914:12043:12296:12438:12740:12760:12895:13069:13311:13357:13439:14181:14659:14721:21080:21434:21451:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: coal62_69e5c1bb91e4d X-Filterd-Recvd-Size: 1938 Message-ID: <1486695726.2192.1.camel@perches.com> Subject: Re: [PATCH 24/32] tools include: Add a __fallthrough statement From: Joe Perches To: Arnaldo Carvalho de Melo , Ingo Molnar Cc: linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Adrian Hunter , David Ahern , Jiri Olsa , Namhyung Kim , Wang Nan , William Cohen Date: Thu, 09 Feb 2017 19:02:06 -0800 In-Reply-To: <20170210013940.9998-25-acme@kernel.org> References: <20170210013940.9998-1-acme@kernel.org> <20170210013940.9998-25-acme@kernel.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.3-0ubuntu0.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2017-02-09 at 22:39 -0300, Arnaldo Carvalho de Melo wrote: > From: Arnaldo Carvalho de Melo > > For cases where implicit fall through case labels are intended, > to let us inform that to gcc >= 7: I believe this should be added to compiler_gcc.h > diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h [] > @@ -126,4 +126,13 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s > #define WRITE_ONCE(x, val) \ > ({ union { typeof(x) __val; char __c[1]; } __u = { .__val = (val) }; __write_once_size(&(x), __u.__c, sizeof(x)); __u.__val; }) > > + > +#ifndef __fallthrough > +# if defined(__GNUC__) && __GNUC__ >= 7 > +# define __fallthrough __attribute__ ((fallthrough)) > +# else > +# define __fallthrough > +# endif > +#endif > + > #endif /* _TOOLS_LINUX_COMPILER_H */