]> 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 16:26:41 +0000 (17:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Feb 2017 16:26:41 +0000 (17:26 +0100)
queue-3.18/drivers-net-ethernet-dec-tulip-uli526x.c-fix-misleading-indentation-in-uli526x_timer.patch [new file with mode: 0644]
queue-3.18/iwlegacy-avoid-warning-about-missing-braces.patch [new file with mode: 0644]
queue-3.18/media-remove-unused-variable-that-causes-a-warning.patch [new file with mode: 0644]
queue-3.18/mtd-blkdevs-fix-switch-bool-compilation-warning.patch [new file with mode: 0644]
queue-3.18/netfilter-add-some-missing-default-cases-to-switch-statements-in-nft_reject.patch [new file with mode: 0644]
queue-3.18/s3c-camif-fix-compiler-warnings.patch [new file with mode: 0644]
queue-3.18/series
queue-3.18/x86-xen-fix-upper-bound-of-pmd-loop-in-xen_cleanhighmap.patch [new file with mode: 0644]

diff --git a/queue-3.18/drivers-net-ethernet-dec-tulip-uli526x.c-fix-misleading-indentation-in-uli526x_timer.patch b/queue-3.18/drivers-net-ethernet-dec-tulip-uli526x.c-fix-misleading-indentation-in-uli526x_timer.patch
new file mode 100644 (file)
index 0000000..29ad97c
--- /dev/null
@@ -0,0 +1,72 @@
+From e1395a321eab1a7833d82e952eb8255e0a1f03cb Mon Sep 17 00:00:00 2001
+From: David Malcolm <dmalcolm@redhat.com>
+Date: Tue, 2 Jun 2015 15:31:17 -0400
+Subject: drivers/net/ethernet/dec/tulip/uli526x.c: fix misleading indentation in uli526x_timer
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: David Malcolm <dmalcolm@redhat.com>
+
+commit e1395a321eab1a7833d82e952eb8255e0a1f03cb upstream.
+
+This code in drivers/net/ethernet/dec/tulip/uli526x.c
+function "uli526x_timer":
+
+  1086          } else
+  1087                  if ((tmp_cr12 & 0x3) && db->link_failed) {
+  [...snip...]
+  1109                  }
+  1110                  else if(!(tmp_cr12 & 0x3) && db->link_failed)
+  1111                  {
+  [...snip...]
+  1117                  }
+  1118                  db->init=0;
+
+is misleadingly indented: the
+  db->init=0
+is indented as if part of the else clause at line 1086, but it is
+independent of it (no braces before the "if" at line 1087).
+
+This patch fixes the indentation to reflect the actual meaning of the code,
+though is it actually meant to be part of the "else" clause?  (I'm a
+compiler developer, not a kernel person).  It also adds spaces around
+the assignment, to placate checkpatch.pl.
+
+Seen via an experimental new gcc warning I'm working on for gcc 6,
+-Wmisleading-indentation, using gcc r223098 adding
+-Werror=misleading-indentation to KBUILD_CFLAGS in Makefile.
+The experimental GCC emits this warning (as an error), rightly IMHO:
+
+drivers/net/ethernet/dec/tulip/uli526x.c: In function ‘uli526x_timer’:
+drivers/net/ethernet/dec/tulip/uli526x.c:1118:3: error: statement is
+indented as if it were guarded by... [-Werror=misleading-indentation]
+   db->init=0;
+    ^
+drivers/net/ethernet/dec/tulip/uli526x.c:1086:4: note: ...this ‘else’
+clause, but it is not
+  } else
+     ^
+
+Hope this is helpful
+Dave
+
+Signed-off-by: David Malcolm <dmalcolm@redhat.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/ethernet/dec/tulip/uli526x.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/dec/tulip/uli526x.c
++++ b/drivers/net/ethernet/dec/tulip/uli526x.c
+@@ -1115,7 +1115,7 @@ static void uli526x_timer(unsigned long
+                               netif_carrier_off(dev);
+                       }
+               }
+-              db->init=0;
++      db->init = 0;
+       /* Timer active again */
+       db->timer.expires = ULI526X_TIMER_WUT;
diff --git a/queue-3.18/iwlegacy-avoid-warning-about-missing-braces.patch b/queue-3.18/iwlegacy-avoid-warning-about-missing-braces.patch
new file mode 100644 (file)
index 0000000..78b75d6
--- /dev/null
@@ -0,0 +1,42 @@
+From 682c360eb26f819be942956ce404064839123337 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Thu, 19 May 2016 09:58:49 +0200
+Subject: iwlegacy: avoid warning about missing braces
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 2cce76c3fab410520610a7d2f52faebc3cfcf843 upstream.
+
+gcc-6 warns about code in il3945_hw_txq_ctx_free() being
+somewhat ambiguous:
+
+drivers/net/wireless/intel/iwlegacy/3945.c:1022:5: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
+
+This adds a set of curly braces to avoid the warning.
+
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
+Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/iwlegacy/3945.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/iwlegacy/3945.c
++++ b/drivers/net/wireless/iwlegacy/3945.c
+@@ -1019,12 +1019,13 @@ il3945_hw_txq_ctx_free(struct il_priv *i
+       int txq_id;
+       /* Tx queues */
+-      if (il->txq)
++      if (il->txq) {
+               for (txq_id = 0; txq_id < il->hw_params.max_txq_num; txq_id++)
+                       if (txq_id == IL39_CMD_QUEUE_NUM)
+                               il_cmd_queue_free(il);
+                       else
+                               il_tx_queue_free(il, txq_id);
++      }
+       /* free tx queue structure */
+       il_free_txq_mem(il);
diff --git a/queue-3.18/media-remove-unused-variable-that-causes-a-warning.patch b/queue-3.18/media-remove-unused-variable-that-causes-a-warning.patch
new file mode 100644 (file)
index 0000000..3e0d960
--- /dev/null
@@ -0,0 +1,41 @@
+From 1d11437f4fd02f9b5d3749675a1232216787dcc6 Mon Sep 17 00:00:00 2001
+From: Linus Torvalds <torvalds@linux-foundation.org>
+Date: Tue, 21 Apr 2015 12:49:33 -0700
+Subject: media: remove unused variable that causes a warning
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Linus Torvalds <torvalds@linux-foundation.org>
+
+commit 1d11437f4fd02f9b5d3749675a1232216787dcc6 upstream.
+
+My 'allmodconfig' build is _almost_ free of warnings, and most of the
+remaining ones are for legacy drivers that just do bad things that I
+can't find it in my black heart to care too much about.  But this one
+was just annoying me:
+
+   drivers/media/v4l2-core/videobuf2-core.c:3256:26: warning: unused variable ‘fileio’ [-Wunused-variable]
+
+because commit 0e661006370b ("[media] vb2: fix 'UNBALANCED' warnings
+when calling vb2_thread_stop()") removed all users of 'fileio' and
+instead calls "__vb2_cleanup_fileio(q)" to clean up q->fileio.  But the
+now unused 'fileio' variable was left around.
+
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/media/v4l2-core/videobuf2-core.c |    1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/drivers/media/v4l2-core/videobuf2-core.c
++++ b/drivers/media/v4l2-core/videobuf2-core.c
+@@ -3221,7 +3221,6 @@ EXPORT_SYMBOL_GPL(vb2_thread_start);
+ int vb2_thread_stop(struct vb2_queue *q)
+ {
+       struct vb2_threadio_data *threadio = q->threadio;
+-      struct vb2_fileio_data *fileio = q->fileio;
+       int err;
+       if (threadio == NULL)
diff --git a/queue-3.18/mtd-blkdevs-fix-switch-bool-compilation-warning.patch b/queue-3.18/mtd-blkdevs-fix-switch-bool-compilation-warning.patch
new file mode 100644 (file)
index 0000000..56438de
--- /dev/null
@@ -0,0 +1,49 @@
+From cc7fce80229067890365c1ee196be5d304d36dea Mon Sep 17 00:00:00 2001
+From: Tomer Barletz <barletz@gmail.com>
+Date: Tue, 4 Aug 2015 21:00:24 -0700
+Subject: mtd: blkdevs: fix switch-bool compilation warning
+
+From: Tomer Barletz <barletz@gmail.com>
+
+commit cc7fce80229067890365c1ee196be5d304d36dea upstream.
+
+With gcc 5.1 I get:
+warning: switch condition has boolean value [-Wswitch-bool]
+
+Signed-off-by: Tomer Barletz <barletz@gmail.com>
+Signed-off-by: Brian Norris <computersforpeace@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mtd/mtd_blkdevs.c |    8 ++------
+ 1 file changed, 2 insertions(+), 6 deletions(-)
+
+--- a/drivers/mtd/mtd_blkdevs.c
++++ b/drivers/mtd/mtd_blkdevs.c
+@@ -97,14 +97,13 @@ static int do_blktrans_request(struct mt
+       if (req->cmd_flags & REQ_DISCARD)
+               return tr->discard(dev, block, nsect);
+-      switch(rq_data_dir(req)) {
+-      case READ:
++      if (rq_data_dir(req) == READ) {
+               for (; nsect > 0; nsect--, block++, buf += tr->blksize)
+                       if (tr->readsect(dev, block, buf))
+                               return -EIO;
+               rq_flush_dcache_pages(req);
+               return 0;
+-      case WRITE:
++      } else {
+               if (!tr->writesect)
+                       return -EIO;
+@@ -113,9 +112,6 @@ static int do_blktrans_request(struct mt
+                       if (tr->writesect(dev, block, buf))
+                               return -EIO;
+               return 0;
+-      default:
+-              printk(KERN_NOTICE "Unknown request %u\n", rq_data_dir(req));
+-              return -EIO;
+       }
+ }
diff --git a/queue-3.18/netfilter-add-some-missing-default-cases-to-switch-statements-in-nft_reject.patch b/queue-3.18/netfilter-add-some-missing-default-cases-to-switch-statements-in-nft_reject.patch
new file mode 100644 (file)
index 0000000..038275a
--- /dev/null
@@ -0,0 +1,58 @@
+From 129d23a56623eea0947a05288158d76dc7f2f0ac Mon Sep 17 00:00:00 2001
+From: "David S. Miller" <davem@davemloft.net>
+Date: Mon, 27 Apr 2015 13:20:34 -0400
+Subject: netfilter; Add some missing default cases to switch statements in nft_reject.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: David S. Miller <davem@davemloft.net>
+
+commit 129d23a56623eea0947a05288158d76dc7f2f0ac upstream.
+
+This fixes:
+
+====================
+net/netfilter/nft_reject.c: In function ‘nft_reject_dump’:
+net/netfilter/nft_reject.c:61:2: warning: enumeration value ‘NFT_REJECT_TCP_RST’ not handled in switch [-Wswitch]
+  switch (priv->type) {
+  ^
+net/netfilter/nft_reject.c:61:2: warning: enumeration value ‘NFT_REJECT_ICMPX_UNREACH’ not handled in switch [-Wswi\
+tch]
+net/netfilter/nft_reject_inet.c: In function ‘nft_reject_inet_dump’:
+net/netfilter/nft_reject_inet.c:105:2: warning: enumeration value ‘NFT_REJECT_TCP_RST’ not handled in switch [-Wswi\
+tch]
+  switch (priv->type) {
+  ^
+====================
+
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/netfilter/nft_reject.c      |    2 ++
+ net/netfilter/nft_reject_inet.c |    2 ++
+ 2 files changed, 4 insertions(+)
+
+--- a/net/netfilter/nft_reject.c
++++ b/net/netfilter/nft_reject.c
+@@ -63,6 +63,8 @@ int nft_reject_dump(struct sk_buff *skb,
+               if (nla_put_u8(skb, NFTA_REJECT_ICMP_CODE, priv->icmp_code))
+                       goto nla_put_failure;
+               break;
++      default:
++              break;
+       }
+       return 0;
+--- a/net/netfilter/nft_reject_inet.c
++++ b/net/netfilter/nft_reject_inet.c
+@@ -105,6 +105,8 @@ static int nft_reject_inet_dump(struct s
+               if (nla_put_u8(skb, NFTA_REJECT_ICMP_CODE, priv->icmp_code))
+                       goto nla_put_failure;
+               break;
++      default:
++              break;
+       }
+       return 0;
diff --git a/queue-3.18/s3c-camif-fix-compiler-warnings.patch b/queue-3.18/s3c-camif-fix-compiler-warnings.patch
new file mode 100644 (file)
index 0000000..3b515c0
--- /dev/null
@@ -0,0 +1,49 @@
+From 7e0d4e92269e574e50a58041fac4cc75a149828c Mon Sep 17 00:00:00 2001
+From: Hans Verkuil <hans.verkuil@cisco.com>
+Date: Mon, 27 Apr 2015 04:29:52 -0300
+Subject: [media] s3c-camif: fix compiler warnings
+
+From: Hans Verkuil <hans.verkuil@cisco.com>
+
+commit 7e0d4e92269e574e50a58041fac4cc75a149828c upstream.
+
+Fix these compiler warnings that appeared after switching to gcc-5.1.0:
+
+drivers/media/platform/s3c-camif/camif-capture.c: In function 'sensor_set_power':
+drivers/media/platform/s3c-camif/camif-capture.c:118:10: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
+  if (!on == camif->sensor.power_count)
+          ^
+drivers/media/platform/s3c-camif/camif-capture.c: In function 'sensor_set_streaming':
+drivers/media/platform/s3c-camif/camif-capture.c:134:10: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
+  if (!on == camif->sensor.stream_count)
+          ^
+
+Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
+Cc: Kamil Debski <k.debski@samsung.com>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/media/platform/s3c-camif/camif-capture.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/media/platform/s3c-camif/camif-capture.c
++++ b/drivers/media/platform/s3c-camif/camif-capture.c
+@@ -115,7 +115,7 @@ static int sensor_set_power(struct camif
+       struct cam_sensor *sensor = &camif->sensor;
+       int err = 0;
+-      if (!on == camif->sensor.power_count)
++      if (camif->sensor.power_count == !on)
+               err = v4l2_subdev_call(sensor->sd, core, s_power, on);
+       if (!err)
+               sensor->power_count += on ? 1 : -1;
+@@ -131,7 +131,7 @@ static int sensor_set_streaming(struct c
+       struct cam_sensor *sensor = &camif->sensor;
+       int err = 0;
+-      if (!on == camif->sensor.stream_count)
++      if (camif->sensor.stream_count == !on)
+               err = v4l2_subdev_call(sensor->sd, video, s_stream, on);
+       if (!err)
+               sensor->stream_count += on ? 1 : -1;
index 6af3651e820551a66bdf504ad55d7286a11c9e58..8d8cf830847bb07e850b62abdabf2212d0f0beb2 100644 (file)
@@ -9,3 +9,10 @@ bluetooth-make-hci_test_bit-s-addr-const.patch
 ata-hpt366-fix-constant-cast-warning.patch
 hid-hid-input-add-parentheses-to-quell-gcc-warning.patch
 alsa-oxygen-fix-logical-not-parentheses-warning.patch
+x86-xen-fix-upper-bound-of-pmd-loop-in-xen_cleanhighmap.patch
+s3c-camif-fix-compiler-warnings.patch
+netfilter-add-some-missing-default-cases-to-switch-statements-in-nft_reject.patch
+mtd-blkdevs-fix-switch-bool-compilation-warning.patch
+media-remove-unused-variable-that-causes-a-warning.patch
+drivers-net-ethernet-dec-tulip-uli526x.c-fix-misleading-indentation-in-uli526x_timer.patch
+iwlegacy-avoid-warning-about-missing-braces.patch
diff --git a/queue-3.18/x86-xen-fix-upper-bound-of-pmd-loop-in-xen_cleanhighmap.patch b/queue-3.18/x86-xen-fix-upper-bound-of-pmd-loop-in-xen_cleanhighmap.patch
new file mode 100644 (file)
index 0000000..aafd99c
--- /dev/null
@@ -0,0 +1,33 @@
+From 1cf38741308c64d08553602b3374fb39224eeb5a Mon Sep 17 00:00:00 2001
+From: Juergen Gross <jgross@suse.com>
+Date: Thu, 23 Jun 2016 07:12:27 +0200
+Subject: x86/xen: fix upper bound of pmd loop in xen_cleanhighmap()
+
+From: Juergen Gross <jgross@suse.com>
+
+commit 1cf38741308c64d08553602b3374fb39224eeb5a upstream.
+
+xen_cleanhighmap() is operating on level2_kernel_pgt only. The upper
+bound of the loop setting non-kernel-image entries to zero should not
+exceed the size of level2_kernel_pgt.
+
+Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Juergen Gross <jgross@suse.com>
+Signed-off-by: David Vrabel <david.vrabel@citrix.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/xen/mmu.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/xen/mmu.c
++++ b/arch/x86/xen/mmu.c
+@@ -1147,7 +1147,7 @@ static void __init xen_cleanhighmap(unsi
+       /* NOTE: The loop is more greedy than the cleanup_highmap variant.
+        * We include the PMD passed in on _both_ boundaries. */
+-      for (; vaddr <= vaddr_end && (pmd < (level2_kernel_pgt + PAGE_SIZE));
++      for (; vaddr <= vaddr_end && (pmd < (level2_kernel_pgt + PTRS_PER_PMD));
+                       pmd++, vaddr += PMD_SIZE) {
+               if (pmd_none(*pmd))
+                       continue;