]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fixes for 4.4
authorSasha Levin <sashal@kernel.org>
Wed, 11 Sep 2019 09:26:13 +0000 (05:26 -0400)
committerSasha Levin <sashal@kernel.org>
Wed, 11 Sep 2019 09:26:13 +0000 (05:26 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.4/clk-s2mps11-add-used-attribute-to-s2mps11_dt_match.patch [new file with mode: 0644]
queue-4.4/scripts-decode_stacktrace-match-basepath-using-shell.patch [new file with mode: 0644]
queue-4.4/series

diff --git a/queue-4.4/clk-s2mps11-add-used-attribute-to-s2mps11_dt_match.patch b/queue-4.4/clk-s2mps11-add-used-attribute-to-s2mps11_dt_match.patch
new file mode 100644 (file)
index 0000000..bc1378e
--- /dev/null
@@ -0,0 +1,62 @@
+From 8c54c1f271b8c88abacc37014ee26521bda85ec9 Mon Sep 17 00:00:00 2001
+From: Nathan Chancellor <natechancellor@gmail.com>
+Date: Thu, 18 Oct 2018 12:13:40 -0700
+Subject: clk: s2mps11: Add used attribute to s2mps11_dt_match
+
+[ Upstream commit 9c940bbe2bb47e03ca5e937d30b6a50bf9c0e671 ]
+
+Clang warns after commit 8985167ecf57 ("clk: s2mps11: Fix matching when
+built as module and DT node contains compatible"):
+
+drivers/clk/clk-s2mps11.c:242:34: warning: variable 's2mps11_dt_match'
+is not needed and will not be emitted [-Wunneeded-internal-declaration]
+static const struct of_device_id s2mps11_dt_match[] = {
+                                 ^
+1 warning generated.
+
+This warning happens when a variable is used in some construct that
+doesn't require a reference to that variable to be emitted in the symbol
+table; in this case, it's MODULE_DEVICE_TABLE, which only needs to hold
+the data of the variable, not the variable itself.
+
+$ nm -S drivers/clk/clk-s2mps11.o | rg s2mps11_dt_match
+00000078 000003d4 R __mod_of__s2mps11_dt_match_device_table
+
+Normally, with device ID table variables, it means that the variable
+just needs to be tied to the device declaration at the bottom of the
+file, like s2mps11_clk_id:
+
+$ nm -S drivers/clk/clk-s2mps11.o | rg s2mps11_clk_id
+00000000 00000078 R __mod_platform__s2mps11_clk_id_device_table
+00000000 00000078 r s2mps11_clk_id
+
+However, because the comment above this deliberately doesn't want this
+variable added to .of_match_table, we need to mark s2mps11_dt_match as
+__used to silence this warning. This makes it clear to Clang that the
+variable is used for something, even if a reference to it isn't being
+emitted.
+
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Fixes: 8985167ecf57 ("clk: s2mps11: Fix matching when built as module and DT node contains compatible")
+Signed-off-by: Stephen Boyd <sboyd@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/clk/clk-s2mps11.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
+index 785864893f9a6..14af5c916c9ca 100644
+--- a/drivers/clk/clk-s2mps11.c
++++ b/drivers/clk/clk-s2mps11.c
+@@ -307,7 +307,7 @@ MODULE_DEVICE_TABLE(platform, s2mps11_clk_id);
+  * This requires of_device_id table.  In the same time this will not change the
+  * actual *device* matching so do not add .of_match_table.
+  */
+-static const struct of_device_id s2mps11_dt_match[] = {
++static const struct of_device_id s2mps11_dt_match[] __used = {
+       {
+               .compatible = "samsung,s2mps11-clk",
+               .data = (void *)S2MPS11X,
+-- 
+2.20.1
+
diff --git a/queue-4.4/scripts-decode_stacktrace-match-basepath-using-shell.patch b/queue-4.4/scripts-decode_stacktrace-match-basepath-using-shell.patch
new file mode 100644 (file)
index 0000000..2912b00
--- /dev/null
@@ -0,0 +1,38 @@
+From 90f53a475ce8442915f76ee5ae44f53389a79ea9 Mon Sep 17 00:00:00 2001
+From: Nicolas Boichat <drinkcat@chromium.org>
+Date: Thu, 11 Jul 2019 20:52:27 -0700
+Subject: scripts/decode_stacktrace: match basepath using shell prefix
+ operator, not regex
+
+[ Upstream commit 31013836a71e07751a6827f9d2ad41ef502ddaff ]
+
+The basepath may contain special characters, which would confuse the regex
+matcher.  ${var#prefix} does the right thing.
+
+Link: http://lkml.kernel.org/r/20190518055946.181563-1-drinkcat@chromium.org
+Fixes: 67a28de47faa8358 ("scripts/decode_stacktrace: only strip base path when a prefix of the path")
+Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
+Reviewed-by: Stephen Boyd <swboyd@chromium.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ scripts/decode_stacktrace.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh
+index ffc46c7c3afbb..4f5e76f76b9dc 100755
+--- a/scripts/decode_stacktrace.sh
++++ b/scripts/decode_stacktrace.sh
+@@ -64,7 +64,7 @@ parse_symbol() {
+       fi
+       # Strip out the base of the path
+-      code=${code//^$basepath/""}
++      code=${code#$basepath/}
+       # In the case of inlines, move everything to same line
+       code=${code//$'\n'/' '}
+-- 
+2.20.1
+
index 227cc80eba364032567f8651a17d0103188c7ac3..6c941bafe40401f14326981df79b9c43fe269b93 100644 (file)
@@ -2,3 +2,5 @@ alsa-hda-fix-potential-endless-loop-at-applying-quirks.patch
 alsa-hda-realtek-fix-overridden-device-specific-initialization.patch
 xfrm-clean-up-xfrm-protocol-checks.patch
 vhost-test-fix-build-for-vhost-test.patch
+scripts-decode_stacktrace-match-basepath-using-shell.patch
+clk-s2mps11-add-used-attribute-to-s2mps11_dt_match.patch