public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Andy Shevchenko <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
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
Subject: [tip:x86/urgent] x86/platform/intel-mid: Revert "Make 'bt_sfi_data' const"
Date: Mon, 8 Jan 2018 12:34:27 -0800	[thread overview]
Message-ID: <tip-9d0513d82f1a8fe17b41f113ac5922fa57dbaf5c@git.kernel.org> (raw)
In-Reply-To: <20171228122523.21802-1-andriy.shevchenko@linux.intel.com>

Commit-ID:  9d0513d82f1a8fe17b41f113ac5922fa57dbaf5c
Gitweb:     https://git.kernel.org/tip/9d0513d82f1a8fe17b41f113ac5922fa57dbaf5c
Author:     Andy Shevchenko <andriy.shevchenko@linux.intel.com>
AuthorDate: Thu, 28 Dec 2017 14:25:23 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
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 <andriy.shevchenko@linux.intel.com>
Cc: Bhumika Goyal <bhumirks@gmail.com>
Cc: Darren Hart <dvhart@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
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 <mingo@kernel.org>
---
 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,
 };
 

  parent reply	other threads:[~2018-01-08 20:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-28 12:25 [PATCH v2] x86/platform/intel-mid: Revert "Make 'bt_sfi_data' const" Andy Shevchenko
2017-12-28 12:34 ` Ingo Molnar
2018-01-05 17:18   ` Andy Shevchenko
2018-01-05 17:41     ` Julia Lawall
2018-01-08 20:34 ` tip-bot for Andy Shevchenko [this message]
2018-01-09 10:35   ` [tip:x86/urgent] " Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-9d0513d82f1a8fe17b41f113ac5922fa57dbaf5c@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bhumirks@gmail.com \
    --cc=dvhart@infradead.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox