From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751486AbdB1EXK (ORCPT ); Mon, 27 Feb 2017 23:23:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39932 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751285AbdB1EXG (ORCPT ); Mon, 27 Feb 2017 23:23:06 -0500 Date: Mon, 27 Feb 2017 22:21:16 -0600 From: Josh Poimboeuf To: Guenter Roeck Cc: Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org Subject: [PATCH] objtool: enclose contents of unreachable() macro in a block Message-ID: <20170228042116.glmwmwiohcix7o4a@treble> References: <20170227205923.GA6466@roeck-us.net> <20170227222114.p6vdugfmfjfprt47@treble> <20170227232328.GA1604@roeck-us.net> <20170228004311.pioqmzt76cssrjwr@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20170228004311.pioqmzt76cssrjwr@treble> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 28 Feb 2017 04:21:22 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Guenter Roeck reported a boot failure in mips64. It was bisected to the following commit: d1091c7fa3d5 ("objtool: Improve detection of BUG() and other dead ends") The unreachable() macro was formerly only composed of a single statement. The above commit added a second statement, but neglected to enclose the statements in a block. Reported-by: Guenter Roeck Suggested-by: Guenter Roeck Fixes: d1091c7fa3d5 ("objtool: Improve detection of BUG() and other dead ends") Signed-off-by: Josh Poimboeuf --- include/linux/compiler-gcc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index de47134..f457b520 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -215,7 +215,8 @@ * this in the preprocessor, but we can live with this because they're * unreleased. Really, we need to have autoconf for the kernel. */ -#define unreachable() annotate_unreachable(); __builtin_unreachable() +#define unreachable() \ + do { annotate_unreachable(); __builtin_unreachable(); } while (0) /* Mark a function definition as prohibited from being cloned. */ #define __noclone __attribute__((__noclone__, __optimize__("no-tracer"))) -- 2.7.4