--- /dev/null
+From 194dc870a5890e855ecffb30f3b80ba7c88f96d6 Mon Sep 17 00:00:00 2001
+From: Linus Torvalds <torvalds@linux-foundation.org>
+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 <torvalds@linux-foundation.org>
+
+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 <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/iommu/dmar.c | 3 ++-
+ drivers/iommu/intel-iommu.c | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+--- a/drivers/iommu/dmar.c
++++ b/drivers/iommu/dmar.c
+@@ -1858,10 +1858,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
+@@ -4182,10 +4182,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;
+ }
--- /dev/null
+From 0fb504001192c1df62c847a8bb6558753c36ebef Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Mon, 14 Mar 2016 19:40:08 -0300
+Subject: [media] am437x-vfpe: fix typo in vpfe_get_app_input_index
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 0fb504001192c1df62c847a8bb6558753c36ebef upstream.
+
+gcc-6 points out an obviously silly comparison in vpfe_get_app_input_index():
+
+drivers/media/platform/am437x/am437x-vpfe.c: In function 'vpfe_get_app_input_index':
+drivers/media/platform/am437x/am437x-vpfe.c:1709:27: warning: self-comparison always evaluats to true [-Wtautological-compare]
+ client->adapter->nr == client->adapter->nr) {
+ ^~
+
+This was introduced in a slighly incorrect conversion, and it's
+clear that the comparison was meant to compare the iterator
+to the current subdev instead, as we do in the line above.
+
+Fixes: d37232390fd4 ("[media] media: am437x-vpfe: match the OF node/i2c addr instead of name")
+
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
+Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/media/platform/am437x/am437x-vpfe.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/media/platform/am437x/am437x-vpfe.c
++++ b/drivers/media/platform/am437x/am437x-vpfe.c
+@@ -1706,7 +1706,7 @@ static int vpfe_get_app_input_index(stru
+ sdinfo = &cfg->sub_devs[i];
+ client = v4l2_get_subdevdata(sdinfo->sd);
+ if (client->addr == curr_client->addr &&
+- client->adapter->nr == client->adapter->nr) {
++ client->adapter->nr == curr_client->adapter->nr) {
+ if (vpfe->current_input >= 1)
+ return -1;
+ *app_input_index = j + vpfe->current_input;
--- /dev/null
+From 362210e0dff4eb7bb36a9b34dbef3b39d779d95e Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Mon, 14 Mar 2016 15:18:37 +0100
+Subject: ath9k: fix misleading indentation
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 362210e0dff4eb7bb36a9b34dbef3b39d779d95e upstream.
+
+A cleanup patch in linux-3.18 moved around some code in the ath9k
+driver and left some code to be indented in a misleading way,
+made worse by the addition of some new code for p2p mode, as
+discovered by a new gcc-6 warning:
+
+drivers/net/wireless/ath/ath9k/init.c: In function 'ath9k_set_hw_capab':
+drivers/net/wireless/ath/ath9k/init.c:851:4: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
+ hw->wiphy->iface_combinations = if_comb;
+ ^~
+drivers/net/wireless/ath/ath9k/init.c:847:3: note: ...this 'if' clause, but it is not
+ if (ath9k_is_chanctx_enabled())
+ ^~
+
+The code is in fact correct, but the indentation is not, so I'm
+reformatting it as it should have been after the original cleanup.
+
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Fixes: 499afaccf6f3 ("ath9k: Isolate ath9k_use_chanctx module parameter")
+Fixes: eb61f9f623f7 ("ath9k: advertise p2p dev support when chanctx")
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/ath/ath9k/init.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath9k/init.c
++++ b/drivers/net/wireless/ath/ath9k/init.c
+@@ -869,8 +869,8 @@ static void ath9k_set_hw_capab(struct at
+ hw->wiphy->interface_modes |=
+ BIT(NL80211_IFTYPE_P2P_DEVICE);
+
+- hw->wiphy->iface_combinations = if_comb;
+- hw->wiphy->n_iface_combinations = ARRAY_SIZE(if_comb);
++ hw->wiphy->iface_combinations = if_comb;
++ hw->wiphy->n_iface_combinations = ARRAY_SIZE(if_comb);
+ }
+
+ hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT;
--- /dev/null
+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
+@@ -617,6 +617,7 @@ include arch/$(SRCARCH)/Makefile
+
+ KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
+ KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,)
++KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
+
+ ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
+ KBUILD_CFLAGS += -Os
--- /dev/null
+From 6e8d666e925333c55378e8d5540a8a9ee0eea9c5 Mon Sep 17 00:00:00 2001
+From: Linus Torvalds <torvalds@linux-foundation.org>
+Date: Wed, 27 Jul 2016 13:17:41 -0700
+Subject: Disable "maybe-uninitialized" warning globally
+
+From: Linus Torvalds <torvalds@linux-foundation.org>
+
+commit 6e8d666e925333c55378e8d5540a8a9ee0eea9c5 upstream.
+
+Several build configurations had already disabled this warning because
+it generates a lot of false positives. But some had not, and it was
+still enabled for "allmodconfig" builds, for example.
+
+Looking at the warnings produced, every single one I looked at was a
+false positive, and the warnings are frequent enough (and big enough)
+that they can easily hide real problems that you don't notice in the
+noise generated by -Wmaybe-uninitialized.
+
+The warning is good in theory, but this is a classic case of a warning
+that causes more problems than the warning can solve.
+
+If gcc gets better at avoiding false positives, we may be able to
+re-enable this warning. But as is, we're better off without it, and I
+want to be able to see the *real* warnings.
+
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ Makefile | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -368,7 +368,7 @@ AFLAGS_MODULE =
+ LDFLAGS_MODULE =
+ CFLAGS_KERNEL =
+ AFLAGS_KERNEL =
+-CFLAGS_GCOV = -fprofile-arcs -ftest-coverage -fno-tree-loop-im -Wno-maybe-uninitialized
++CFLAGS_GCOV = -fprofile-arcs -ftest-coverage -fno-tree-loop-im
+
+
+ # Use USERINCLUDE when you must reference the UAPI directories only.
+@@ -616,12 +616,13 @@ ARCH_CFLAGS :=
+ include arch/$(SRCARCH)/Makefile
+
+ KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
++KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,)
+
+ ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
+-KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,)
++KBUILD_CFLAGS += -Os
+ else
+ ifdef CONFIG_PROFILE_ALL_BRANCHES
+-KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,)
++KBUILD_CFLAGS += -O2
+ else
+ KBUILD_CFLAGS += -O2
+ endif
--- /dev/null
+From e72e2dfe7c16ffbfbabf9cb24adc6d9f93a4fe37 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Mon, 25 Apr 2016 17:35:31 +0200
+Subject: gcov: disable -Wmaybe-uninitialized warning
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit e72e2dfe7c16ffbfbabf9cb24adc6d9f93a4fe37 upstream.
+
+When gcov profiling is enabled, we see a lot of spurious warnings about
+possibly uninitialized variables being used:
+
+arch/arm/mm/dma-mapping.c: In function 'arm_coherent_iommu_map_page':
+arch/arm/mm/dma-mapping.c:1085:16: warning: 'start' may be used uninitialized in this function [-Wmaybe-uninitialized]
+drivers/clk/st/clk-flexgen.c: In function 'st_of_flexgen_setup':
+drivers/clk/st/clk-flexgen.c:323:9: warning: 'num_parents' may be used uninitialized in this function [-Wmaybe-uninitialized]
+kernel/cgroup.c: In function 'cgroup_mount':
+kernel/cgroup.c:2119:11: warning: 'root' may be used uninitialized in this function [-Wmaybe-uninitialized]
+
+All of these are false positives, so it seems better to just disable
+the warnings whenever GCOV is enabled. Most users don't enable GCOV,
+and based on a prior patch, it is now also disabled for 'allmodconfig'
+builds, so there should be no downsides of doing this.
+
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Acked-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
+Signed-off-by: Michal Marek <mmarek@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -368,7 +368,7 @@ AFLAGS_MODULE =
+ LDFLAGS_MODULE =
+ CFLAGS_KERNEL =
+ AFLAGS_KERNEL =
+-CFLAGS_GCOV = -fprofile-arcs -ftest-coverage -fno-tree-loop-im
++CFLAGS_GCOV = -fprofile-arcs -ftest-coverage -fno-tree-loop-im -Wno-maybe-uninitialized
+
+
+ # Use USERINCLUDE when you must reference the UAPI directories only.
--- /dev/null
+From 2cce76c3fab410520610a7d2f52faebc3cfcf843 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);
--- /dev/null
+From 815eb71e7149ecce40db9dd0ad09c4dd9d33c60f Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Mon, 25 Apr 2016 17:35:28 +0200
+Subject: Kbuild: disable 'maybe-uninitialized' warning for CONFIG_PROFILE_ALL_BRANCHES
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 815eb71e7149ecce40db9dd0ad09c4dd9d33c60f upstream.
+
+CONFIG_PROFILE_ALL_BRANCHES confuses gcc-5.x to the degree that it prints
+incorrect warnings about a lot of variables that it thinks can be used
+uninitialized, e.g.:
+
+i2c/busses/i2c-diolan-u2c.c: In function 'diolan_usb_xfer':
+i2c/busses/i2c-diolan-u2c.c:391:16: warning: 'byte' may be used uninitialized in this function
+iio/gyro/itg3200_core.c: In function 'itg3200_probe':
+iio/gyro/itg3200_core.c:213:6: warning: 'val' may be used uninitialized in this function
+leds/leds-lp55xx-common.c: In function 'lp55xx_update_bits':
+leds/leds-lp55xx-common.c:350:6: warning: 'tmp' may be used uninitialized in this function
+misc/bmp085.c: In function 'show_pressure':
+misc/bmp085.c:363:10: warning: 'pressure' may be used uninitialized in this function
+power/ds2782_battery.c: In function 'ds2786_get_capacity':
+power/ds2782_battery.c:214:17: warning: 'raw' may be used uninitialized in this function
+
+These are all false positives that either rob someone's time when trying
+to figure out whether they are real, or they get people to send wrong
+patches to shut up the warnings.
+
+Nobody normally wants to run a CONFIG_PROFILE_ALL_BRANCHES kernel in
+production, so disabling the whole class of warnings for this configuration
+has no serious downsides either.
+
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Acked-by: Steven Rostedt <rostedtgoodmis.org>
+Signed-off-by: Michal Marek <mmarek@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ Makefile | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -620,7 +620,11 @@ KBUILD_CFLAGS += $(call cc-option,-fno-d
+ ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
+ KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,)
+ else
+-KBUILD_CFLAGS += -O2
++ifdef CONFIG_PROFILE_ALL_BRANCHES
++KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,)
++else
++KBUILD_CFLAGS += -O2
++endif
+ endif
+
+ # Tell gcc to never replace conditional load with a non-conditional one
--- /dev/null
+From a85a41ed69f27c4c667d8c418df14b4fb220c4ad Mon Sep 17 00:00:00 2001
+From: Michal Marek <mmarek@suse.cz>
+Date: Thu, 10 Dec 2015 15:53:06 +0100
+Subject: kbuild: Do not run modules_install and install in paralel
+
+From: Michal Marek <mmarek@suse.cz>
+
+commit a85a41ed69f27c4c667d8c418df14b4fb220c4ad upstream.
+
+Based on a x86-only patch by Andy Lutomirski <luto@amacapital.net>
+
+With modular kernels, 'make install' is going to need the installed
+modules at some point to generate the initramfs.
+
+Signed-off-by: Michal Marek <mmarek@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ Makefile | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/Makefile
++++ b/Makefile
+@@ -495,6 +495,12 @@ ifeq ($(KBUILD_EXTMOD),)
+ endif
+ endif
+ endif
++# install and module_install need also be processed one by one
++ifneq ($(filter install,$(MAKECMDGOALS)),)
++ ifneq ($(filter modules_install,$(MAKECMDGOALS)),)
++ mixed-targets := 1
++ endif
++endif
+
+ ifeq ($(mixed-targets),1)
+ # ===========================================================================
--- /dev/null
+From 51193b76bfff5027cf96ba63effae808ad67cca7 Mon Sep 17 00:00:00 2001
+From: Robert Jarzmik <robert.jarzmik@free.fr>
+Date: Sat, 2 Apr 2016 21:38:53 +0200
+Subject: kbuild: forbid kernel directory to contain spaces and colons
+
+From: Robert Jarzmik <robert.jarzmik@free.fr>
+
+commit 51193b76bfff5027cf96ba63effae808ad67cca7 upstream.
+
+When the kernel path contains a space or a colon somewhere in the path
+name, the modules_install target doesn't work anymore, as the path names
+are not enclosed in double quotes. It is also supposed that and O= build
+will suffer from the same weakness as modules_install.
+
+Instead of checking and improving kbuild to resist to directories
+including these characters, error out early to prevent any build if the
+kernel's main directory contains a space.
+
+Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
+Signed-off-by: Michal Marek <mmarek@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ Makefile | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/Makefile
++++ b/Makefile
+@@ -128,6 +128,10 @@ _all:
+ # Cancel implicit rules on top Makefile
+ $(CURDIR)/Makefile Makefile: ;
+
++ifneq ($(words $(subst :, ,$(CURDIR))), 1)
++ $(error main directory cannot contain spaces nor colons)
++endif
++
+ ifneq ($(KBUILD_OUTPUT),)
+ # Invoke a second make in the output directory, passing relevant variables
+ # check that the output directory actually exists
--- /dev/null
+From 377ccbb483738f84400ddf5840c7dd8825716985 Mon Sep 17 00:00:00 2001
+From: Steven Rostedt <rostedt@goodmis.org>
+Date: Thu, 28 Jul 2016 22:30:43 -0400
+Subject: Makefile: Mute warning for __builtin_return_address(>0) for tracing only
+
+From: Steven Rostedt <rostedt@goodmis.org>
+
+commit 377ccbb483738f84400ddf5840c7dd8825716985 upstream.
+
+With the latest gcc compilers, they give a warning if
+__builtin_return_address() parameter is greater than 0. That is because if
+it is used by a function called by a top level function (or in the case of
+the kernel, by assembly), it can try to access stack frames outside the
+stack and crash the system.
+
+The tracing system uses __builtin_return_address() of up to 2! But it is
+well aware of the dangers that it may have, and has even added precautions
+to protect against it (see the thunk code in arch/x86/entry/thunk*.S)
+
+Linus originally added KBUILD_CFLAGS that would suppress the warning for the
+entire kernel, as simply adding KBUILD_CFLAGS to the tracing directory
+wouldn't work. The tracing directory plays a bit with the CFLAGS and
+requires a little more logic.
+
+This adds that special logic to only suppress the warning for the tracing
+directory. If it is used anywhere else outside of tracing, the warning will
+still be triggered.
+
+Link: http://lkml.kernel.org/r/20160728223043.51996267@grimm.local.home
+
+Tested-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ Makefile | 1 -
+ kernel/trace/Makefile | 4 ++++
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -617,7 +617,6 @@ include arch/$(SRCARCH)/Makefile
+
+ KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
+ KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,)
+-KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
+
+ ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
+ KBUILD_CFLAGS += -Os
+--- a/kernel/trace/Makefile
++++ b/kernel/trace/Makefile
+@@ -1,4 +1,8 @@
+
++# We are fully aware of the dangers of __builtin_return_address()
++FRAME_CFLAGS := $(call cc-disable-warning,frame-address)
++KBUILD_CFLAGS += $(FRAME_CFLAGS)
++
+ # Do not instrument the tracer itself:
+
+ ifdef CONFIG_FUNCTION_TRACER
--- /dev/null
+From 40ab87a4003c7952976ce901a2b9ece5ed833168 Mon Sep 17 00:00:00 2001
+From: Wang YanQing <udknight@gmail.com>
+Date: Fri, 11 Dec 2015 00:35:19 +0800
+Subject: Makefile: revert "Makefile: Document ability to make file.lst and file.S" partially
+
+From: Wang YanQing <udknight@gmail.com>
+
+commit 40ab87a4003c7952976ce901a2b9ece5ed833168 upstream.
+
+Commit 627189797807 ("Makefile: Document ability to make file.lst
+and file.S") document ability to make file.S, but there isn't such
+ability in kbuild, so revert it.
+
+Signed-off-by: Wang YanQing <udknight@gmail.com>
+Signed-off-by: Michal Marek <mmarek@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -1266,7 +1266,7 @@ help:
+ @echo ' firmware_install- Install all firmware to INSTALL_FW_PATH'
+ @echo ' (default: $$(INSTALL_MOD_PATH)/lib/firmware)'
+ @echo ' dir/ - Build all files in dir and below'
+- @echo ' dir/file.[oisS] - Build specified target only'
++ @echo ' dir/file.[ois] - Build specified target only'
+ @echo ' dir/file.lst - Build specified mixed source/assembly target only'
+ @echo ' (requires a recent binutils and recent build (System.map))'
+ @echo ' dir/file.ko - Build module including final link'
--- /dev/null
+From 546e559c79b1a8d27c23262907a00fc209e392a0 Mon Sep 17 00:00:00 2001
+From: Maurizio Lombardi <mlombard@redhat.com>
+Date: Fri, 22 Jan 2016 13:41:42 +0100
+Subject: megaraid: fix null pointer check in megasas_detach_one().
+
+From: Maurizio Lombardi <mlombard@redhat.com>
+
+commit 546e559c79b1a8d27c23262907a00fc209e392a0 upstream.
+
+The pd_seq_sync pointer can't be NULL, we have to check its entries
+instead.
+
+Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
+Acked-by: Sumit Saxena <sumit.saxena@broadcom.com>
+Reviewed-by: Tomas Henzl <thenzl@redhat.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/scsi/megaraid/megaraid_sas_base.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/drivers/scsi/megaraid/megaraid_sas_base.c
++++ b/drivers/scsi/megaraid/megaraid_sas_base.c
+@@ -5941,11 +5941,11 @@ static void megasas_detach_one(struct pc
+ if (fusion->ld_drv_map[i])
+ free_pages((ulong)fusion->ld_drv_map[i],
+ fusion->drv_map_pages);
+- if (fusion->pd_seq_sync)
+- dma_free_coherent(&instance->pdev->dev,
+- pd_seq_map_sz,
+- fusion->pd_seq_sync[i],
+- fusion->pd_seq_phys[i]);
++ if (fusion->pd_seq_sync[i])
++ dma_free_coherent(&instance->pdev->dev,
++ pd_seq_map_sz,
++ fusion->pd_seq_sync[i],
++ fusion->pd_seq_phys[i]);
+ }
+ free_pages((ulong)instance->ctrl_context,
+ instance->ctrl_context_pages);
--- /dev/null
+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 */
--- /dev/null
+From 86d65b7e7a0c927d07d18605c276d0f142438ead Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Mon, 14 Mar 2016 15:24:10 +0100
+Subject: nouveau: fix nv40_perfctr_next() cleanup regression
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 86d65b7e7a0c927d07d18605c276d0f142438ead upstream.
+
+gcc-6 warns about code in the nouveau driver that is obviously silly:
+
+drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.c: In function 'nv40_perfctr_next':
+drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.c:62:19: warning: self-comparison always evaluats to false [-Wtautological-compare]
+ if (pm->sequence != pm->sequence) {
+
+The behavior was accidentally introduced in a patch described as "This is
+purely preparation for upcoming commits, there should be no code changes here.".
+As far as I can tell, that was true for the rest of that patch except for
+this one function, which has been changed to a NOP.
+
+This patch restores the original behavior.
+
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Fixes: 8c1aeaa13954 ("drm/nouveau/pm: cosmetic changes")
+Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.c
+@@ -59,9 +59,11 @@ static void
+ nv40_perfctr_next(struct nvkm_pm *pm, struct nvkm_perfdom *dom)
+ {
+ struct nvkm_device *device = pm->engine.subdev.device;
+- if (pm->sequence != pm->sequence) {
++ struct nv40_pm *nv40pm = container_of(pm, struct nv40_pm, base);
++
++ if (nv40pm->sequence != pm->sequence) {
+ nvkm_wr32(device, 0x400084, 0x00000020);
+- pm->sequence = pm->sequence;
++ nv40pm->sequence = pm->sequence;
+ }
+ }
+
crypto-echainiv-replace-chaining-with-multiplication.patch
ocfs2-dlm-fix-race-between-convert-and-migration.patch
ocfs2-fix-start-offset-to-ocfs2_zero_range_for_truncate.patch
+kbuild-do-not-run-modules_install-and-install-in-paralel.patch
+makefile-revert-makefile-document-ability-to-make-file.lst-and-file.s-partially.patch
+tools-support-relative-directory-path-for-o.patch
+kbuild-forbid-kernel-directory-to-contain-spaces-and-colons.patch
+kbuild-disable-maybe-uninitialized-warning-for-config_profile_all_branches.patch
+gcov-disable-wmaybe-uninitialized-warning.patch
+disable-maybe-uninitialized-warning-globally.patch
+disable-frame-address-warning.patch
+makefile-mute-warning-for-__builtin_return_address-0-for-tracing-only.patch
+net-caif-fix-misleading-indentation.patch
+add-braces-to-avoid-ambiguous-else-compiler-warnings.patch
+am437x-vfpe-fix-typo-in-vpfe_get_app_input_index.patch
+ath9k-fix-misleading-indentation.patch
+iwlegacy-avoid-warning-about-missing-braces.patch
+staging-iio-adc-fix-indent-on-break-statement.patch
+nouveau-fix-nv40_perfctr_next-cleanup-regression.patch
+megaraid-fix-null-pointer-check-in-megasas_detach_one.patch
--- /dev/null
+From b6acb0cfc21293a1bfc283e9217f58f7474ef728 Mon Sep 17 00:00:00 2001
+From: Colin Ian King <colin.king@canonical.com>
+Date: Sat, 23 Jan 2016 19:33:10 +0000
+Subject: Staging: iio: adc: fix indent on break statement
+
+From: Colin Ian King <colin.king@canonical.com>
+
+commit b6acb0cfc21293a1bfc283e9217f58f7474ef728 upstream.
+
+Fix indent warning when building with gcc 6:
+drivers/staging/iio/adc/ad7192.c:239:4: warning: statement is indented
+ as if it were guarded by... [-Wmisleading-indentation]
+
+Signed-off-by: Colin Ian King <colin.king@canonical.com>
+Signed-off-by: Jonathan Cameron <jic23@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/iio/adc/ad7192.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/staging/iio/adc/ad7192.c
++++ b/drivers/staging/iio/adc/ad7192.c
+@@ -236,7 +236,7 @@ static int ad7192_setup(struct ad7192_st
+ st->mclk = pdata->ext_clk_hz;
+ else
+ st->mclk = AD7192_INT_FREQ_MHZ;
+- break;
++ break;
+ default:
+ ret = -EINVAL;
+ goto out;
--- /dev/null
+From e17cf3a80d4ba0c4e40bf1a89deb1354c2e10e14 Mon Sep 17 00:00:00 2001
+From: Josh Poimboeuf <jpoimboe@redhat.com>
+Date: Thu, 3 Mar 2016 08:53:43 -0600
+Subject: tools: Support relative directory path for 'O='
+
+From: Josh Poimboeuf <jpoimboe@redhat.com>
+
+commit e17cf3a80d4ba0c4e40bf1a89deb1354c2e10e14 upstream.
+
+Running "make O=foo" (with a relative directory path) fails with:
+
+ scripts/Makefile.include:3: *** O=foo does not exist. Stop.
+ /home/jpoimboe/git/linux/Makefile:1547: recipe for target 'tools/objtool' failed
+
+The tools Makefile gets confused by the relative path and tries to build
+objtool in tools/foo. Convert the output directory to an absolute path
+before passing it to the tools Makefile.
+
+Reported-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Stephen Rothwell <sfr@canb.auug.org.au>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: linux-next@vger.kernel.org
+Cc: linux@roeck-us.net
+Cc: live-patching@vger.kernel.org
+Link: http://lkml.kernel.org/r/94a078c6c998fac9f01a14f574008bf7dff40191.1457016803.git.jpoimboe@redhat.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -1506,11 +1506,11 @@ image_name:
+ # Clear a bunch of variables before executing the submake
+ tools/: FORCE
+ $(Q)mkdir -p $(objtree)/tools
+- $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(O) subdir=tools -C $(src)/tools/
++ $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && /bin/pwd) subdir=tools -C $(src)/tools/
+
+ tools/%: FORCE
+ $(Q)mkdir -p $(objtree)/tools
+- $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(O) subdir=tools -C $(src)/tools/ $*
++ $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && /bin/pwd) subdir=tools -C $(src)/tools/ $*
+
+ # Single targets
+ # ---------------------------------------------------------------------------