From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756192AbeAHUi4 (ORCPT + 1 other); Mon, 8 Jan 2018 15:38:56 -0500 Received: from terminus.zytor.com ([65.50.211.136]:55085 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755920AbeAHUiz (ORCPT ); Mon, 8 Jan 2018 15:38:55 -0500 Date: Mon, 8 Jan 2018 12:34:27 -0800 From: tip-bot for Andy Shevchenko Message-ID: Cc: torvalds@linux-foundation.org, dvhart@infradead.org, bhumirks@gmail.com, peterz@infradead.org, tglx@linutronix.de, hpa@zytor.com, andriy.shevchenko@linux.intel.com, mingo@kernel.org, linux-kernel@vger.kernel.org Reply-To: torvalds@linux-foundation.org, dvhart@infradead.org, bhumirks@gmail.com, peterz@infradead.org, tglx@linutronix.de, hpa@zytor.com, andriy.shevchenko@linux.intel.com, mingo@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20171228122523.21802-1-andriy.shevchenko@linux.intel.com> References: <20171228122523.21802-1-andriy.shevchenko@linux.intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/platform/intel-mid: Revert "Make 'bt_sfi_data' const" Git-Commit-ID: 9d0513d82f1a8fe17b41f113ac5922fa57dbaf5c 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 Return-Path: Commit-ID: 9d0513d82f1a8fe17b41f113ac5922fa57dbaf5c Gitweb: https://git.kernel.org/tip/9d0513d82f1a8fe17b41f113ac5922fa57dbaf5c Author: Andy Shevchenko AuthorDate: Thu, 28 Dec 2017 14:25:23 +0200 Committer: Ingo Molnar CommitDate: Mon, 8 Jan 2018 20:01:44 +0100 x86/platform/intel-mid: Revert "Make 'bt_sfi_data' const" So one of the constification patches unearthed a type casting fragility of the underlying code: 276c87054751 ("x86/platform/intel-mid: Make 'bt_sfi_data' const") converted the struct to be const while it is also used as a temporary container for important data that is used to fill 'parent' and 'name' fields in struct platform_device_info. The compiler doesn't notice this due to an explicit type cast that loses the const - which fragility will be fixed separately. This type cast turned a seemingly trivial const propagation patch into a hard to debug data corruptor and crasher bug. Signed-off-by: Andy Shevchenko Cc: Bhumika Goyal Cc: Darren Hart Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: julia.lawall@lip6.fr Cc: platform-driver-x86@vger.kernel.org Link: http://lkml.kernel.org/r/20171228122523.21802-1-andriy.shevchenko@linux.intel.com Signed-off-by: Ingo Molnar --- arch/x86/platform/intel-mid/device_libs/platform_bt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/platform/intel-mid/device_libs/platform_bt.c b/arch/x86/platform/intel-mid/device_libs/platform_bt.c index dc036e5..5a0483e 100644 --- a/arch/x86/platform/intel-mid/device_libs/platform_bt.c +++ b/arch/x86/platform/intel-mid/device_libs/platform_bt.c @@ -60,7 +60,7 @@ static int __init tng_bt_sfi_setup(struct bt_sfi_data *ddata) return 0; } -static const struct bt_sfi_data tng_bt_sfi_data __initdata = { +static struct bt_sfi_data tng_bt_sfi_data __initdata = { .setup = tng_bt_sfi_setup, };