stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] [3.18-stable] fixes for all remaining known warnings
@ 2017-05-05 11:57 Arnd Bergmann
  2017-05-05 11:57 ` [PATCH 1/9] [3.18-stable] kbuild: mergeconfig: fix "jobserver unavailable" warning Arnd Bergmann
                   ` (9 more replies)
  0 siblings, 10 replies; 20+ messages in thread
From: Arnd Bergmann @ 2017-05-05 11:57 UTC (permalink / raw)
  To: gregkh; +Cc: stable

Hi Greg,

I've gone through the 3.18.51 kernelci.org report one last time to find everything that
still remained. Here are six more backports that I had either missed earlier, or
that needed small fixups, and three new patches I did now to address warnings we could
not fix by backporting existing fixes.

With a little luck, all build bots should finally give a clean build with these applied.

      Arnd

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 1/9] [3.18-stable] kbuild: mergeconfig: fix "jobserver unavailable" warning
  2017-05-05 11:57 [PATCH 0/9] [3.18-stable] fixes for all remaining known warnings Arnd Bergmann
@ 2017-05-05 11:57 ` Arnd Bergmann
  2017-05-05 17:14   ` Greg KH
  2017-05-05 11:57 ` [PATCH 2/9] [3.18-stable] modpost: expand pattern matching to support substring matches Arnd Bergmann
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Arnd Bergmann @ 2017-05-05 11:57 UTC (permalink / raw)
  To: gregkh; +Cc: stable, Masahiro Yamada, Michal Marek, Arnd Bergmann

From: Masahiro Yamada <yamada.masahiro@socionext.com>

Commit f36963c9d3f6f415732710da3acdd8608a9fa0e5 upstream.

If "make kvmconfig" is run with "-j" option, a warning message,
"jobserver unavailable: using -j1.  Add `+' to parent make rule.",
is displayed.

  $ make -s defconfig
  *** Default configuration is based on 'x86_64_defconfig'
  #
  # configuration written to .config
  #
  $ make -j8 kvmconfig
  Using ./.config as base
  Merging ./arch/x86/configs/kvm_guest.config
    [ snip ]
  #
  # merged configuration written to ./.config (needs make)
  #
  make[2]: warning: jobserver unavailable: using -j1.  Add `+' to
  parent make rule.
  scripts/kconfig/conf --oldconfig Kconfig
    [ snip ]
  #
  # configuration written to .config
  #

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 scripts/kconfig/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 9645c0739386..fc34f46cb025 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -110,7 +110,7 @@ define mergeconfig
 $(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target))
 $(if $(call configfiles,$(1)),, $(error No configuration exists for this target on this architecture))
 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(call configfiles,$(1))
-$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
++$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
 endef
 
 PHONY += kvmconfig
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 2/9] [3.18-stable] modpost: expand pattern matching to support substring matches
  2017-05-05 11:57 [PATCH 0/9] [3.18-stable] fixes for all remaining known warnings Arnd Bergmann
  2017-05-05 11:57 ` [PATCH 1/9] [3.18-stable] kbuild: mergeconfig: fix "jobserver unavailable" warning Arnd Bergmann
@ 2017-05-05 11:57 ` Arnd Bergmann
  2017-05-05 11:57 ` [PATCH 3/9] [3.18-stable] modpost: don't emit section mismatch warnings for compiler optimizations Arnd Bergmann
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 20+ messages in thread
From: Arnd Bergmann @ 2017-05-05 11:57 UTC (permalink / raw)
  To: gregkh; +Cc: stable, Paul Gortmaker, Rusty Russell, Arnd Bergmann

From: Paul Gortmaker <paul.gortmaker@windriver.com>

Commit 09c20c032b0f753969ae778d9783d946f054d7fe upstream.

Currently the match() function supports a leading * to match any
prefix and a trailing * to match any suffix.  However there currently
is not a combination of both that can be used to target matches of
whole families of functions that share a common substring.

Here we expand the *foo and foo* match to also support *foo* with
the goal of targeting compiler generated symbol names that contain
strings like ".constprop." and ".isra."

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 scripts/mod/modpost.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index d439856f8176..688b93cc06fe 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -776,6 +776,7 @@ static const char *sech_name(struct elf_info *elf, Elf_Shdr *sechdr)
  * "foo" will match an exact string equal to "foo"
  * "*foo" will match a string that ends with "foo"
  * "foo*" will match a string that begins with "foo"
+ * "*foo*" will match a string that contains "foo"
  */
 static int match(const char *sym, const char * const pat[])
 {
@@ -784,8 +785,17 @@ static int match(const char *sym, const char * const pat[])
 		p = *pat++;
 		const char *endp = p + strlen(p) - 1;
 
+		/* "*foo*" */
+		if (*p == '*' && *endp == '*') {
+			char *here, *bare = strndup(p + 1, strlen(p) - 2);
+
+			here = strstr(sym, bare);
+			free(bare);
+			if (here != NULL)
+				return 1;
+		}
 		/* "*foo" */
-		if (*p == '*') {
+		else if (*p == '*') {
 			if (strrcmp(sym, p + 1) == 0)
 				return 1;
 		}
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 3/9] [3.18-stable] modpost: don't emit section mismatch warnings for compiler optimizations
  2017-05-05 11:57 [PATCH 0/9] [3.18-stable] fixes for all remaining known warnings Arnd Bergmann
  2017-05-05 11:57 ` [PATCH 1/9] [3.18-stable] kbuild: mergeconfig: fix "jobserver unavailable" warning Arnd Bergmann
  2017-05-05 11:57 ` [PATCH 2/9] [3.18-stable] modpost: expand pattern matching to support substring matches Arnd Bergmann
@ 2017-05-05 11:57 ` Arnd Bergmann
  2017-05-05 11:57 ` [PATCH 4/9] [3.18-stable] cpumask_set_cpu_local_first => cpumask_local_spread, lament Arnd Bergmann
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 20+ messages in thread
From: Arnd Bergmann @ 2017-05-05 11:57 UTC (permalink / raw)
  To: gregkh; +Cc: stable, Paul Gortmaker, Rusty Russell, Arnd Bergmann

From: Paul Gortmaker <paul.gortmaker@windriver.com>

Commit 4a3893d069b788f3570c19c12d9e986e8e15870f upstream.

Currently an allyesconfig build [gcc-4.9.1] can generate the following:

   WARNING: vmlinux.o(.text.unlikely+0x3864): Section mismatch in
   reference from the function cpumask_empty.constprop.3() to the
   variable .init.data:nmi_ipi_mask

which comes from the cpumask_empty usage in arch/x86/kernel/nmi_selftest.c.

Normally we would not see a symbol entry for cpumask_empty since it is:

	static inline bool cpumask_empty(const struct cpumask *srcp)

however in this case, the variant of the symbol gets emitted when GCC does
constant propagation optimization.

Fix things up so that any locally optimized constprop variants don't warn
when accessing variables that live in the __init sections.

[arnd: adapted text_sections definition to 3.18]

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 scripts/mod/modpost.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 688b93cc06fe..a8a54640ba5f 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -902,6 +902,10 @@ static const char *const init_sections[] = { ALL_INIT_SECTIONS, NULL };
 static const char *const init_exit_sections[] =
 	{ALL_INIT_SECTIONS, ALL_EXIT_SECTIONS, NULL };
 
+/* all text sections */
+static const char *const text_sections[] = { ALL_INIT_TEXT_SECTIONS,
+				ALL_EXIT_TEXT_SECTIONS, TEXT_SECTIONS, NULL };
+
 /* data section */
 static const char *const data_sections[] = { DATA_SECTIONS, NULL };
 
@@ -920,6 +924,7 @@ static const char *const data_sections[] = { DATA_SECTIONS, NULL };
 static const char *const head_sections[] = { ".head.text*", NULL };
 static const char *const linker_symbols[] =
 	{ "__init_begin", "_sinittext", "_einittext", NULL };
+static const char *const optim_symbols[] = { "*.constprop.*", NULL };
 
 enum mismatch {
 	TEXT_TO_ANY_INIT,
@@ -1077,6 +1082,17 @@ static const struct sectioncheck *section_mismatch(
  *   This pattern is identified by
  *   refsymname = __init_begin, _sinittext, _einittext
  *
+ * Pattern 5:
+ *   GCC may optimize static inlines when fed constant arg(s) resulting
+ *   in functions like cpumask_empty() -- generating an associated symbol
+ *   cpumask_empty.constprop.3 that appears in the audit.  If the const that
+ *   is passed in comes from __init, like say nmi_ipi_mask, we get a
+ *   meaningless section warning.  May need to add isra symbols too...
+ *   This pattern is identified by
+ *   tosec   = init section
+ *   fromsec = text section
+ *   refsymname = *.constprop.*
+ *
  **/
 static int secref_whitelist(const struct sectioncheck *mismatch,
 			    const char *fromsec, const char *fromsym,
@@ -1109,6 +1125,12 @@ static int secref_whitelist(const struct sectioncheck *mismatch,
 	if (match(tosym, linker_symbols))
 		return 0;
 
+	/* Check for pattern 5 */
+	if (match(fromsec, text_sections) &&
+	    match(tosec, init_sections) &&
+	    match(fromsym, optim_symbols))
+		return 0;
+
 	return 1;
 }
 
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 4/9] [3.18-stable] cpumask_set_cpu_local_first => cpumask_local_spread, lament
  2017-05-05 11:57 [PATCH 0/9] [3.18-stable] fixes for all remaining known warnings Arnd Bergmann
                   ` (2 preceding siblings ...)
  2017-05-05 11:57 ` [PATCH 3/9] [3.18-stable] modpost: don't emit section mismatch warnings for compiler optimizations Arnd Bergmann
@ 2017-05-05 11:57 ` Arnd Bergmann
  2017-05-05 11:57 ` [PATCH 5/9] [3.18-stable] e1000e: fix call to do_div() to use u64 arg Arnd Bergmann
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 20+ messages in thread
From: Arnd Bergmann @ 2017-05-05 11:57 UTC (permalink / raw)
  To: gregkh; +Cc: stable, Rusty Russell, Arnd Bergmann

From: Rusty Russell <rusty@rustcorp.com.au>

Commit f36963c9d3f6f415732710da3acdd8608a9fa0e5 upstream.

da91309e0a7e (cpumask: Utility function to set n'th cpu...) created a
genuinely weird function.  I never saw it before, it went through DaveM.
(He only does this to make us other maintainers feel better about our own
mistakes.)

cpumask_set_cpu_local_first's purpose is say "I need to spread things
across N online cpus, choose the ones on this numa node first"; you call
it in a loop.

It can fail.  One of the two callers ignores this, the other aborts and
fails the device open.

It can fail in two ways: allocating the off-stack cpumask, or through a
convoluted codepath which AFAICT can only occur if cpu_online_mask
changes.  Which shouldn't happen, because if cpu_online_mask can change
while you call this, it could return a now-offline cpu anyway.

It contains a nonsensical test "!cpumask_of_node(numa_node)".  This was
drawn to my attention by Geert, who said this causes a warning on Sparc.
It sets a single bit in a cpumask instead of returning a cpu number,
because that's what the callers want.

It could be made more efficient by passing the previous cpu rather than
an index, but that would be more invasive to the callers.

[backporting for 3.18: only two callers exist, otherwise no change.
 The same warning shows up for "!cpumask_of_node()", and I thought
 about just addressing the warning, but using the whole fix seemed
 better in the end as one of the two callers also lacks the error
 handling]

Fixes: da91309e0a7e8966d916a74cce42ed170fde06bf
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (then rebased)
Tested-by: Amir Vadai <amirv@mellanox.com>
Acked-by: Amir Vadai <amirv@mellanox.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 10 ++--
 drivers/net/ethernet/mellanox/mlx4/en_tx.c     |  6 +--
 include/linux/cpumask.h                        |  6 +--
 lib/cpumask.c                                  | 74 +++++++++-----------------
 4 files changed, 34 insertions(+), 62 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 68fef1151dde..f31814293d3c 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -1500,17 +1500,13 @@ static int mlx4_en_init_affinity_hint(struct mlx4_en_priv *priv, int ring_idx)
 {
 	struct mlx4_en_rx_ring *ring = priv->rx_ring[ring_idx];
 	int numa_node = priv->mdev->dev->numa_node;
-	int ret = 0;
 
 	if (!zalloc_cpumask_var(&ring->affinity_mask, GFP_KERNEL))
 		return -ENOMEM;
 
-	ret = cpumask_set_cpu_local_first(ring_idx, numa_node,
-					  ring->affinity_mask);
-	if (ret)
-		free_cpumask_var(ring->affinity_mask);
-
-	return ret;
+	cpumask_set_cpu(cpumask_local_spread(ring_idx, numa_node),
+			ring->affinity_mask);
+	return 0;
 }
 
 static void mlx4_en_free_affinity_hint(struct mlx4_en_priv *priv, int ring_idx)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
index fdc592ac2529..9fc1dd7c5a0a 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
@@ -139,9 +139,9 @@ int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv,
 	ring->queue_index = queue_index;
 
 	if (queue_index < priv->num_tx_rings_p_up)
-		cpumask_set_cpu_local_first(queue_index,
-					    priv->mdev->dev->numa_node,
-					    &ring->affinity_mask);
+		cpumask_set_cpu(cpumask_local_spread(queue_index,
+						     priv->mdev->dev->numa_node),
+				&ring->affinity_mask);
 
 	*pring = ring;
 	return 0;
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 0a9a6da21e74..bb1e42ce626e 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -142,10 +142,8 @@ static inline unsigned int cpumask_any_but(const struct cpumask *mask,
 	return 1;
 }
 
-static inline int cpumask_set_cpu_local_first(int i, int numa_node, cpumask_t *dstp)
+static inline unsigned int cpumask_local_spread(unsigned int i, int node)
 {
-	set_bit(0, cpumask_bits(dstp));
-
 	return 0;
 }
 
@@ -199,7 +197,7 @@ static inline unsigned int cpumask_next_zero(int n, const struct cpumask *srcp)
 
 int cpumask_next_and(int n, const struct cpumask *, const struct cpumask *);
 int cpumask_any_but(const struct cpumask *mask, unsigned int cpu);
-int cpumask_set_cpu_local_first(int i, int numa_node, cpumask_t *dstp);
+unsigned int cpumask_local_spread(unsigned int i, int node);
 
 /**
  * for_each_cpu - iterate over every cpu in a mask
diff --git a/lib/cpumask.c b/lib/cpumask.c
index b6513a9f2892..c0bd0df01e3d 100644
--- a/lib/cpumask.c
+++ b/lib/cpumask.c
@@ -166,64 +166,42 @@ void __init free_bootmem_cpumask_var(cpumask_var_t mask)
 #endif
 
 /**
- * cpumask_set_cpu_local_first - set i'th cpu with local numa cpu's first
- *
+ * cpumask_local_spread - select the i'th cpu with local numa cpu's first
  * @i: index number
- * @numa_node: local numa_node
- * @dstp: cpumask with the relevant cpu bit set according to the policy
+ * @node: local numa_node
  *
- * This function sets the cpumask according to a numa aware policy.
- * cpumask could be used as an affinity hint for the IRQ related to a
- * queue. When the policy is to spread queues across cores - local cores
- * first.
+ * This function selects an online CPU according to a numa aware policy;
+ * local cpus are returned first, followed by non-local ones, then it
+ * wraps around.
  *
- * Returns 0 on success, -ENOMEM for no memory, and -EAGAIN when failed to set
- * the cpu bit and need to re-call the function.
+ * It's not very efficient, but useful for setup.
  */
-int cpumask_set_cpu_local_first(int i, int numa_node, cpumask_t *dstp)
+unsigned int cpumask_local_spread(unsigned int i, int node)
 {
-	cpumask_var_t mask;
 	int cpu;
-	int ret = 0;
-
-	if (!zalloc_cpumask_var(&mask, GFP_KERNEL))
-		return -ENOMEM;
 
+	/* Wrap: we always want a cpu. */
 	i %= num_online_cpus();
 
-	if (numa_node == -1 || !cpumask_of_node(numa_node)) {
-		/* Use all online cpu's for non numa aware system */
-		cpumask_copy(mask, cpu_online_mask);
+	if (node == -1) {
+		for_each_cpu(cpu, cpu_online_mask)
+			if (i-- == 0)
+				return cpu;
 	} else {
-		int n;
-
-		cpumask_and(mask,
-			    cpumask_of_node(numa_node), cpu_online_mask);
-
-		n = cpumask_weight(mask);
-		if (i >= n) {
-			i -= n;
-
-			/* If index > number of local cpu's, mask out local
-			 * cpu's
-			 */
-			cpumask_andnot(mask, cpu_online_mask, mask);
+		/* NUMA first. */
+		for_each_cpu_and(cpu, cpumask_of_node(node), cpu_online_mask)
+			if (i-- == 0)
+				return cpu;
+
+		for_each_cpu(cpu, cpu_online_mask) {
+			/* Skip NUMA nodes, done above. */
+			if (cpumask_test_cpu(cpu, cpumask_of_node(node)))
+				continue;
+
+			if (i-- == 0)
+				return cpu;
 		}
 	}
-
-	for_each_cpu(cpu, mask) {
-		if (--i < 0)
-			goto out;
-	}
-
-	ret = -EAGAIN;
-
-out:
-	free_cpumask_var(mask);
-
-	if (!ret)
-		cpumask_set_cpu(cpu, dstp);
-
-	return ret;
+	BUG();
 }
-EXPORT_SYMBOL(cpumask_set_cpu_local_first);
+EXPORT_SYMBOL(cpumask_local_spread);
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 5/9] [3.18-stable] e1000e: fix call to do_div() to use u64 arg
  2017-05-05 11:57 [PATCH 0/9] [3.18-stable] fixes for all remaining known warnings Arnd Bergmann
                   ` (3 preceding siblings ...)
  2017-05-05 11:57 ` [PATCH 4/9] [3.18-stable] cpumask_set_cpu_local_first => cpumask_local_spread, lament Arnd Bergmann
@ 2017-05-05 11:57 ` Arnd Bergmann
  2017-05-05 11:57 ` [PATCH 6/9] [3.18-stable] scsi: advansys: remove #warning message Arnd Bergmann
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 20+ messages in thread
From: Arnd Bergmann @ 2017-05-05 11:57 UTC (permalink / raw)
  To: gregkh; +Cc: stable, Jeff Kirsher, Yanjiang Jin, Yanir Lubetkin, Arnd Bergmann

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Commit 30544af5483755b11bb5924736e9e0b45ef0644a upstream.

We were using s64 for lat_ns (latency nano-second value) since in
our calculations a negative value could be a resultant.  For negative
values, we then assign lat_ns to be zero, so the value passed to
do_div() was never negative, but do_div() expects the argument type
to be u64, so do a cast to resolve a compile warning seen on
PowerPC.

CC: Yanjiang Jin <yanjiang.jin@windriver.com>
CC: Yanir Lubetkin <yanirx.lubetkin@intel.com>
Reported-by: Yanjiang Jin <yanjiang.jin@windriver.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/ethernet/intel/e1000e/ich8lan.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index 48b74a549155..feb618468d15 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -983,7 +983,7 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)
 		u16 max_snoop, max_nosnoop;
 		u16 max_ltr_enc;	/* max LTR latency encoded */
 		s64 lat_ns;	/* latency (ns) */
-		s64 value;
+		u64 value;
 		u32 rxa;
 
 		if (!hw->adapter->max_frame_size) {
@@ -1010,12 +1010,13 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)
 		 */
 		lat_ns = ((s64)rxa * 1024 -
 			  (2 * (s64)hw->adapter->max_frame_size)) * 8 * 1000;
-		if (lat_ns < 0)
-			lat_ns = 0;
-		else
-			do_div(lat_ns, speed);
+		if (lat_ns < 0) {
+			value = 0;
+		} else {
+			value = lat_ns;
+			do_div(value, speed);
+		}
 
-		value = lat_ns;
 		while (value > PCI_LTR_VALUE_MASK) {
 			scale++;
 			value = DIV_ROUND_UP(value, (1 << 5));
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 6/9] [3.18-stable] scsi: advansys: remove #warning message
  2017-05-05 11:57 [PATCH 0/9] [3.18-stable] fixes for all remaining known warnings Arnd Bergmann
                   ` (4 preceding siblings ...)
  2017-05-05 11:57 ` [PATCH 5/9] [3.18-stable] e1000e: fix call to do_div() to use u64 arg Arnd Bergmann
@ 2017-05-05 11:57 ` Arnd Bergmann
  2017-05-05 17:43   ` Greg KH
  2017-05-05 17:47   ` Patch "scsi: advansys: remove #warning message" has been added to the 3.18-stable tree gregkh
  2017-05-05 11:57 ` [PATCH 7/9] [3.18-stable] i2o: hide unsafe ioctl on 64-bit Arnd Bergmann
                   ` (3 subsequent siblings)
  9 siblings, 2 replies; 20+ messages in thread
From: Arnd Bergmann @ 2017-05-05 11:57 UTC (permalink / raw)
  To: gregkh; +Cc: stable, Arnd Bergmann, Hannes Reinecke

The advansys driver was converted to the proper DMA API in linux-4.2, but
the 3.18-stable kernel still warns about this:

drivers/scsi/advansys.c:71:2: warning: #warning this driver is still not properly converted to the DMA API [-Wcpp]

The warning clearly is not helpful in 3.18 any more, it just clutters up
the build log. This removes the warning instead, and clarifies the
comment above it.

Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/scsi/advansys.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 43761c1c46f0..620b04b7c13d 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -49,7 +49,7 @@
 #include <scsi/scsi.h>
 #include <scsi/scsi_host.h>
 
-/* FIXME:
+/* Fixed in linux-4.2, not backported to 3.18:
  *
  *  1. Although all of the necessary command mapping places have the
  *     appropriate dma_map.. APIs, the driver still processes its internal
@@ -68,7 +68,6 @@
  *  7. advansys_info is not safe against multiple simultaneous callers
  *  8. Add module_param to override ISA/VLB ioport array
  */
-#warning this driver is still not properly converted to the DMA API
 
 /* Enable driver /proc statistics. */
 #define ADVANSYS_STATS
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 7/9] [3.18-stable] i2o: hide unsafe ioctl on 64-bit
  2017-05-05 11:57 [PATCH 0/9] [3.18-stable] fixes for all remaining known warnings Arnd Bergmann
                   ` (5 preceding siblings ...)
  2017-05-05 11:57 ` [PATCH 6/9] [3.18-stable] scsi: advansys: remove #warning message Arnd Bergmann
@ 2017-05-05 11:57 ` Arnd Bergmann
  2017-05-05 17:13   ` Greg KH
  2017-05-05 11:57 ` [PATCH 8/9] [3.18-stable] staging: unisys: correctly handle return value from queue_delayed_work() Arnd Bergmann
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Arnd Bergmann @ 2017-05-05 11:57 UTC (permalink / raw)
  To: gregkh; +Cc: stable, Arnd Bergmann

We get a warning about a broken pointer conversion on 64-bit architectures:

drivers/message/i2o/i2o_config.c: In function 'i2o_cfg_passthru':
drivers/message/i2o/i2o_config.c:893:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
         (p->virt, (void __user *)sg[i].addr_bus,
                   ^
drivers/message/i2o/i2o_config.c:953:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
         ((void __user *)sg[j].addr_bus, sg_list[j].virt,
          ^

This has clearly never worked right, so we can add an #ifdef around the code.
The driver was moved to staging in linux-4.0 and finally removed in 4.2,
so upstream does not have a fix for it.

The driver originally got this mostly right, though probably by accident.

Fixes: f4c2c15b930b ("[PATCH] Convert i2o to compat_ioctl")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/message/i2o/i2o_config.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c
index 04bd3b6de401..67ceb3010a10 100644
--- a/drivers/message/i2o/i2o_config.c
+++ b/drivers/message/i2o/i2o_config.c
@@ -772,7 +772,7 @@ static long i2o_cfg_compat_ioctl(struct file *file, unsigned cmd,
 
 #endif
 
-#ifdef CONFIG_I2O_EXT_ADAPTEC
+#if defined(CONFIG_I2O_EXT_ADAPTEC) && !defined(CONFIG_64BIT)
 static int i2o_cfg_passthru(unsigned long arg)
 {
 	struct i2o_cmd_passthru __user *cmd =
@@ -1045,7 +1045,7 @@ static long i2o_cfg_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
 		ret = i2o_cfg_evt_get(arg, fp);
 		break;
 
-#ifdef CONFIG_I2O_EXT_ADAPTEC
+#if defined(CONFIG_I2O_EXT_ADAPTEC) && !defined(CONFIG_64BIT)
 	case I2OPASSTHRU:
 		ret = i2o_cfg_passthru(arg);
 		break;
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 8/9] [3.18-stable] staging: unisys: correctly handle return value from queue_delayed_work()
  2017-05-05 11:57 [PATCH 0/9] [3.18-stable] fixes for all remaining known warnings Arnd Bergmann
                   ` (6 preceding siblings ...)
  2017-05-05 11:57 ` [PATCH 7/9] [3.18-stable] i2o: hide unsafe ioctl on 64-bit Arnd Bergmann
@ 2017-05-05 11:57 ` Arnd Bergmann
  2017-05-05 17:44   ` Greg KH
  2017-05-05 11:57 ` [PATCH 9/9] [3.18-stable] gfs2: remove IS_ERR_VALUE abuse Arnd Bergmann
  2017-05-05 17:48 ` [PATCH 0/9] [3.18-stable] fixes for all remaining known warnings Greg KH
  9 siblings, 1 reply; 20+ messages in thread
From: Arnd Bergmann @ 2017-05-05 11:57 UTC (permalink / raw)
  To: gregkh; +Cc: stable, Benjamin Romer, Arnd Bergmann

From: Benjamin Romer <benjamin.romer@unisys.com>

Commit f84bd6267d623b49f196d54ba9edc41ff1c4d5e3 upstream

Properly handle the return value from queue_delayed_work() - it's a
bool, not an int, so using a less than comparison isn't appropriate.

This mistake was found by David Binderman <dcb314@hotmail.com>.

[arnd: the fix is from 4.4 but needed some minor fixup to adapt
 to context changes]

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/unisys/visorutil/periodic_work.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorutil/periodic_work.c b/drivers/staging/unisys/visorutil/periodic_work.c
index 3dd1c04d0e14..95802d0e9cc6 100644
--- a/drivers/staging/unisys/visorutil/periodic_work.c
+++ b/drivers/staging/unisys/visorutil/periodic_work.c
@@ -98,8 +98,8 @@ BOOL visor_periodic_work_nextperiod(struct periodic_work *pw)
 		pw->want_to_stop = FALSE;
 		rc = TRUE;  /* yes, TRUE; see visor_periodic_work_stop() */
 		goto unlock;
-	} else if (queue_delayed_work(pw->workqueue, &pw->work,
-				      pw->jiffy_interval) < 0) {
+	} else if (!queue_delayed_work(pw->workqueue, &pw->work,
+				       pw->jiffy_interval)) {
 		ERRDEV(pw->devnam, "queue_delayed_work failed!");
 		pw->is_scheduled = FALSE;
 		rc = FALSE;
@@ -134,8 +134,8 @@ BOOL visor_periodic_work_start(struct periodic_work *pw)
 		goto unlock;
 	}
 	INIT_DELAYED_WORK(&pw->work, &periodic_work_func);
-	if (queue_delayed_work(pw->workqueue, &pw->work,
-			       pw->jiffy_interval) < 0) {
+	if (!queue_delayed_work(pw->workqueue, &pw->work,
+				pw->jiffy_interval)) {
 		ERRDEV(pw->devnam, "%s queue_delayed_work failed!", __func__);
 		rc = FALSE;
 		goto unlock;
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 9/9] [3.18-stable] gfs2: remove IS_ERR_VALUE abuse
  2017-05-05 11:57 [PATCH 0/9] [3.18-stable] fixes for all remaining known warnings Arnd Bergmann
                   ` (7 preceding siblings ...)
  2017-05-05 11:57 ` [PATCH 8/9] [3.18-stable] staging: unisys: correctly handle return value from queue_delayed_work() Arnd Bergmann
@ 2017-05-05 11:57 ` Arnd Bergmann
  2017-05-05 17:47   ` Patch "gfs2: remove IS_ERR_VALUE abuse" has been added to the 3.18-stable tree gregkh
  2017-05-05 17:48 ` [PATCH 0/9] [3.18-stable] fixes for all remaining known warnings Greg KH
  9 siblings, 1 reply; 20+ messages in thread
From: Arnd Bergmann @ 2017-05-05 11:57 UTC (permalink / raw)
  To: gregkh; +Cc: stable, Arnd Bergmann

Picked from commit 287980e49ffc0f6d911601e7e352a812ed27768e ("remove lots
of IS_ERR_VALUE abuses") upstream.

The original fix that was backported to 3.18 already addressed the warning
in some configurations, but not in others, leaving us with the same output:

../fs/gfs2/dir.c: In function 'get_first_leaf':
../fs/gfs2/dir.c:768:9: warning: 'leaf_no' may be used uninitialized in this function [-Wmaybe-uninitialized]
   error = get_leaf(dip, leaf_no, bh_out);
         ^
../fs/gfs2/dir.c: In function 'dir_split_leaf.isra.20':
../fs/gfs2/dir.c:987:8: warning: 'leaf_no' may be used uninitialized in this function [-Wmaybe-uninitialized]

This takes the approach that we took in later versions in mainline,
but does not backport the entire patch, as that would be too large
for stable and IIRC caused regressions in other drivers.

Fixes: 9d46d31e9aea ("gfs2: avoid uninitialized variable warning")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/gfs2/dir.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c
index 9291cf5e7439..f3508f4583d5 100644
--- a/fs/gfs2/dir.c
+++ b/fs/gfs2/dir.c
@@ -749,12 +749,15 @@ static int get_leaf_nr(struct gfs2_inode *dip, u32 index,
 		       u64 *leaf_out)
 {
 	__be64 *hash;
+	int error;
 
 	hash = gfs2_dir_get_hash_table(dip);
-	if (IS_ERR(hash))
-		return PTR_ERR(hash);
-	*leaf_out = be64_to_cpu(*(hash + index));
-	return 0;
+	error = PTR_ERR_OR_ZERO(hash);
+
+	if (!error)
+		*leaf_out = be64_to_cpu(*(hash + index));
+
+	return error;
 }
 
 static int get_first_leaf(struct gfs2_inode *dip, u32 index,
@@ -764,7 +767,7 @@ static int get_first_leaf(struct gfs2_inode *dip, u32 index,
 	int error;
 
 	error = get_leaf_nr(dip, index, &leaf_no);
-	if (!IS_ERR_VALUE(error))
+	if (!error)
 		error = get_leaf(dip, leaf_no, bh_out);
 
 	return error;
@@ -980,7 +983,7 @@ static int dir_split_leaf(struct inode *inode, const struct qstr *name)
 
 	index = name->hash >> (32 - dip->i_depth);
 	error = get_leaf_nr(dip, index, &leaf_no);
-	if (IS_ERR_VALUE(error))
+	if (error)
 		return error;
 
 	/*  Get the old leaf block  */
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH 7/9] [3.18-stable] i2o: hide unsafe ioctl on 64-bit
  2017-05-05 11:57 ` [PATCH 7/9] [3.18-stable] i2o: hide unsafe ioctl on 64-bit Arnd Bergmann
@ 2017-05-05 17:13   ` Greg KH
  2017-05-05 18:36     ` Arnd Bergmann
  0 siblings, 1 reply; 20+ messages in thread
From: Greg KH @ 2017-05-05 17:13 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: stable

On Fri, May 05, 2017 at 01:57:23PM +0200, Arnd Bergmann wrote:
> We get a warning about a broken pointer conversion on 64-bit architectures:
> 
> drivers/message/i2o/i2o_config.c: In function 'i2o_cfg_passthru':
> drivers/message/i2o/i2o_config.c:893:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>          (p->virt, (void __user *)sg[i].addr_bus,
>                    ^
> drivers/message/i2o/i2o_config.c:953:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>          ((void __user *)sg[j].addr_bus, sg_list[j].virt,
>           ^
> 
> This has clearly never worked right, so we can add an #ifdef around the code.
> The driver was moved to staging in linux-4.0 and finally removed in 4.2,
> so upstream does not have a fix for it.
> 
> The driver originally got this mostly right, though probably by accident.

I fixed this in a different way, doing the cast to make things be quiet,
as was done in other places in the driver.  You were copied on that
patch when it was added to my tree, right?

And yes, this thing probably never really worked, so I don't worry about
it :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/9] [3.18-stable] kbuild: mergeconfig: fix "jobserver unavailable" warning
  2017-05-05 11:57 ` [PATCH 1/9] [3.18-stable] kbuild: mergeconfig: fix "jobserver unavailable" warning Arnd Bergmann
@ 2017-05-05 17:14   ` Greg KH
  2017-05-05 17:46     ` Greg KH
  0 siblings, 1 reply; 20+ messages in thread
From: Greg KH @ 2017-05-05 17:14 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: stable, Masahiro Yamada, Michal Marek

On Fri, May 05, 2017 at 01:57:17PM +0200, Arnd Bergmann wrote:
> From: Masahiro Yamada <yamada.masahiro@socionext.com>
> 
> Commit f36963c9d3f6f415732710da3acdd8608a9fa0e5 upstream.

Wrong commit id :(

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 6/9] [3.18-stable] scsi: advansys: remove #warning message
  2017-05-05 11:57 ` [PATCH 6/9] [3.18-stable] scsi: advansys: remove #warning message Arnd Bergmann
@ 2017-05-05 17:43   ` Greg KH
  2017-05-05 17:47   ` Patch "scsi: advansys: remove #warning message" has been added to the 3.18-stable tree gregkh
  1 sibling, 0 replies; 20+ messages in thread
From: Greg KH @ 2017-05-05 17:43 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: stable, Hannes Reinecke

On Fri, May 05, 2017 at 01:57:22PM +0200, Arnd Bergmann wrote:
> The advansys driver was converted to the proper DMA API in linux-4.2, but
> the 3.18-stable kernel still warns about this:
> 
> drivers/scsi/advansys.c:71:2: warning: #warning this driver is still not properly converted to the DMA API [-Wcpp]
> 
> The warning clearly is not helpful in 3.18 any more, it just clutters up
> the build log. This removes the warning instead, and clarifies the
> comment above it.

I already did this one as well, now my local builds are down to 0
warnings :)

But your patch is nicer, I'll use it instead...

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 8/9] [3.18-stable] staging: unisys: correctly handle return value from queue_delayed_work()
  2017-05-05 11:57 ` [PATCH 8/9] [3.18-stable] staging: unisys: correctly handle return value from queue_delayed_work() Arnd Bergmann
@ 2017-05-05 17:44   ` Greg KH
  0 siblings, 0 replies; 20+ messages in thread
From: Greg KH @ 2017-05-05 17:44 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: stable, Benjamin Romer

On Fri, May 05, 2017 at 01:57:24PM +0200, Arnd Bergmann wrote:
> From: Benjamin Romer <benjamin.romer@unisys.com>
> 
> Commit f84bd6267d623b49f196d54ba9edc41ff1c4d5e3 upstream
> 
> Properly handle the return value from queue_delayed_work() - it's a
> bool, not an int, so using a less than comparison isn't appropriate.
> 
> This mistake was found by David Binderman <dcb314@hotmail.com>.
> 
> [arnd: the fix is from 4.4 but needed some minor fixup to adapt
>  to context changes]

Ah, I already did this one, bug missed that there was an upstream
change.  I'll take this as well, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/9] [3.18-stable] kbuild: mergeconfig: fix "jobserver unavailable" warning
  2017-05-05 17:14   ` Greg KH
@ 2017-05-05 17:46     ` Greg KH
  0 siblings, 0 replies; 20+ messages in thread
From: Greg KH @ 2017-05-05 17:46 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: stable, Masahiro Yamada, Michal Marek

On Fri, May 05, 2017 at 10:14:32AM -0700, Greg KH wrote:
> On Fri, May 05, 2017 at 01:57:17PM +0200, Arnd Bergmann wrote:
> > From: Masahiro Yamada <yamada.masahiro@socionext.com>
> > 
> > Commit f36963c9d3f6f415732710da3acdd8608a9fa0e5 upstream.
> 
> Wrong commit id :(

It's de4619937229378e81f95e99c9866acc8e207d34, I'll fix this...

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Patch "gfs2: remove IS_ERR_VALUE abuse" has been added to the 3.18-stable tree
  2017-05-05 11:57 ` [PATCH 9/9] [3.18-stable] gfs2: remove IS_ERR_VALUE abuse Arnd Bergmann
@ 2017-05-05 17:47   ` gregkh
  0 siblings, 0 replies; 20+ messages in thread
From: gregkh @ 2017-05-05 17:47 UTC (permalink / raw)
  To: arnd, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    gfs2: remove IS_ERR_VALUE abuse

to the 3.18-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     gfs2-remove-is_err_value-abuse.patch
and it can be found in the queue-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From arnd@arndb.de  Fri May  5 10:45:31 2017
From: Arnd Bergmann <arnd@arndb.de>
Date: Fri,  5 May 2017 13:57:25 +0200
Subject: gfs2: remove IS_ERR_VALUE abuse
To: gregkh@linuxfoundation.org
Cc: stable@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>
Message-ID: <20170505115725.1424772-10-arnd@arndb.de>

From: Arnd Bergmann <arnd@arndb.de>

Picked from commit 287980e49ffc0f6d911601e7e352a812ed27768e ("remove lots
of IS_ERR_VALUE abuses") upstream.

The original fix that was backported to 3.18 already addressed the warning
in some configurations, but not in others, leaving us with the same output:

../fs/gfs2/dir.c: In function 'get_first_leaf':
../fs/gfs2/dir.c:768:9: warning: 'leaf_no' may be used uninitialized in this function [-Wmaybe-uninitialized]
   error = get_leaf(dip, leaf_no, bh_out);
         ^
../fs/gfs2/dir.c: In function 'dir_split_leaf.isra.20':
../fs/gfs2/dir.c:987:8: warning: 'leaf_no' may be used uninitialized in this function [-Wmaybe-uninitialized]

This takes the approach that we took in later versions in mainline,
but does not backport the entire patch, as that would be too large
for stable and IIRC caused regressions in other drivers.

Fixes: 9d46d31e9aea ("gfs2: avoid uninitialized variable warning")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/gfs2/dir.c |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

--- a/fs/gfs2/dir.c
+++ b/fs/gfs2/dir.c
@@ -749,12 +749,15 @@ static int get_leaf_nr(struct gfs2_inode
 		       u64 *leaf_out)
 {
 	__be64 *hash;
+	int error;
 
 	hash = gfs2_dir_get_hash_table(dip);
-	if (IS_ERR(hash))
-		return PTR_ERR(hash);
-	*leaf_out = be64_to_cpu(*(hash + index));
-	return 0;
+	error = PTR_ERR_OR_ZERO(hash);
+
+	if (!error)
+		*leaf_out = be64_to_cpu(*(hash + index));
+
+	return error;
 }
 
 static int get_first_leaf(struct gfs2_inode *dip, u32 index,
@@ -764,7 +767,7 @@ static int get_first_leaf(struct gfs2_in
 	int error;
 
 	error = get_leaf_nr(dip, index, &leaf_no);
-	if (!IS_ERR_VALUE(error))
+	if (!error)
 		error = get_leaf(dip, leaf_no, bh_out);
 
 	return error;
@@ -980,7 +983,7 @@ static int dir_split_leaf(struct inode *
 
 	index = name->hash >> (32 - dip->i_depth);
 	error = get_leaf_nr(dip, index, &leaf_no);
-	if (IS_ERR_VALUE(error))
+	if (error)
 		return error;
 
 	/*  Get the old leaf block  */


Patches currently in stable-queue which might be from arnd@arndb.de are

queue-3.18/ib-iser-fix-sparse-warnings.patch
queue-3.18/cred-userns-define-current_user_ns-as-a-function.patch
queue-3.18/mips-elf2ecoff-ignore-pt_mips_abiflags-program-headers.patch
queue-3.18/pci-xilinx-fix-harmless-format-string-warning.patch
queue-3.18/arm64-build-vdso-without-libgcov.patch
queue-3.18/arm64-provide-a-namespace-to-ncaps.patch
queue-3.18/alsa-ppc-awacs-shut-up-maybe-uninitialized-warning.patch
queue-3.18/mips-jz4740-fix-build-error-in-irq.h.patch
queue-3.18/modpost-don-t-emit-section-mismatch-warnings-for-compiler-optimizations.patch
queue-3.18/net-tg3-avoid-uninitialized-variable-warning.patch
queue-3.18/tty-isicom-fix-big-endian-compile-warning.patch
queue-3.18/mtd-avoid-stack-overflow-in-mtd-cfi-code.patch
queue-3.18/cpumask_set_cpu_local_first-cpumask_local_spread-lament.patch
queue-3.18/ib-qib-rename-bits_per_page-to-rvt_bits_per_page.patch
queue-3.18/modpost-expand-pattern-matching-to-support-substring-matches.patch
queue-3.18/ips-remove-pointless-warning.patch
queue-3.18/powerpc-ptrace-fix-out-of-bounds-array-access-warning.patch
queue-3.18/scsi-advansys-remove-warning-message.patch
queue-3.18/staging-imx-drm-fix-indentation-warning.patch
queue-3.18/mlx5-avoid-build-warnings-on-32-bit.patch
queue-3.18/mm-cma-silence-warnings-due-to-max-usage.patch
queue-3.18/misdn-avoid-arch-specific-__builtin_return_address-call.patch
queue-3.18/staging-bcm-add-32-bit-host-dependency.patch
queue-3.18/e1000e-fix-call-to-do_div-to-use-u64-arg.patch
queue-3.18/gfs2-remove-is_err_value-abuse.patch
queue-3.18/message-i2o-fix-64bit-build-warnings.patch
queue-3.18/staging-vt6655-fix-overly-large-stack-usage.patch
queue-3.18/drbd-avoid-redefinition-of-bits_per_page.patch
queue-3.18/infiniband-mlx5-avoid-a-compile-time-warning.patch
queue-3.18/kbuild-mergeconfig-fix-jobserver-unavailable-warning.patch
queue-3.18/arm-cns3xxx-shut-up-frame-size-warning.patch
queue-3.18/ib-ehca-fix-maybe-uninitialized-warnings.patch
queue-3.18/mips-elf2ecoff-fix-warning-due-to-dead-code.patch
queue-3.18/staging-unisys-correctly-handle-return-value-from-queue_delayed_work.patch

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Patch "scsi: advansys: remove #warning message" has been added to the 3.18-stable tree
  2017-05-05 11:57 ` [PATCH 6/9] [3.18-stable] scsi: advansys: remove #warning message Arnd Bergmann
  2017-05-05 17:43   ` Greg KH
@ 2017-05-05 17:47   ` gregkh
  1 sibling, 0 replies; 20+ messages in thread
From: gregkh @ 2017-05-05 17:47 UTC (permalink / raw)
  To: arnd, gregkh, hare; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    scsi: advansys: remove #warning message

to the 3.18-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     scsi-advansys-remove-warning-message.patch
and it can be found in the queue-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From arnd@arndb.de  Fri May  5 10:43:24 2017
From: Arnd Bergmann <arnd@arndb.de>
Date: Fri,  5 May 2017 13:57:22 +0200
Subject: scsi: advansys: remove #warning message
To: gregkh@linuxfoundation.org
Cc: stable@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>, Hannes Reinecke <hare@suse.de>
Message-ID: <20170505115725.1424772-7-arnd@arndb.de>

From: Arnd Bergmann <arnd@arndb.de>

The advansys driver was converted to the proper DMA API in linux-4.2, but
the 3.18-stable kernel still warns about this:

drivers/scsi/advansys.c:71:2: warning: #warning this driver is still not properly converted to the DMA API [-Wcpp]

The warning clearly is not helpful in 3.18 any more, it just clutters up
the build log. This removes the warning instead, and clarifies the
comment above it.

Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/scsi/advansys.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -49,7 +49,7 @@
 #include <scsi/scsi.h>
 #include <scsi/scsi_host.h>
 
-/* FIXME:
+/* Fixed in linux-4.2, not backported to 3.18:
  *
  *  1. Although all of the necessary command mapping places have the
  *     appropriate dma_map.. APIs, the driver still processes its internal
@@ -68,7 +68,6 @@
  *  7. advansys_info is not safe against multiple simultaneous callers
  *  8. Add module_param to override ISA/VLB ioport array
  */
-#warning this driver is still not properly converted to the DMA API
 
 /* Enable driver /proc statistics. */
 #define ADVANSYS_STATS


Patches currently in stable-queue which might be from arnd@arndb.de are

queue-3.18/ib-iser-fix-sparse-warnings.patch
queue-3.18/cred-userns-define-current_user_ns-as-a-function.patch
queue-3.18/mips-elf2ecoff-ignore-pt_mips_abiflags-program-headers.patch
queue-3.18/pci-xilinx-fix-harmless-format-string-warning.patch
queue-3.18/arm64-build-vdso-without-libgcov.patch
queue-3.18/arm64-provide-a-namespace-to-ncaps.patch
queue-3.18/alsa-ppc-awacs-shut-up-maybe-uninitialized-warning.patch
queue-3.18/mips-jz4740-fix-build-error-in-irq.h.patch
queue-3.18/modpost-don-t-emit-section-mismatch-warnings-for-compiler-optimizations.patch
queue-3.18/net-tg3-avoid-uninitialized-variable-warning.patch
queue-3.18/tty-isicom-fix-big-endian-compile-warning.patch
queue-3.18/mtd-avoid-stack-overflow-in-mtd-cfi-code.patch
queue-3.18/cpumask_set_cpu_local_first-cpumask_local_spread-lament.patch
queue-3.18/ib-qib-rename-bits_per_page-to-rvt_bits_per_page.patch
queue-3.18/modpost-expand-pattern-matching-to-support-substring-matches.patch
queue-3.18/ips-remove-pointless-warning.patch
queue-3.18/powerpc-ptrace-fix-out-of-bounds-array-access-warning.patch
queue-3.18/scsi-advansys-remove-warning-message.patch
queue-3.18/staging-imx-drm-fix-indentation-warning.patch
queue-3.18/mlx5-avoid-build-warnings-on-32-bit.patch
queue-3.18/mm-cma-silence-warnings-due-to-max-usage.patch
queue-3.18/misdn-avoid-arch-specific-__builtin_return_address-call.patch
queue-3.18/staging-bcm-add-32-bit-host-dependency.patch
queue-3.18/e1000e-fix-call-to-do_div-to-use-u64-arg.patch
queue-3.18/gfs2-remove-is_err_value-abuse.patch
queue-3.18/message-i2o-fix-64bit-build-warnings.patch
queue-3.18/staging-vt6655-fix-overly-large-stack-usage.patch
queue-3.18/drbd-avoid-redefinition-of-bits_per_page.patch
queue-3.18/infiniband-mlx5-avoid-a-compile-time-warning.patch
queue-3.18/kbuild-mergeconfig-fix-jobserver-unavailable-warning.patch
queue-3.18/arm-cns3xxx-shut-up-frame-size-warning.patch
queue-3.18/ib-ehca-fix-maybe-uninitialized-warnings.patch
queue-3.18/mips-elf2ecoff-fix-warning-due-to-dead-code.patch
queue-3.18/staging-unisys-correctly-handle-return-value-from-queue_delayed_work.patch

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 0/9] [3.18-stable] fixes for all remaining known warnings
  2017-05-05 11:57 [PATCH 0/9] [3.18-stable] fixes for all remaining known warnings Arnd Bergmann
                   ` (8 preceding siblings ...)
  2017-05-05 11:57 ` [PATCH 9/9] [3.18-stable] gfs2: remove IS_ERR_VALUE abuse Arnd Bergmann
@ 2017-05-05 17:48 ` Greg KH
  9 siblings, 0 replies; 20+ messages in thread
From: Greg KH @ 2017-05-05 17:48 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: stable

On Fri, May 05, 2017 at 01:57:16PM +0200, Arnd Bergmann wrote:
> Hi Greg,
> 
> I've gone through the 3.18.51 kernelci.org report one last time to find everything that
> still remained. Here are six more backports that I had either missed earlier, or
> that needed small fixups, and three new patches I did now to address warnings we could
> not fix by backporting existing fixes.
> 
> With a little luck, all build bots should finally give a clean build with these applied.

Thanks for these, all now queued up.  I'll push out a -rc release today
and let's see what happens :)

greg k-h

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 7/9] [3.18-stable] i2o: hide unsafe ioctl on 64-bit
  2017-05-05 17:13   ` Greg KH
@ 2017-05-05 18:36     ` Arnd Bergmann
  2017-05-05 20:07       ` Greg KH
  0 siblings, 1 reply; 20+ messages in thread
From: Arnd Bergmann @ 2017-05-05 18:36 UTC (permalink / raw)
  To: Greg KH; +Cc: stable

On Fri, May 5, 2017 at 7:13 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Fri, May 05, 2017 at 01:57:23PM +0200, Arnd Bergmann wrote:
>> We get a warning about a broken pointer conversion on 64-bit architectures:
>>
>> drivers/message/i2o/i2o_config.c: In function 'i2o_cfg_passthru':
>> drivers/message/i2o/i2o_config.c:893:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>>          (p->virt, (void __user *)sg[i].addr_bus,
>>                    ^
>> drivers/message/i2o/i2o_config.c:953:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>>          ((void __user *)sg[j].addr_bus, sg_list[j].virt,
>>           ^
>>
>> This has clearly never worked right, so we can add an #ifdef around the code.
>> The driver was moved to staging in linux-4.0 and finally removed in 4.2,
>> so upstream does not have a fix for it.
>>
>> The driver originally got this mostly right, though probably by accident.
>
> I fixed this in a different way, doing the cast to make things be quiet,
> as was done in other places in the driver.  You were copied on that
> patch when it was added to my tree, right?

I missed it when you sent it, but looking at it now, I think it introduces
another warning, on 32-bit architectures:

-                                   (p->virt, (void __user *)sg[i].addr_bus,
+                                   (p->virt, (void __user
*)(u64)sg[i].addr_bus,

I think you need '(void __user *)(uintptr_t)sg[i].addr_bus' to
shut up the warning for all builds.

    Arnd

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 7/9] [3.18-stable] i2o: hide unsafe ioctl on 64-bit
  2017-05-05 18:36     ` Arnd Bergmann
@ 2017-05-05 20:07       ` Greg KH
  0 siblings, 0 replies; 20+ messages in thread
From: Greg KH @ 2017-05-05 20:07 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: stable

On Fri, May 05, 2017 at 08:36:55PM +0200, Arnd Bergmann wrote:
> On Fri, May 5, 2017 at 7:13 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Fri, May 05, 2017 at 01:57:23PM +0200, Arnd Bergmann wrote:
> >> We get a warning about a broken pointer conversion on 64-bit architectures:
> >>
> >> drivers/message/i2o/i2o_config.c: In function 'i2o_cfg_passthru':
> >> drivers/message/i2o/i2o_config.c:893:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> >>          (p->virt, (void __user *)sg[i].addr_bus,
> >>                    ^
> >> drivers/message/i2o/i2o_config.c:953:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> >>          ((void __user *)sg[j].addr_bus, sg_list[j].virt,
> >>           ^
> >>
> >> This has clearly never worked right, so we can add an #ifdef around the code.
> >> The driver was moved to staging in linux-4.0 and finally removed in 4.2,
> >> so upstream does not have a fix for it.
> >>
> >> The driver originally got this mostly right, though probably by accident.
> >
> > I fixed this in a different way, doing the cast to make things be quiet,
> > as was done in other places in the driver.  You were copied on that
> > patch when it was added to my tree, right?
> 
> I missed it when you sent it, but looking at it now, I think it introduces
> another warning, on 32-bit architectures:
> 
> -                                   (p->virt, (void __user *)sg[i].addr_bus,
> +                                   (p->virt, (void __user
> *)(u64)sg[i].addr_bus,
> 
> I think you need '(void __user *)(uintptr_t)sg[i].addr_bus' to
> shut up the warning for all builds.

Ah good point.  I've now dropped my version and taken yours instead :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2017-05-05 20:08 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-05 11:57 [PATCH 0/9] [3.18-stable] fixes for all remaining known warnings Arnd Bergmann
2017-05-05 11:57 ` [PATCH 1/9] [3.18-stable] kbuild: mergeconfig: fix "jobserver unavailable" warning Arnd Bergmann
2017-05-05 17:14   ` Greg KH
2017-05-05 17:46     ` Greg KH
2017-05-05 11:57 ` [PATCH 2/9] [3.18-stable] modpost: expand pattern matching to support substring matches Arnd Bergmann
2017-05-05 11:57 ` [PATCH 3/9] [3.18-stable] modpost: don't emit section mismatch warnings for compiler optimizations Arnd Bergmann
2017-05-05 11:57 ` [PATCH 4/9] [3.18-stable] cpumask_set_cpu_local_first => cpumask_local_spread, lament Arnd Bergmann
2017-05-05 11:57 ` [PATCH 5/9] [3.18-stable] e1000e: fix call to do_div() to use u64 arg Arnd Bergmann
2017-05-05 11:57 ` [PATCH 6/9] [3.18-stable] scsi: advansys: remove #warning message Arnd Bergmann
2017-05-05 17:43   ` Greg KH
2017-05-05 17:47   ` Patch "scsi: advansys: remove #warning message" has been added to the 3.18-stable tree gregkh
2017-05-05 11:57 ` [PATCH 7/9] [3.18-stable] i2o: hide unsafe ioctl on 64-bit Arnd Bergmann
2017-05-05 17:13   ` Greg KH
2017-05-05 18:36     ` Arnd Bergmann
2017-05-05 20:07       ` Greg KH
2017-05-05 11:57 ` [PATCH 8/9] [3.18-stable] staging: unisys: correctly handle return value from queue_delayed_work() Arnd Bergmann
2017-05-05 17:44   ` Greg KH
2017-05-05 11:57 ` [PATCH 9/9] [3.18-stable] gfs2: remove IS_ERR_VALUE abuse Arnd Bergmann
2017-05-05 17:47   ` Patch "gfs2: remove IS_ERR_VALUE abuse" has been added to the 3.18-stable tree gregkh
2017-05-05 17:48 ` [PATCH 0/9] [3.18-stable] fixes for all remaining known warnings Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).