Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3330926imu; Sun, 11 Nov 2018 12:32:01 -0800 (PST) X-Google-Smtp-Source: AJdET5djtpPPlRb6VUXl1wFf1f+hRIYC+73mfALWgwZUxRoh8T/teElfkzkaERDkh9IfZPnhwGJl X-Received: by 2002:a63:6ecf:: with SMTP id j198mr4225959pgc.3.1541968321608; Sun, 11 Nov 2018 12:32:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541968321; cv=none; d=google.com; s=arc-20160816; b=0+q4Kq387wmTDA5QL9MrTd2HVwJKEjhKFeDWzHcygqbiB7mBgNdR2hwgtyqiccHTaV FT847wJPgnBq9+qNnlZMxus4ijquoEPXnhs4ulNawVfljRF9REX/Ws40LIEV2pnDB2Zh 2N1KHEnoPbSI3OCv4fBCmHafU4SLvNKizrI6F3tZ7LiWaClkRv/Ciqs+0hxHnrqTqEM2 rgAs9Qgp2lkiae72AevUWl8acgIURJb4S7/1TPkRGwdV0y0TmOfZ77xrguT837yxDB33 RQJrAZVCEs1M00YbSc5HxxVydnJ4l1FpCHuOI2eD1+eYDGhmZjTSDnxDVAjRu/NV8XYD UzWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=JknTDNAQxMj+NU90Oxvrm4cE/0VW8cE62A/nOqErzIM=; b=0cC6makeSiy8jMv7K2/GyFnB7h3uva3xojKHBwC84cfONQoby+yqoDoCEfHocQXPLq 2uoTtm5pKY8tuzj1zA7x5bV/y2JiCiqvxaSD1MlOTqFoSzXHSU/LoaDaIC9szmknhwoo Qo91Tcc+s4SiCx0IPkV5pkSZgLx6qeUWfQ1Cctfnc/gCXuNpcNnNltnFkp+qY/xO6nj2 H31TuUGPQkakDyspwWQS/bXXblxKY7og3+BImMKk65QOoYzeoHu6vFOeXiNB7wcesUO3 hKzhVu27sGzgofMKQZ69OK/iMtwEb7DQvXFZMda43SAg5+I1dBeVP+sL/rpfmkFda3yb fPBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si14897168pgr.411.2018.11.11.12.31.46; Sun, 11 Nov 2018 12:32:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730380AbeKLGUy (ORCPT + 99 others); Mon, 12 Nov 2018 01:20:54 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:50312 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730285AbeKLFsS (ORCPT ); Mon, 12 Nov 2018 00:48:18 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvse-0000oN-Sw; Sun, 11 Nov 2018 19:58:49 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsa-0001tL-SR; Sun, 11 Nov 2018 19:58:44 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Jiri Olsa" , "William Cohen" , "David Ahern" , "Arnaldo Carvalho de Melo" , "Namhyung Kim" , "Wang Nan" , "Adrian Hunter" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 358/366] tools include: Add a __fallthrough statement In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Arnaldo Carvalho de Melo commit b5bf1733d6a391c4e90ea8f8468d83023be74a2a upstream. For cases where implicit fall through case labels are intended, to let us inform that to gcc >= 7: CC /tmp/build/perf/util/string.o util/string.c: In function 'perf_atoll': util/string.c:22:7: error: this statement may fall through [-Werror=implicit-fallthrough=] if (*p) ^ util/string.c:24:3: note: here case '\0': ^~~~ So we introduce: #define __fallthrough __attribute__ ((fallthrough)) And use it in such cases. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Cc: William Cohen Link: http://lkml.kernel.org/n/tip-qnpig0xfop4hwv6k4mv1wts5@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Ben Hutchings --- tools/include/linux/compiler.h | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/tools/include/linux/compiler.h +++ b/tools/include/linux/compiler.h @@ -37,4 +37,13 @@ #define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) + +#ifndef __fallthrough +# if defined(__GNUC__) && __GNUC__ >= 7 +# define __fallthrough __attribute__ ((fallthrough)) +# else +# define __fallthrough +# endif +#endif + #endif /* _TOOLS_LINUX_COMPILER_H */