summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2019-01-02 17:37:21 +0000
committerBen Hutchings <ben@decadent.org.uk>2019-01-02 19:10:25 +0000
commitaf5a6744022547d1e435bede3555b4eb72b617c4 (patch)
tree9119a4e5116b94f5369e2af384c2b15434ed1c18
parenta007b2a9e853246576aa3a85a7956885c262cbe3 (diff)
downloadlinux-stable-queue-af5a6744022547d1e435bede3555b4eb72b617c4.tar.gz
Fix some warnings found by the kbuild test robot
-rw-r--r--queue-3.16/ipv6-fix-another-sparse-warning-on-rt6i_node.patch31
-rw-r--r--queue-3.16/s390-dasd-restore-a-necessary-cast.patch24
-rw-r--r--queue-3.16/s390-timex-fix-get_tod_clock_ext-inline-assembly.patch77
-rw-r--r--queue-3.16/series5
-rw-r--r--queue-3.16/x86-eboot.c-include-string-function-declarations.patch35
-rw-r--r--queue-3.16/x86-eisa-add-missing-include.patch27
6 files changed, 199 insertions, 0 deletions
diff --git a/queue-3.16/ipv6-fix-another-sparse-warning-on-rt6i_node.patch b/queue-3.16/ipv6-fix-another-sparse-warning-on-rt6i_node.patch
new file mode 100644
index 00000000..651b0e46
--- /dev/null
+++ b/queue-3.16/ipv6-fix-another-sparse-warning-on-rt6i_node.patch
@@ -0,0 +1,31 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Wed, 02 Jan 2019 18:47:55 +0000
+Subject: ipv6: Fix another sparse warning on rt6i_node
+
+Commit 0933273ce750 "ipv6: fix sparse warning on rt6i_node" fixed some
+sparse warnings in ip6_fib.c, but introduced a new one in
+fib6_update_sernum() (which was removed before the corresponding
+upstream commit).
+
+fib6_update_sernum() is called with the routing table locked, so use
+rcu_dereference_protected() to read rt6_info::rt6i_node.
+
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+---
+--- a/net/ipv6/ip6_fib.c
++++ b/net/ipv6/ip6_fib.c
+@@ -1681,10 +1681,11 @@ static void fib6_prune_clones(struct net
+ static int fib6_update_sernum(struct rt6_info *rt, void *arg)
+ {
+ __u32 sernum = *(__u32 *)arg;
++ struct fib6_node *fn = rcu_dereference_protected(rt->rt6i_node,
++ lockdep_is_held(&rt->rt6i_table->tb6_lock));
+
+- if (rt->rt6i_node &&
+- rt->rt6i_node->fn_sernum != sernum)
+- rt->rt6i_node->fn_sernum = sernum;
++ if (fn && fn->fn_sernum != sernum)
++ fn->fn_sernum = sernum;
+
+ return 0;
+ }
diff --git a/queue-3.16/s390-dasd-restore-a-necessary-cast.patch b/queue-3.16/s390-dasd-restore-a-necessary-cast.patch
new file mode 100644
index 00000000..97725d1a
--- /dev/null
+++ b/queue-3.16/s390-dasd-restore-a-necessary-cast.patch
@@ -0,0 +1,24 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Wed, 02 Jan 2019 17:33:46 +0000
+Subject: s390/dasd: Restore a necessary cast
+
+Commit c3925a3da617 "s390/dasd: fix IO error for newly defined
+devices" removed a cast of dasd_device::private which was not
+necessary in the upstream code. However, in 3.16 the type of
+dasd_device::private is char *, so the cast is still needed.
+
+Reported-by: kbuild test robot <lkp@intel.com>
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+---
+--- a/drivers/s390/block/dasd_alias.c
++++ b/drivers/s390/block/dasd_alias.c
+@@ -608,7 +608,8 @@ static int _schedule_lcu_update(struct a
+
+ int dasd_alias_add_device(struct dasd_device *device)
+ {
+- struct dasd_eckd_private *private = device->private;
++ struct dasd_eckd_private *private =
++ (struct dasd_eckd_private *)device->private;
+ __u8 uaddr = private->uid.real_unit_addr;
+ struct alias_lcu *lcu = private->lcu;
+ unsigned long flags;
diff --git a/queue-3.16/s390-timex-fix-get_tod_clock_ext-inline-assembly.patch b/queue-3.16/s390-timex-fix-get_tod_clock_ext-inline-assembly.patch
new file mode 100644
index 00000000..1b9733aa
--- /dev/null
+++ b/queue-3.16/s390-timex-fix-get_tod_clock_ext-inline-assembly.patch
@@ -0,0 +1,77 @@
+From: Chen Gang <gang.chen@sunrus.com.cn>
+Date: Thu, 1 Jan 2015 22:27:32 +0800
+Subject: s390/timex: fix get_tod_clock_ext() inline assembly
+
+commit e38f97813302065fbc9c9eab5c1a94dc021d71e2 upstream.
+
+For C language, it treats array parameter as a pointer, so sizeof for an
+array parameter is equal to sizeof for a pointer, which causes compiler
+warning (with allmodconfig by gcc 5):
+
+ ./arch/s390/include/asm/timex.h: In function 'get_tod_clock_ext':
+ ./arch/s390/include/asm/timex.h:76:32: warning: 'sizeof' on array function parameter 'clk' will return size of 'char *' [-Wsizeof-array-argument]
+ typedef struct { char _[sizeof(clk)]; } addrtype;
+ ^
+Can use macro CLOCK_STORE_SIZE instead of all related hard code numbers,
+which also can avoid this warning. And also add a tab to CLOCK_TICK_RATE
+definition to match coding styles.
+
+[heiko.carstens@de.ibm.com]:
+Chen's patch actually fixes a bug within the get_tod_clock_ext() inline assembly
+where we incorrectly tell the compiler that only 8 bytes of memory get changed
+instead of 16 bytes.
+This would allow gcc to generate incorrect code. Right now this doesn't seem to
+be the case.
+Also slightly changed the patch a bit.
+- renamed CLOCK_STORE_SIZE to STORE_CLOCK_EXT_SIZE
+- changed get_tod_clock_ext() to receive a char pointer parameter
+
+Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
+Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
+Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+---
+ arch/s390/hypfs/hypfs_vm.c | 2 +-
+ arch/s390/include/asm/timex.h | 10 ++++++----
+ 2 files changed, 7 insertions(+), 5 deletions(-)
+
+--- a/arch/s390/hypfs/hypfs_vm.c
++++ b/arch/s390/hypfs/hypfs_vm.c
+@@ -231,7 +231,7 @@ failed:
+ struct dbfs_d2fc_hdr {
+ u64 len; /* Length of d2fc buffer without header */
+ u16 version; /* Version of header */
+- char tod_ext[16]; /* TOD clock for d2fc */
++ char tod_ext[STORE_CLOCK_EXT_SIZE]; /* TOD clock for d2fc */
+ u64 count; /* Number of VM guests in d2fc buffer */
+ char reserved[30];
+ } __attribute__ ((packed));
+--- a/arch/s390/include/asm/timex.h
++++ b/arch/s390/include/asm/timex.h
+@@ -67,20 +67,22 @@ static inline void local_tick_enable(uns
+ set_clock_comparator(S390_lowcore.clock_comparator);
+ }
+
+-#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
++#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
++#define STORE_CLOCK_EXT_SIZE 16 /* stcke writes 16 bytes */
+
+ typedef unsigned long long cycles_t;
+
+-static inline void get_tod_clock_ext(char clk[16])
++static inline void get_tod_clock_ext(char *clk)
+ {
+- typedef struct { char _[sizeof(clk)]; } addrtype;
++ typedef struct { char _[STORE_CLOCK_EXT_SIZE]; } addrtype;
+
+ asm volatile("stcke %0" : "=Q" (*(addrtype *) clk) : : "cc");
+ }
+
+ static inline unsigned long long get_tod_clock(void)
+ {
+- unsigned char clk[16];
++ unsigned char clk[STORE_CLOCK_EXT_SIZE];
++
+ get_tod_clock_ext(clk);
+ return *((unsigned long long *)&clk[1]);
+ }
diff --git a/queue-3.16/series b/queue-3.16/series
index e1b4f8bf..733c1215 100644
--- a/queue-3.16/series
+++ b/queue-3.16/series
@@ -3,3 +3,8 @@ x86-asm-move-pud_page-macros-to-page_types.h.patch
x86-asm-fix-pud-pmd-interfaces-to-handle-large-pat-bit.patch
x86-mm-simplify-pd_page-macros.patch
x86-mm-fix-regression-with-huge-pages-on-pae.patch
+x86-eisa-add-missing-include.patch
+x86-eboot.c-include-string-function-declarations.patch
+s390-timex-fix-get_tod_clock_ext-inline-assembly.patch
+s390-dasd-restore-a-necessary-cast.patch
+ipv6-fix-another-sparse-warning-on-rt6i_node.patch
diff --git a/queue-3.16/x86-eboot.c-include-string-function-declarations.patch b/queue-3.16/x86-eboot.c-include-string-function-declarations.patch
new file mode 100644
index 00000000..db62ffbd
--- /dev/null
+++ b/queue-3.16/x86-eboot.c-include-string-function-declarations.patch
@@ -0,0 +1,35 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Wed, 02 Jan 2019 17:18:43 +0000
+Subject: x86/boot: eboot.c: Include string function declarations
+
+The earliest boot code has its own string functions, since it can't
+use those included in the main kernel image. Under some compiler
+versions eboot.c fails to include a suitable declaration, resulting in
+the warning:
+
+ In file included from arch/x86/boot/compressed/eboot.c:287:0:
+ arch/x86/boot/compressed/../../../../drivers/firmware/efi/efi-stub-helper.c: In function 'efi_relocate_kernel':
+>> arch/x86/boot/compressed/../../../../drivers/firmware/efi/efi-stub-helper.c:566:2: warning: implicit declaration of function 'memcpy'; did you mean 'memchr'? [-Wimplicit-function-declaration]
+ memcpy((void *)new_addr, (void *)cur_image_addr, image_size);
+ ^~~~~~
+ memchr
+
+Include "../string.h" which provides the correct declarations. This
+was done upstream as part of commit 393f203f5fd5 "x86_64: kasan: add
+interceptors for memset/memmove/memcpy functions".
+
+Reported-by: kbuild test robot <lkp@intel.com>
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+---
+--- a/arch/x86/boot/compressed/eboot.c
++++ b/arch/x86/boot/compressed/eboot.c
+@@ -13,8 +13,7 @@
+ #include <asm/setup.h>
+ #include <asm/desc.h>
+
+-#undef memcpy /* Use memcpy from misc.c */
+-
++#include "../string.h"
+ #include "eboot.h"
+
+ static efi_system_table_t *sys_table;
diff --git a/queue-3.16/x86-eisa-add-missing-include.patch b/queue-3.16/x86-eisa-add-missing-include.patch
new file mode 100644
index 00000000..df3976b8
--- /dev/null
+++ b/queue-3.16/x86-eisa-add-missing-include.patch
@@ -0,0 +1,27 @@
+From: Thomas Gleixner <tglx@linutronix.de>
+Date: Thu, 31 Aug 2017 20:08:16 +0200
+Subject: x86/eisa: Add missing include
+
+commit ef1d4deab953ecb1dfcf9f167043bda8b3f14a11 upstream.
+
+The seperation of the EISA init missed to include linux/io.h which breaks
+the build with some special configurations.
+
+Reported-by: Ingo Molnar <mingo@kernel.org>
+Fixes: f7eaf6e00fd5 ("x86/boot: Move EISA setup to a separate file")
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+---
+ arch/x86/kernel/eisa.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/x86/kernel/eisa.c
++++ b/arch/x86/kernel/eisa.c
+@@ -5,6 +5,7 @@
+ */
+ #include <linux/ioport.h>
+ #include <linux/eisa.h>
++#include <linux/io.h>
+
+ #include <xen/xen.h>
+