--- /dev/null
+From 13f99ebdd602ebdafb909e15ec6ffb1e34690167 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Thu, 23 Mar 2017 16:15:55 +0100
+Subject: ALSA: au88x0: avoid theoretical uninitialized access
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 13f99ebdd602ebdafb909e15ec6ffb1e34690167 upstream.
+
+The latest gcc-7.0.1 snapshot points out that we if nr_ch is zero, we never
+initialize some variables:
+
+sound/pci/au88x0/au88x0_core.c: In function 'vortex_adb_allocroute':
+sound/pci/au88x0/au88x0_core.c:2304:68: error: 'mix[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+sound/pci/au88x0/au88x0_core.c:2305:58: error: 'src[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+
+I assume this can never happen in practice, but adding a check here doesn't
+hurt either and avoids the warning. The code has been unchanged since
+the start of git history.
+
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/au88x0/au88x0_core.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/sound/pci/au88x0/au88x0_core.c
++++ b/sound/pci/au88x0/au88x0_core.c
+@@ -2279,6 +2279,9 @@ vortex_adb_allocroute(vortex_t *vortex,
+ } else {
+ int src[2], mix[2];
+
++ if (nr_ch < 1)
++ return -EINVAL;
++
+ /* Get SRC and MIXER hardware resources. */
+ for (i = 0; i < nr_ch; i++) {
+ if ((mix[i] =
--- /dev/null
+From 0527873b29b077fc8e656acd63e1866b429fef55 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Thu, 11 May 2017 13:50:16 +0200
+Subject: ARM: remove duplicate 'const' annotations'
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 0527873b29b077fc8e656acd63e1866b429fef55 upstream.
+
+gcc-7 warns about some declarations that are more 'const' than necessary:
+
+arch/arm/mach-at91/pm.c:338:34: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
+ static const struct of_device_id const ramc_ids[] __initconst = {
+arch/arm/mach-bcm/bcm_kona_smc.c:36:34: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
+ static const struct of_device_id const bcm_kona_smc_ids[] __initconst = {
+arch/arm/mach-spear/time.c:207:34: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
+ static const struct of_device_id const timer_of_match[] __initconst = {
+arch/arm/mach-omap2/prm_common.c:714:34: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
+ static const struct of_device_id const omap_prcm_dt_match_table[] __initconst = {
+arch/arm/mach-omap2/vc.c:562:35: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
+ static const struct i2c_init_data const omap4_i2c_timing_data[] __initconst = {
+
+The ones in arch/arm were apparently all introduced accidentally by one
+commit that correctly marked a lot of variables as __initconst.
+
+Fixes: 19c233b79d1a ("ARM: appropriate __init annotation for const data")
+Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
+Acked-by: Tony Lindgren <tony@atomide.com>
+Acked-by: Nicolas Pitre <nico@linaro.org>
+Acked-by: Florian Fainelli <f.fainelli@gmail.com>
+Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
+Acked-by: Krzysztof HaĆasa <khalasa@piap.pl>
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/mach-at91/pm.c | 2 +-
+ arch/arm/mach-bcm/bcm_kona_smc.c | 2 +-
+ arch/arm/mach-cns3xxx/core.c | 2 +-
+ arch/arm/mach-omap2/prm_common.c | 2 +-
+ arch/arm/mach-omap2/vc.c | 2 +-
+ arch/arm/mach-spear/time.c | 2 +-
+ 6 files changed, 6 insertions(+), 6 deletions(-)
+
+--- a/arch/arm/mach-at91/pm.c
++++ b/arch/arm/mach-at91/pm.c
+@@ -332,7 +332,7 @@ static void at91sam9_sdram_standby(void)
+ at91_ramc_write(1, AT91_SDRAMC_LPR, saved_lpr1);
+ }
+
+-static const struct of_device_id const ramc_ids[] __initconst = {
++static const struct of_device_id ramc_ids[] __initconst = {
+ { .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby },
+ { .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby },
+ { .compatible = "atmel,at91sam9g45-ddramc", .data = at91_ddr_standby },
+--- a/arch/arm/mach-bcm/bcm_kona_smc.c
++++ b/arch/arm/mach-bcm/bcm_kona_smc.c
+@@ -33,7 +33,7 @@ struct bcm_kona_smc_data {
+ unsigned result;
+ };
+
+-static const struct of_device_id const bcm_kona_smc_ids[] __initconst = {
++static const struct of_device_id bcm_kona_smc_ids[] __initconst = {
+ {.compatible = "brcm,kona-smc"},
+ {.compatible = "bcm,kona-smc"}, /* deprecated name */
+ {},
+--- a/arch/arm/mach-cns3xxx/core.c
++++ b/arch/arm/mach-cns3xxx/core.c
+@@ -346,7 +346,7 @@ static struct usb_ohci_pdata cns3xxx_usb
+ .power_off = csn3xxx_usb_power_off,
+ };
+
+-static const struct of_dev_auxdata const cns3xxx_auxdata[] __initconst = {
++static const struct of_dev_auxdata cns3xxx_auxdata[] __initconst = {
+ { "intel,usb-ehci", CNS3XXX_USB_BASE, "ehci-platform", &cns3xxx_usb_ehci_pdata },
+ { "intel,usb-ohci", CNS3XXX_USB_OHCI_BASE, "ohci-platform", &cns3xxx_usb_ohci_pdata },
+ { "cavium,cns3420-ahci", CNS3XXX_SATA2_BASE, "ahci", NULL },
+--- a/arch/arm/mach-omap2/prm_common.c
++++ b/arch/arm/mach-omap2/prm_common.c
+@@ -706,7 +706,7 @@ static struct omap_prcm_init_data scrm_d
+ };
+ #endif
+
+-static const struct of_device_id const omap_prcm_dt_match_table[] __initconst = {
++static const struct of_device_id omap_prcm_dt_match_table[] __initconst = {
+ #ifdef CONFIG_SOC_AM33XX
+ { .compatible = "ti,am3-prcm", .data = &am3_prm_data },
+ #endif
+--- a/arch/arm/mach-omap2/vc.c
++++ b/arch/arm/mach-omap2/vc.c
+@@ -559,7 +559,7 @@ struct i2c_init_data {
+ u8 hsscll_12;
+ };
+
+-static const struct i2c_init_data const omap4_i2c_timing_data[] __initconst = {
++static const struct i2c_init_data omap4_i2c_timing_data[] __initconst = {
+ {
+ .load = 50,
+ .loadbits = 0x3,
+--- a/arch/arm/mach-spear/time.c
++++ b/arch/arm/mach-spear/time.c
+@@ -204,7 +204,7 @@ static void __init spear_clockevent_init
+ setup_irq(irq, &spear_timer_irq);
+ }
+
+-static const struct of_device_id const timer_of_match[] __initconst = {
++static const struct of_device_id timer_of_match[] __initconst = {
+ { .compatible = "st,spear-timer", },
+ { },
+ };
--- /dev/null
+From 1d2d8de44a6c20af262b4c3d3b93ef7ec3c5488e Mon Sep 17 00:00:00 2001
+From: Jisheng Zhang <jszhang@marvell.com>
+Date: Wed, 20 Apr 2016 11:20:27 +0100
+Subject: drivers: firmware: psci: drop duplicate const from psci_of_match
+
+From: Jisheng Zhang <jszhang@marvell.com>
+
+commit 1d2d8de44a6c20af262b4c3d3b93ef7ec3c5488e upstream.
+
+This is to fix below sparse warning:
+drivers/firmware/psci.c:mmm:nn: warning: duplicate const
+
+Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
+Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/firmware/psci.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/firmware/psci.c
++++ b/drivers/firmware/psci.c
+@@ -424,7 +424,7 @@ out_put_node:
+ return err;
+ }
+
+-static const struct of_device_id const psci_of_match[] __initconst = {
++static const struct of_device_id psci_of_match[] __initconst = {
+ { .compatible = "arm,psci", .data = psci_0_1_init},
+ { .compatible = "arm,psci-0.2", .data = psci_0_2_init},
+ { .compatible = "arm,psci-1.0", .data = psci_0_2_init},
--- /dev/null
+From f6aafac184a3e46e919769dd4faa8bf0dc436534 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Tue, 14 Mar 2017 13:18:45 +0100
+Subject: IB/qib: fix false-postive maybe-uninitialized warning
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit f6aafac184a3e46e919769dd4faa8bf0dc436534 upstream.
+
+aarch64-linux-gcc-7 complains about code it doesn't fully understand:
+
+drivers/infiniband/hw/qib/qib_iba7322.c: In function 'qib_7322_txchk_change':
+include/asm-generic/bitops/non-atomic.h:105:35: error: 'shadow' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+
+The code is right, and despite trying hard, I could not come up with a version
+that I liked better than just adding a fake initialization here to shut up the
+warning.
+
+Fixes: f931551bafe1 ("IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters")
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Acked-by: Ira Weiny <ira.weiny@intel.com>
+Signed-off-by: Doug Ledford <dledford@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/infiniband/hw/qib/qib_iba7322.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/infiniband/hw/qib/qib_iba7322.c
++++ b/drivers/infiniband/hw/qib/qib_iba7322.c
+@@ -7097,7 +7097,7 @@ static void qib_7322_txchk_change(struct
+ unsigned long flags;
+
+ while (wait) {
+- unsigned long shadow;
++ unsigned long shadow = 0;
+ int cstart, previ = -1;
+
+ /*
i2c-meson-fix-wrong-variable-usage-in-meson_i2c_put_data.patch
xfs-remove-kmem_zalloc_greedy.patch
libata-transport-remove-circular-dependency-at-free-time.patch
+drivers-firmware-psci-drop-duplicate-const-from-psci_of_match.patch
+ib-qib-fix-false-postive-maybe-uninitialized-warning.patch
+arm-remove-duplicate-const-annotations.patch
+alsa-au88x0-avoid-theoretical-uninitialized-access.patch
+ttpci-address-stringop-overflow-warning.patch
--- /dev/null
+From 69d3973af1acd4c0989ec8218c05f12d303cd7cf Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Thu, 2 Feb 2017 12:51:28 -0200
+Subject: [media] ttpci: address stringop overflow warning
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 69d3973af1acd4c0989ec8218c05f12d303cd7cf upstream.
+
+gcc-7.0.1 warns about old code in ttpci:
+
+In file included from drivers/media/pci/ttpci/av7110.c:63:0:
+In function 'irdebi.isra.2',
+ inlined from 'start_debi_dma' at drivers/media/pci/ttpci/av7110.c:376:3,
+ inlined from 'gpioirq' at drivers/media/pci/ttpci/av7110.c:659:3:
+drivers/media/pci/ttpci/av7110_hw.h:406:3: warning: 'memcpy': specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
+ memcpy(av7110->debi_virt, (char *) &res, count);
+In function 'irdebi.isra.2',
+ inlined from 'start_debi_dma' at drivers/media/pci/ttpci/av7110.c:376:3,
+ inlined from 'gpioirq' at drivers/media/pci/ttpci/av7110.c:668:3:
+drivers/media/pci/ttpci/av7110_hw.h:406:3: warning: 'memcpy': specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
+ memcpy(av7110->debi_virt, (char *) &res, count);
+
+Apparently, 'count' can be negative here, which will then get turned
+into a giant size argument for memcpy. Changing the sizes to 'unsigned
+int' instead seems safe as we already check for maximum sizes, and it
+also simplifies the code a bit.
+
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/media/pci/ttpci/av7110_hw.c | 8 ++++----
+ drivers/media/pci/ttpci/av7110_hw.h | 12 ++++++------
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+--- a/drivers/media/pci/ttpci/av7110_hw.c
++++ b/drivers/media/pci/ttpci/av7110_hw.c
+@@ -56,11 +56,11 @@
+ by Nathan Laredo <laredo@gnu.org> */
+
+ int av7110_debiwrite(struct av7110 *av7110, u32 config,
+- int addr, u32 val, int count)
++ int addr, u32 val, unsigned int count)
+ {
+ struct saa7146_dev *dev = av7110->dev;
+
+- if (count <= 0 || count > 32764) {
++ if (count > 32764) {
+ printk("%s: invalid count %d\n", __func__, count);
+ return -1;
+ }
+@@ -78,12 +78,12 @@ int av7110_debiwrite(struct av7110 *av71
+ return 0;
+ }
+
+-u32 av7110_debiread(struct av7110 *av7110, u32 config, int addr, int count)
++u32 av7110_debiread(struct av7110 *av7110, u32 config, int addr, unsigned int count)
+ {
+ struct saa7146_dev *dev = av7110->dev;
+ u32 result = 0;
+
+- if (count > 32764 || count <= 0) {
++ if (count > 32764) {
+ printk("%s: invalid count %d\n", __func__, count);
+ return 0;
+ }
+--- a/drivers/media/pci/ttpci/av7110_hw.h
++++ b/drivers/media/pci/ttpci/av7110_hw.h
+@@ -377,14 +377,14 @@ extern int av7110_fw_request(struct av71
+
+ /* DEBI (saa7146 data extension bus interface) access */
+ extern int av7110_debiwrite(struct av7110 *av7110, u32 config,
+- int addr, u32 val, int count);
++ int addr, u32 val, unsigned int count);
+ extern u32 av7110_debiread(struct av7110 *av7110, u32 config,
+- int addr, int count);
++ int addr, unsigned int count);
+
+
+ /* DEBI during interrupt */
+ /* single word writes */
+-static inline void iwdebi(struct av7110 *av7110, u32 config, int addr, u32 val, int count)
++static inline void iwdebi(struct av7110 *av7110, u32 config, int addr, u32 val, unsigned int count)
+ {
+ av7110_debiwrite(av7110, config, addr, val, count);
+ }
+@@ -397,7 +397,7 @@ static inline void mwdebi(struct av7110
+ av7110_debiwrite(av7110, config, addr, 0, count);
+ }
+
+-static inline u32 irdebi(struct av7110 *av7110, u32 config, int addr, u32 val, int count)
++static inline u32 irdebi(struct av7110 *av7110, u32 config, int addr, u32 val, unsigned int count)
+ {
+ u32 res;
+
+@@ -408,7 +408,7 @@ static inline u32 irdebi(struct av7110 *
+ }
+
+ /* DEBI outside interrupts, only for count <= 4! */
+-static inline void wdebi(struct av7110 *av7110, u32 config, int addr, u32 val, int count)
++static inline void wdebi(struct av7110 *av7110, u32 config, int addr, u32 val, unsigned int count)
+ {
+ unsigned long flags;
+
+@@ -417,7 +417,7 @@ static inline void wdebi(struct av7110 *
+ spin_unlock_irqrestore(&av7110->debilock, flags);
+ }
+
+-static inline u32 rdebi(struct av7110 *av7110, u32 config, int addr, u32 val, int count)
++static inline u32 rdebi(struct av7110 *av7110, u32 config, int addr, u32 val, unsigned int count)
+ {
+ unsigned long flags;
+ u32 res;