From: Greg Kroah-Hartman Date: Thu, 22 Sep 2016 17:12:20 +0000 (+0200) Subject: 4.7-stable patches X-Git-Tag: v4.4.22~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8474fc760c673e054b826a0891fb517e1e946213;p=thirdparty%2Fkernel%2Fstable-queue.git 4.7-stable patches added patches: add-braces-to-avoid-ambiguous-else-compiler-warnings.patch genirq-msi-fix-broken-debug-output.patch iwlegacy-avoid-warning-about-missing-braces.patch --- diff --git a/queue-4.7/add-braces-to-avoid-ambiguous-else-compiler-warnings.patch b/queue-4.7/add-braces-to-avoid-ambiguous-else-compiler-warnings.patch new file mode 100644 index 00000000000..e6e062ada19 --- /dev/null +++ b/queue-4.7/add-braces-to-avoid-ambiguous-else-compiler-warnings.patch @@ -0,0 +1,90 @@ +From 194dc870a5890e855ecffb30f3b80ba7c88f96d6 Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Wed, 27 Jul 2016 20:03:31 -0700 +Subject: Add braces to avoid "ambiguous ‘else’" compiler warnings +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Linus Torvalds + +commit 194dc870a5890e855ecffb30f3b80ba7c88f96d6 upstream. + +Some of our "for_each_xyz()" macro constructs make gcc unhappy about +lack of braces around if-statements inside or outside the loop, because +the loop construct itself has a "if-then-else" statement inside of it. + +The resulting warnings look something like this: + + drivers/gpu/drm/i915/i915_debugfs.c: In function ‘i915_dump_lrc’: + drivers/gpu/drm/i915/i915_debugfs.c:2103:6: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses] + if (ctx != dev_priv->kernel_context) + ^ + +even if the code itself is fine. + +Since the warning is fairly easy to avoid by adding a braces around the +if-statement near the for_each_xyz() construct, do so, rather than +disabling the otherwise potentially useful warning. + +(The if-then-else statements used in the "for_each_xyz()" constructs are +designed to be inherently safe even with no braces, but in this case +it's quite understandable that gcc isn't really able to tell that). + +This finally leaves the standard "allmodconfig" build with just a +handful of remaining warnings, so new and valid warnings hopefully will +stand out. + +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/i915_debugfs.c | 3 ++- + drivers/iommu/dmar.c | 3 ++- + drivers/iommu/intel-iommu.c | 3 ++- + 3 files changed, 6 insertions(+), 3 deletions(-) + +--- a/drivers/gpu/drm/i915/i915_debugfs.c ++++ b/drivers/gpu/drm/i915/i915_debugfs.c +@@ -2100,9 +2100,10 @@ static int i915_dump_lrc(struct seq_file + return ret; + + list_for_each_entry(ctx, &dev_priv->context_list, link) +- if (ctx != dev_priv->kernel_context) ++ if (ctx != dev_priv->kernel_context) { + for_each_engine(engine, dev_priv) + i915_dump_lrc_obj(m, ctx, engine); ++ } + + mutex_unlock(&dev->struct_mutex); + +--- a/drivers/iommu/dmar.c ++++ b/drivers/iommu/dmar.c +@@ -1871,10 +1871,11 @@ static int dmar_hp_remove_drhd(struct ac + /* + * All PCI devices managed by this unit should have been destroyed. + */ +- if (!dmaru->include_all && dmaru->devices && dmaru->devices_cnt) ++ if (!dmaru->include_all && dmaru->devices && dmaru->devices_cnt) { + for_each_active_dev_scope(dmaru->devices, + dmaru->devices_cnt, i, dev) + return -EBUSY; ++ } + + ret = dmar_ir_hotplug(dmaru, false); + if (ret == 0) +--- a/drivers/iommu/intel-iommu.c ++++ b/drivers/iommu/intel-iommu.c +@@ -4272,10 +4272,11 @@ int dmar_check_one_atsr(struct acpi_dmar + if (!atsru) + return 0; + +- if (!atsru->include_all && atsru->devices && atsru->devices_cnt) ++ if (!atsru->include_all && atsru->devices && atsru->devices_cnt) { + for_each_active_dev_scope(atsru->devices, atsru->devices_cnt, + i, dev) + return -EBUSY; ++ } + + return 0; + } diff --git a/queue-4.7/genirq-msi-fix-broken-debug-output.patch b/queue-4.7/genirq-msi-fix-broken-debug-output.patch new file mode 100644 index 00000000000..c80cc7b88fd --- /dev/null +++ b/queue-4.7/genirq-msi-fix-broken-debug-output.patch @@ -0,0 +1,30 @@ +From 4364e1a29be16b2783c0bcbc263f61236af64281 Mon Sep 17 00:00:00 2001 +From: Thomas Gleixner +Date: Mon, 4 Jul 2016 15:32:25 +0200 +Subject: genirq/msi: Fix broken debug output + +From: Thomas Gleixner + +commit 4364e1a29be16b2783c0bcbc263f61236af64281 upstream. + +virq is not required to be the same for all msi descs. Use the base irq number +from the desc in the debug printk. + +Reported-by: Ingo Molnar +Signed-off-by: Thomas Gleixner +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/irq/msi.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/kernel/irq/msi.c ++++ b/kernel/irq/msi.c +@@ -352,6 +352,7 @@ int msi_domain_alloc_irqs(struct irq_dom + ops->msi_finish(&arg, 0); + + for_each_msi_entry(desc, dev) { ++ virq = desc->irq; + if (desc->nvec_used == 1) + dev_dbg(dev, "irq %d for MSI\n", virq); + else diff --git a/queue-4.7/iwlegacy-avoid-warning-about-missing-braces.patch b/queue-4.7/iwlegacy-avoid-warning-about-missing-braces.patch new file mode 100644 index 00000000000..aa4581661d7 --- /dev/null +++ b/queue-4.7/iwlegacy-avoid-warning-about-missing-braces.patch @@ -0,0 +1,42 @@ +From 2cce76c3fab410520610a7d2f52faebc3cfcf843 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Thu, 19 May 2016 09:58:49 +0200 +Subject: iwlegacy: avoid warning about missing braces + +From: Arnd Bergmann + +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 +Acked-by: Stanislaw Gruszka +Signed-off-by: Kalle Valo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/intel/iwlegacy/3945.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/intel/iwlegacy/3945.c ++++ b/drivers/net/wireless/intel/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-4.7/series b/queue-4.7/series index c47c43aa54d..ebc3f97b663 100644 --- a/queue-4.7/series +++ b/queue-4.7/series @@ -179,3 +179,6 @@ mn10300-copy_from_user-should-zero-on-access_ok-failure.patch sparc32-fix-copy_from_user.patch ppc32-fix-copy_from_user.patch ia64-copy_from_user-should-zero-the-destination-on-access_ok-failure.patch +iwlegacy-avoid-warning-about-missing-braces.patch +genirq-msi-fix-broken-debug-output.patch +add-braces-to-avoid-ambiguous-else-compiler-warnings.patch