From f1ba6687d0a2bc7fbdce2595753c463b0e7be88c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 2 Feb 2017 12:57:30 +0100 Subject: [PATCH] more 3.18 warning fixes. --- .../disable-frame-address-warning.patch | 55 +++++++++++++++++++ .../net-caif-fix-misleading-indentation.patch | 45 +++++++++++++++ .../paride-fix-the-verbose-module-param.patch | 42 ++++++++++++++ queue-3.18/series | 3 + 4 files changed, 145 insertions(+) create mode 100644 queue-3.18/disable-frame-address-warning.patch create mode 100644 queue-3.18/net-caif-fix-misleading-indentation.patch create mode 100644 queue-3.18/paride-fix-the-verbose-module-param.patch diff --git a/queue-3.18/disable-frame-address-warning.patch b/queue-3.18/disable-frame-address-warning.patch new file mode 100644 index 00000000000..5d6b43a6bae --- /dev/null +++ b/queue-3.18/disable-frame-address-warning.patch @@ -0,0 +1,55 @@ +From 124a3d88fa20e1869fc229d7d8c740cc81944264 Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Wed, 27 Jul 2016 19:03:04 -0700 +Subject: Disable "frame-address" warning +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Linus Torvalds + +commit 124a3d88fa20e1869fc229d7d8c740cc81944264 upstream. + +Newer versions of gcc warn about the use of __builtin_return_address() +with a non-zero argument when "-Wall" is specified: + + kernel/trace/trace_irqsoff.c: In function ‘stop_critical_timings’: + kernel/trace/trace_irqsoff.c:433:86: warning: calling ‘__builtin_return_address’ with a nonzero argument is unsafe [-Wframe-address] + stop_critical_timing(CALLER_ADDR0, CALLER_ADDR1); + [ .. repeats a few times for other similar cases .. ] + +It is true that a non-zero argument is somewhat dangerous, and we do not +actually have very many uses of that in the kernel - but the ftrace code +does use it, and as Stephen Rostedt says: + + "We are well aware of the danger of using __builtin_return_address() of + > 0. In fact that's part of the reason for having the "thunk" code in + x86 (See arch/x86/entry/thunk_{64,32}.S). [..] it adds extra frames + when tracking irqs off sections, to prevent __builtin_return_address() + from accessing bad areas. In fact the thunk_32.S states: 'Trampoline to + trace irqs off. (otherwise CALLER_ADDR1 might crash)'." + +For now, __builtin_return_address() with a non-zero argument is the best +we can do, and the warning is not helpful and can end up making people +miss other warnings for real problems. + +So disable the frame-address warning on compilers that need it. + +Acked-by: Steven Rostedt +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + Makefile | 1 + + 1 file changed, 1 insertion(+) + +--- a/Makefile ++++ b/Makefile +@@ -610,6 +610,7 @@ all: vmlinux + include $(srctree)/arch/$(SRCARCH)/Makefile + + KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) ++KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,) + KBUILD_CFLAGS += $(call cc-option,-fno-PIE) + KBUILD_AFLAGS += $(call cc-option,-fno-PIE) + diff --git a/queue-3.18/net-caif-fix-misleading-indentation.patch b/queue-3.18/net-caif-fix-misleading-indentation.patch new file mode 100644 index 00000000000..a24ae33b84b --- /dev/null +++ b/queue-3.18/net-caif-fix-misleading-indentation.patch @@ -0,0 +1,45 @@ +From 8e0cc8c326d99e41468c96fea9785ab78883a281 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Mon, 14 Mar 2016 15:18:38 +0100 +Subject: net: caif: fix misleading indentation + +From: Arnd Bergmann + +commit 8e0cc8c326d99e41468c96fea9785ab78883a281 upstream. + +gcc points out code that is not indented the way it is +interpreted: + +net/caif/cfpkt_skbuff.c: In function 'cfpkt_setlen': +net/caif/cfpkt_skbuff.c:289:4: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation] + return cfpkt_getlen(pkt); + ^~~~~~ +net/caif/cfpkt_skbuff.c:286:3: note: ...this 'else' clause, but it is not + else + ^~~~ + +It is clear from the context that not returning here would be +a bug, as we'd end up passing a negative length into a function +that takes a u16 length, so it is not missing curly braces +here, and I'm assuming that the indentation is the only part +that's wrong about it. + +Signed-off-by: Arnd Bergmann +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + net/caif/cfpkt_skbuff.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/caif/cfpkt_skbuff.c ++++ b/net/caif/cfpkt_skbuff.c +@@ -286,7 +286,7 @@ int cfpkt_setlen(struct cfpkt *pkt, u16 + else + skb_trim(skb, len); + +- return cfpkt_getlen(pkt); ++ return cfpkt_getlen(pkt); + } + + /* Need to expand SKB */ diff --git a/queue-3.18/paride-fix-the-verbose-module-param.patch b/queue-3.18/paride-fix-the-verbose-module-param.patch new file mode 100644 index 00000000000..e7b1439bdf5 --- /dev/null +++ b/queue-3.18/paride-fix-the-verbose-module-param.patch @@ -0,0 +1,42 @@ +From 946e87981942552e526aca9cb6204f02a6c847cb Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Wed, 15 Apr 2015 16:16:36 -0700 +Subject: paride: fix the "verbose" module param + +From: Dan Carpenter + +commit 946e87981942552e526aca9cb6204f02a6c847cb upstream. + +The verbose module parameter can be set to 2 for extremely verbose +messages so the type should be int instead of bool. + +Signed-off-by: Dan Carpenter +Cc: Tim Waugh +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/block/paride/pg.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/block/paride/pg.c ++++ b/drivers/block/paride/pg.c +@@ -137,7 +137,7 @@ + + */ + +-static bool verbose = 0; ++static int verbose; + static int major = PG_MAJOR; + static char *name = PG_NAME; + static int disable = 0; +@@ -168,7 +168,7 @@ enum {D_PRT, D_PRO, D_UNI, D_MOD, D_SLV, + + #include + +-module_param(verbose, bool, 0644); ++module_param(verbose, int, 0644); + module_param(major, int, 0); + module_param(name, charp, 0); + module_param_array(drive0, int, NULL, 0); diff --git a/queue-3.18/series b/queue-3.18/series index 077a4d46564..7d5860166b0 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -1,3 +1,6 @@ module-fix-types-of-device-tables-aliases.patch module_device_table-fix-some-callsites.patch atm-iphase-fix-misleading-indention.patch +paride-fix-the-verbose-module-param.patch +net-caif-fix-misleading-indentation.patch +disable-frame-address-warning.patch -- 2.47.3