]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
more 3.18 warning fixes.
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Feb 2017 11:57:30 +0000 (12:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Feb 2017 11:57:30 +0000 (12:57 +0100)
queue-3.18/disable-frame-address-warning.patch [new file with mode: 0644]
queue-3.18/net-caif-fix-misleading-indentation.patch [new file with mode: 0644]
queue-3.18/paride-fix-the-verbose-module-param.patch [new file with mode: 0644]
queue-3.18/series

diff --git a/queue-3.18/disable-frame-address-warning.patch b/queue-3.18/disable-frame-address-warning.patch
new file mode 100644 (file)
index 0000000..5d6b43a
--- /dev/null
@@ -0,0 +1,55 @@
+From 124a3d88fa20e1869fc229d7d8c740cc81944264 Mon Sep 17 00:00:00 2001
+From: Linus Torvalds <torvalds@linux-foundation.org>
+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 <torvalds@linux-foundation.org>
+
+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 <rostedt@goodmis.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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 (file)
index 0000000..a24ae33
--- /dev/null
@@ -0,0 +1,45 @@
+From 8e0cc8c326d99e41468c96fea9785ab78883a281 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Mon, 14 Mar 2016 15:18:38 +0100
+Subject: net: caif: fix misleading indentation
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+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 <arnd@arndb.de>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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 (file)
index 0000000..e7b1439
--- /dev/null
@@ -0,0 +1,42 @@
+From 946e87981942552e526aca9cb6204f02a6c847cb Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Wed, 15 Apr 2015 16:16:36 -0700
+Subject: paride: fix the "verbose" module param
+
+From: Dan Carpenter <dan.carpenter@oracle.com>
+
+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 <dan.carpenter@oracle.com>
+Cc: Tim Waugh <tim@cyberelk.net>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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 <asm/uaccess.h>
+-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);
index 077a4d465646d4264fbe2a404d83cfe1ba9d1fe2..7d5860166b042f60698353a67172d96cceada1b1 100644 (file)
@@ -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