From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751752AbdKUIqG (ORCPT ); Tue, 21 Nov 2017 03:46:06 -0500 Received: from terminus.zytor.com ([65.50.211.136]:38991 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751510AbdKUIqF (ORCPT ); Tue, 21 Nov 2017 03:46:05 -0500 Date: Tue, 21 Nov 2017 00:40:24 -0800 From: tip-bot for Dave Hansen Message-ID: Cc: brgerst@gmail.com, jpoimboe@redhat.com, mingo@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, dave.hansen@linux.intel.com, hpa@zytor.com, luto@kernel.org, torvalds@linux-foundation.org, peterz@infradead.org, bp@alien8.de, dvlasenk@redhat.com Reply-To: brgerst@gmail.com, jpoimboe@redhat.com, mingo@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, dave.hansen@linux.intel.com, hpa@zytor.com, luto@kernel.org, torvalds@linux-foundation.org, peterz@infradead.org, bp@alien8.de, dvlasenk@redhat.com In-Reply-To: <20171111001229.58A7933D@viggo.jf.intel.com> References: <20171111001229.58A7933D@viggo.jf.intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/mpx/selftests: Fix up weird arrays Git-Commit-ID: a6400120d042397675fcf694060779d21e9e762d X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: a6400120d042397675fcf694060779d21e9e762d Gitweb: https://git.kernel.org/tip/a6400120d042397675fcf694060779d21e9e762d Author: Dave Hansen AuthorDate: Fri, 10 Nov 2017 16:12:29 -0800 Committer: Ingo Molnar CommitDate: Tue, 21 Nov 2017 09:34:52 +0100 x86/mpx/selftests: Fix up weird arrays The MPX hardware data structurse are defined in a weird way: they define their size in bytes and then union that with the type with which we want to access them. Yes, this is weird, but it does work. But, new GCC's complain that we are accessing the array out of bounds. Just make it a zero-sized array so gcc will stop complaining. There was not really a bug here. Signed-off-by: Dave Hansen Acked-by: Thomas Gleixner Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20171111001229.58A7933D@viggo.jf.intel.com Signed-off-by: Ingo Molnar --- tools/testing/selftests/x86/mpx-hw.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/x86/mpx-hw.h b/tools/testing/selftests/x86/mpx-hw.h index 3f00939..d1b61ab 100644 --- a/tools/testing/selftests/x86/mpx-hw.h +++ b/tools/testing/selftests/x86/mpx-hw.h @@ -52,14 +52,14 @@ struct mpx_bd_entry { union { char x[MPX_BOUNDS_DIR_ENTRY_SIZE_BYTES]; - void *contents[1]; + void *contents[0]; }; } __attribute__((packed)); struct mpx_bt_entry { union { char x[MPX_BOUNDS_TABLE_ENTRY_SIZE_BYTES]; - unsigned long contents[1]; + unsigned long contents[0]; }; } __attribute__((packed));