From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752917AbcKZWWr (ORCPT ); Sat, 26 Nov 2016 17:22:47 -0500 Received: from mail-qk0-f170.google.com ([209.85.220.170]:33889 "EHLO mail-qk0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751939AbcKZWWi (ORCPT ); Sat, 26 Nov 2016 17:22:38 -0500 From: Peter Foley To: linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org Cc: Peter Foley Subject: [PATCH] Annotate die() with noreturn Date: Sat, 26 Nov 2016 17:22:29 -0500 Message-Id: <20161126222229.673-1-pefoley2@pefoley.com> X-Mailer: git-send-email 2.11.0.rc2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fixes below warning with clang: In file included from ../arch/x86/tools/relocs_64.c:17: ../arch/x86/tools/relocs.c:977:6: warning: variable 'do_reloc' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (!use_real_mode) ^~~~~~~~~~~~~~ ../arch/x86/tools/relocs.c:989:14: note: uninitialized use occurs here walk_relocs(do_reloc); ^~~~~~~~ ../arch/x86/tools/relocs.c:977:2: note: remove the 'if' if its condition is always true if (!use_real_mode) ^~~~~~~~~~~~~~~~~~~ ../arch/x86/tools/relocs.c:974:24: note: initialize the variable 'do_reloc' to silence this warning const char *symname); ^ = NULL Signed-off-by: Peter Foley --- arch/x86/tools/relocs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/tools/relocs.h b/arch/x86/tools/relocs.h index f59590645b68..1d23bf953a4a 100644 --- a/arch/x86/tools/relocs.h +++ b/arch/x86/tools/relocs.h @@ -16,7 +16,7 @@ #include #include -void die(char *fmt, ...); +void die(char *fmt, ...) __attribute__((noreturn)); #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -- 2.11.0.rc2