From 538c737f8475a56eed0bb76f0a4dea70f2a514e3 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 5 Oct 2017 11:17:12 +0200 Subject: [PATCH] 4.9-stable patches added patches: alsa-au88x0-avoid-theoretical-uninitialized-access.patch arm-remove-duplicate-const-annotations.patch asoc-rt5514-fix-gcc-7-warning.patch asoc-rt5659-drop-double-const.patch asoc-rt5660-remove-double-const.patch ib-qib-fix-false-postive-maybe-uninitialized-warning.patch ttpci-address-stringop-overflow-warning.patch --- ...oid-theoretical-uninitialized-access.patch | 40 ++ ...m-remove-duplicate-const-annotations.patch | 113 ++++++ queue-4.9/asoc-rt5514-fix-gcc-7-warning.patch | 47 +++ queue-4.9/asoc-rt5659-drop-double-const.patch | 347 ++++++++++++++++++ .../asoc-rt5660-remove-double-const.patch | 36 ++ ...-postive-maybe-uninitialized-warning.patch | 39 ++ queue-4.9/series | 7 + ...ci-address-stringop-overflow-warning.patch | 115 ++++++ 8 files changed, 744 insertions(+) create mode 100644 queue-4.9/alsa-au88x0-avoid-theoretical-uninitialized-access.patch create mode 100644 queue-4.9/arm-remove-duplicate-const-annotations.patch create mode 100644 queue-4.9/asoc-rt5514-fix-gcc-7-warning.patch create mode 100644 queue-4.9/asoc-rt5659-drop-double-const.patch create mode 100644 queue-4.9/asoc-rt5660-remove-double-const.patch create mode 100644 queue-4.9/ib-qib-fix-false-postive-maybe-uninitialized-warning.patch create mode 100644 queue-4.9/ttpci-address-stringop-overflow-warning.patch diff --git a/queue-4.9/alsa-au88x0-avoid-theoretical-uninitialized-access.patch b/queue-4.9/alsa-au88x0-avoid-theoretical-uninitialized-access.patch new file mode 100644 index 00000000000..3012aa2383b --- /dev/null +++ b/queue-4.9/alsa-au88x0-avoid-theoretical-uninitialized-access.patch @@ -0,0 +1,40 @@ +From 13f99ebdd602ebdafb909e15ec6ffb1e34690167 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Thu, 23 Mar 2017 16:15:55 +0100 +Subject: ALSA: au88x0: avoid theoretical uninitialized access + +From: Arnd Bergmann + +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 +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + 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] = diff --git a/queue-4.9/arm-remove-duplicate-const-annotations.patch b/queue-4.9/arm-remove-duplicate-const-annotations.patch new file mode 100644 index 00000000000..9bf4e485fdc --- /dev/null +++ b/queue-4.9/arm-remove-duplicate-const-annotations.patch @@ -0,0 +1,113 @@ +From 0527873b29b077fc8e656acd63e1866b429fef55 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +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 + +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 +Acked-by: Tony Lindgren +Acked-by: Nicolas Pitre +Acked-by: Florian Fainelli +Acked-by: Viresh Kumar +Acked-by: Krzysztof Hałasa +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -335,7 +335,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 +@@ -713,7 +713,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", }, + { }, + }; diff --git a/queue-4.9/asoc-rt5514-fix-gcc-7-warning.patch b/queue-4.9/asoc-rt5514-fix-gcc-7-warning.patch new file mode 100644 index 00000000000..67ecdd4af84 --- /dev/null +++ b/queue-4.9/asoc-rt5514-fix-gcc-7-warning.patch @@ -0,0 +1,47 @@ +From 03ba791df98d15d07ea74075122af71e35c7611c Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Thu, 11 May 2017 13:44:38 +0200 +Subject: ASoC: rt5514: fix gcc-7 warning + +From: Arnd Bergmann + +commit 03ba791df98d15d07ea74075122af71e35c7611c upstream. + +gcc-7 warns that there is a duplicate 'const' specifier in some +variables that are declared using the SOC_ENUM_SINGLE_DECL macro: + +sound/soc/codecs/rt5514.c:398:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier] + static const SOC_ENUM_SINGLE_DECL( +sound/soc/codecs/rt5514.c:405:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier] + static const SOC_ENUM_SINGLE_DECL( + +This removes one to fix the warning. + +Fixes: 4a6180ea7399 ("ASoC: rt5514: add rt5514 codec driver") +Signed-off-by: Arnd Bergmann +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/codecs/rt5514.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/sound/soc/codecs/rt5514.c ++++ b/sound/soc/codecs/rt5514.c +@@ -395,14 +395,14 @@ static const char * const rt5514_dmic_sr + "DMIC1", "DMIC2" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5514_stereo1_dmic_enum, RT5514_DIG_SOURCE_CTRL, + RT5514_AD0_DMIC_INPUT_SEL_SFT, rt5514_dmic_src); + + static const struct snd_kcontrol_new rt5514_sto1_dmic_mux = + SOC_DAPM_ENUM("Stereo1 DMIC Source", rt5514_stereo1_dmic_enum); + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5514_stereo2_dmic_enum, RT5514_DIG_SOURCE_CTRL, + RT5514_AD1_DMIC_INPUT_SEL_SFT, rt5514_dmic_src); + diff --git a/queue-4.9/asoc-rt5659-drop-double-const.patch b/queue-4.9/asoc-rt5659-drop-double-const.patch new file mode 100644 index 00000000000..cc39de75832 --- /dev/null +++ b/queue-4.9/asoc-rt5659-drop-double-const.patch @@ -0,0 +1,347 @@ +From eae39b5f4269260d5d8b35133ba0f4c5e2895b71 Mon Sep 17 00:00:00 2001 +From: Nicholas Mc Guire +Date: Thu, 12 Jan 2017 14:15:03 +0100 +Subject: ASoC: rt5659: drop double const + +From: Nicholas Mc Guire + +commit eae39b5f4269260d5d8b35133ba0f4c5e2895b71 upstream. + +Drop the const qualifier as it is being added by SOC_ENUM_DOUBLE_DECL() +already which is called by SOC_ENUM_SINGLE_DECL() as well as the +double const by calls to SOC_VALUE_ENUM_SINGLE_DECL() via +SOC_VALUE_ENUM_DOUBLE_DECL). + +Fixes: commit d3cb2de2479b ("ASoC: rt5659: add rt5659 codec driver") +Signed-off-by: Nicholas Mc Guire +Signed-off-by: Mark Brown +Cc: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/codecs/rt5659.c | 86 +++++++++++++++++++++++----------------------- + 1 file changed, 43 insertions(+), 43 deletions(-) + +--- a/sound/soc/codecs/rt5659.c ++++ b/sound/soc/codecs/rt5659.c +@@ -1150,28 +1150,28 @@ static const char * const rt5659_data_se + "L/R", "R/L", "L/L", "R/R" + }; + +-static const SOC_ENUM_SINGLE_DECL(rt5659_if1_01_adc_enum, ++static SOC_ENUM_SINGLE_DECL(rt5659_if1_01_adc_enum, + RT5659_TDM_CTRL_2, RT5659_DS_ADC_SLOT01_SFT, rt5659_data_select); + +-static const SOC_ENUM_SINGLE_DECL(rt5659_if1_23_adc_enum, ++static SOC_ENUM_SINGLE_DECL(rt5659_if1_23_adc_enum, + RT5659_TDM_CTRL_2, RT5659_DS_ADC_SLOT23_SFT, rt5659_data_select); + +-static const SOC_ENUM_SINGLE_DECL(rt5659_if1_45_adc_enum, ++static SOC_ENUM_SINGLE_DECL(rt5659_if1_45_adc_enum, + RT5659_TDM_CTRL_2, RT5659_DS_ADC_SLOT45_SFT, rt5659_data_select); + +-static const SOC_ENUM_SINGLE_DECL(rt5659_if1_67_adc_enum, ++static SOC_ENUM_SINGLE_DECL(rt5659_if1_67_adc_enum, + RT5659_TDM_CTRL_2, RT5659_DS_ADC_SLOT67_SFT, rt5659_data_select); + +-static const SOC_ENUM_SINGLE_DECL(rt5659_if2_dac_enum, ++static SOC_ENUM_SINGLE_DECL(rt5659_if2_dac_enum, + RT5659_DIG_INF23_DATA, RT5659_IF2_DAC_SEL_SFT, rt5659_data_select); + +-static const SOC_ENUM_SINGLE_DECL(rt5659_if2_adc_enum, ++static SOC_ENUM_SINGLE_DECL(rt5659_if2_adc_enum, + RT5659_DIG_INF23_DATA, RT5659_IF2_ADC_SEL_SFT, rt5659_data_select); + +-static const SOC_ENUM_SINGLE_DECL(rt5659_if3_dac_enum, ++static SOC_ENUM_SINGLE_DECL(rt5659_if3_dac_enum, + RT5659_DIG_INF23_DATA, RT5659_IF3_DAC_SEL_SFT, rt5659_data_select); + +-static const SOC_ENUM_SINGLE_DECL(rt5659_if3_adc_enum, ++static SOC_ENUM_SINGLE_DECL(rt5659_if3_adc_enum, + RT5659_DIG_INF23_DATA, RT5659_IF3_ADC_SEL_SFT, rt5659_data_select); + + static const struct snd_kcontrol_new rt5659_if1_01_adc_swap_mux = +@@ -1207,31 +1207,31 @@ static unsigned int rt5659_asrc_clk_map_ + 0, 1, 2, 3, 5, 6, + }; + +-static const SOC_VALUE_ENUM_SINGLE_DECL( ++static SOC_VALUE_ENUM_SINGLE_DECL( + rt5659_da_sto_asrc_enum, RT5659_ASRC_2, RT5659_DA_STO_T_SFT, 0x7, + rt5659_asrc_clk_src, rt5659_asrc_clk_map_values); + +-static const SOC_VALUE_ENUM_SINGLE_DECL( ++static SOC_VALUE_ENUM_SINGLE_DECL( + rt5659_da_monol_asrc_enum, RT5659_ASRC_2, RT5659_DA_MONO_L_T_SFT, 0x7, + rt5659_asrc_clk_src, rt5659_asrc_clk_map_values); + +-static const SOC_VALUE_ENUM_SINGLE_DECL( ++static SOC_VALUE_ENUM_SINGLE_DECL( + rt5659_da_monor_asrc_enum, RT5659_ASRC_2, RT5659_DA_MONO_R_T_SFT, 0x7, + rt5659_asrc_clk_src, rt5659_asrc_clk_map_values); + +-static const SOC_VALUE_ENUM_SINGLE_DECL( ++static SOC_VALUE_ENUM_SINGLE_DECL( + rt5659_ad_sto1_asrc_enum, RT5659_ASRC_2, RT5659_AD_STO1_T_SFT, 0x7, + rt5659_asrc_clk_src, rt5659_asrc_clk_map_values); + +-static const SOC_VALUE_ENUM_SINGLE_DECL( ++static SOC_VALUE_ENUM_SINGLE_DECL( + rt5659_ad_sto2_asrc_enum, RT5659_ASRC_3, RT5659_AD_STO2_T_SFT, 0x7, + rt5659_asrc_clk_src, rt5659_asrc_clk_map_values); + +-static const SOC_VALUE_ENUM_SINGLE_DECL( ++static SOC_VALUE_ENUM_SINGLE_DECL( + rt5659_ad_monol_asrc_enum, RT5659_ASRC_3, RT5659_AD_MONO_L_T_SFT, 0x7, + rt5659_asrc_clk_src, rt5659_asrc_clk_map_values); + +-static const SOC_VALUE_ENUM_SINGLE_DECL( ++static SOC_VALUE_ENUM_SINGLE_DECL( + rt5659_ad_monor_asrc_enum, RT5659_ASRC_3, RT5659_AD_MONO_R_T_SFT, 0x7, + rt5659_asrc_clk_src, rt5659_asrc_clk_map_values); + +@@ -1930,14 +1930,14 @@ static const char * const rt5659_dac2_sr + "IF1 DAC2", "IF2 DAC", "IF3 DAC", "Mono ADC MIX" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_dac_l2_enum, RT5659_DAC_CTRL, + RT5659_DAC_L2_SEL_SFT, rt5659_dac2_src); + + static const struct snd_kcontrol_new rt5659_dac_l2_mux = + SOC_DAPM_ENUM("DAC L2 Source", rt5659_dac_l2_enum); + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_dac_r2_enum, RT5659_DAC_CTRL, + RT5659_DAC_R2_SEL_SFT, rt5659_dac2_src); + +@@ -1951,7 +1951,7 @@ static const char * const rt5659_sto1_ad + "DAC MIX", "ADC" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_sto1_adc1_enum, RT5659_STO1_ADC_MIXER, + RT5659_STO1_ADC1_SRC_SFT, rt5659_sto1_adc1_src); + +@@ -1964,7 +1964,7 @@ static const char * const rt5659_sto1_ad + "ADC1", "ADC2" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_sto1_adc_enum, RT5659_STO1_ADC_MIXER, + RT5659_STO1_ADC_SRC_SFT, rt5659_sto1_adc_src); + +@@ -1977,7 +1977,7 @@ static const char * const rt5659_sto1_ad + "DAC MIX", "DMIC" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_sto1_adc2_enum, RT5659_STO1_ADC_MIXER, + RT5659_STO1_ADC2_SRC_SFT, rt5659_sto1_adc2_src); + +@@ -1990,7 +1990,7 @@ static const char * const rt5659_sto1_dm + "DMIC1", "DMIC2" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_sto1_dmic_enum, RT5659_STO1_ADC_MIXER, + RT5659_STO1_DMIC_SRC_SFT, rt5659_sto1_dmic_src); + +@@ -2004,7 +2004,7 @@ static const char * const rt5659_mono_ad + "Mono DAC MIXL", "DMIC" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_mono_adc_l2_enum, RT5659_MONO_ADC_MIXER, + RT5659_MONO_ADC_L2_SRC_SFT, rt5659_mono_adc_l2_src); + +@@ -2018,7 +2018,7 @@ static const char * const rt5659_mono_ad + "Mono DAC MIXL", "ADC" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_mono_adc_l1_enum, RT5659_MONO_ADC_MIXER, + RT5659_MONO_ADC_L1_SRC_SFT, rt5659_mono_adc_l1_src); + +@@ -2031,14 +2031,14 @@ static const char * const rt5659_mono_ad + "ADC1 L", "ADC1 R", "ADC2 L", "ADC2 R" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_mono_adc_l_enum, RT5659_MONO_ADC_MIXER, + RT5659_MONO_ADC_L_SRC_SFT, rt5659_mono_adc_src); + + static const struct snd_kcontrol_new rt5659_mono_adc_l_mux = + SOC_DAPM_ENUM("Mono ADC L Source", rt5659_mono_adc_l_enum); + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_mono_adcr_enum, RT5659_MONO_ADC_MIXER, + RT5659_MONO_ADC_R_SRC_SFT, rt5659_mono_adc_src); + +@@ -2051,7 +2051,7 @@ static const char * const rt5659_mono_dm + "DMIC1 L", "DMIC2 L" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_mono_dmic_l_enum, RT5659_MONO_ADC_MIXER, + RT5659_MONO_DMIC_L_SRC_SFT, rt5659_mono_dmic_l_src); + +@@ -2064,7 +2064,7 @@ static const char * const rt5659_mono_ad + "Mono DAC MIXR", "DMIC" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_mono_adc_r2_enum, RT5659_MONO_ADC_MIXER, + RT5659_MONO_ADC_R2_SRC_SFT, rt5659_mono_adc_r2_src); + +@@ -2077,7 +2077,7 @@ static const char * const rt5659_mono_ad + "Mono DAC MIXR", "ADC" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_mono_adc_r1_enum, RT5659_MONO_ADC_MIXER, + RT5659_MONO_ADC_R1_SRC_SFT, rt5659_mono_adc_r1_src); + +@@ -2090,7 +2090,7 @@ static const char * const rt5659_mono_dm + "DMIC1 R", "DMIC2 R" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_mono_dmic_r_enum, RT5659_MONO_ADC_MIXER, + RT5659_MONO_DMIC_R_SRC_SFT, rt5659_mono_dmic_r_src); + +@@ -2104,14 +2104,14 @@ static const char * const rt5659_dac1_sr + "IF1 DAC1", "IF2 DAC", "IF3 DAC" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_dac_r1_enum, RT5659_AD_DA_MIXER, + RT5659_DAC1_R_SEL_SFT, rt5659_dac1_src); + + static const struct snd_kcontrol_new rt5659_dac_r1_mux = + SOC_DAPM_ENUM("DAC R1 Source", rt5659_dac_r1_enum); + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_dac_l1_enum, RT5659_AD_DA_MIXER, + RT5659_DAC1_L_SEL_SFT, rt5659_dac1_src); + +@@ -2124,14 +2124,14 @@ static const char * const rt5659_dig_dac + "Stereo DAC Mixer", "Mono DAC Mixer" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_dig_dac_mixl_enum, RT5659_DIG_MIXER, + RT5659_DAC_MIX_L_SFT, rt5659_dig_dac_mix_src); + + static const struct snd_kcontrol_new rt5659_dig_dac_mixl_mux = + SOC_DAPM_ENUM("DAC Digital Mixer L Source", rt5659_dig_dac_mixl_enum); + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_dig_dac_mixr_enum, RT5659_DIG_MIXER, + RT5659_DAC_MIX_R_SFT, rt5659_dig_dac_mix_src); + +@@ -2144,14 +2144,14 @@ static const char * const rt5659_alg_dac + "DAC", "Stereo DAC Mixer" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_alg_dac_l1_enum, RT5659_A_DAC_MUX, + RT5659_A_DACL1_SFT, rt5659_alg_dac1_src); + + static const struct snd_kcontrol_new rt5659_alg_dac_l1_mux = + SOC_DAPM_ENUM("Analog DACL1 Source", rt5659_alg_dac_l1_enum); + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_alg_dac_r1_enum, RT5659_A_DAC_MUX, + RT5659_A_DACR1_SFT, rt5659_alg_dac1_src); + +@@ -2164,14 +2164,14 @@ static const char * const rt5659_alg_dac + "Stereo DAC Mixer", "Mono DAC Mixer" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_alg_dac_l2_enum, RT5659_A_DAC_MUX, + RT5659_A_DACL2_SFT, rt5659_alg_dac2_src); + + static const struct snd_kcontrol_new rt5659_alg_dac_l2_mux = + SOC_DAPM_ENUM("Analog DAC L2 Source", rt5659_alg_dac_l2_enum); + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_alg_dac_r2_enum, RT5659_A_DAC_MUX, + RT5659_A_DACR2_SFT, rt5659_alg_dac2_src); + +@@ -2184,7 +2184,7 @@ static const char * const rt5659_if2_adc + "IF_ADC1", "IF_ADC2", "DAC_REF", "IF_ADC3" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_if2_adc_in_enum, RT5659_DIG_INF23_DATA, + RT5659_IF2_ADC_IN_SFT, rt5659_if2_adc_in_src); + +@@ -2197,7 +2197,7 @@ static const char * const rt5659_if3_adc + "IF_ADC1", "IF_ADC2", "DAC_REF", "Stereo2_ADC_L/R" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_if3_adc_in_enum, RT5659_DIG_INF23_DATA, + RT5659_IF3_ADC_IN_SFT, rt5659_if3_adc_in_src); + +@@ -2210,14 +2210,14 @@ static const char * const rt5659_pdm_src + "Mono DAC", "Stereo DAC" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_pdm_l_enum, RT5659_PDM_OUT_CTRL, + RT5659_PDM1_L_SFT, rt5659_pdm_src); + + static const struct snd_kcontrol_new rt5659_pdm_l_mux = + SOC_DAPM_ENUM("PDM L Source", rt5659_pdm_l_enum); + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_pdm_r_enum, RT5659_PDM_OUT_CTRL, + RT5659_PDM1_R_SFT, rt5659_pdm_src); + +@@ -2230,7 +2230,7 @@ static const char * const rt5659_spdif_s + "IF1_DAC1", "IF1_DAC2", "IF2_DAC", "IF3_DAC" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_spdif_enum, RT5659_SPDIF_CTRL, + RT5659_SPDIF_SEL_SFT, rt5659_spdif_src); + +@@ -2250,7 +2250,7 @@ static const char * const rt5659_rx_adc_ + "NUL:AD2:DAC:AD1", "NUL:DAC:DAC:AD2", "NUL:DAC:AD2:DAC" + }; + +-static const SOC_ENUM_SINGLE_DECL( ++static SOC_ENUM_SINGLE_DECL( + rt5659_rx_adc_data_enum, RT5659_TDM_CTRL_2, + RT5659_ADCDAT_SRC_SFT, rt5659_rx_adc_data_src); + diff --git a/queue-4.9/asoc-rt5660-remove-double-const.patch b/queue-4.9/asoc-rt5660-remove-double-const.patch new file mode 100644 index 00000000000..3593d851727 --- /dev/null +++ b/queue-4.9/asoc-rt5660-remove-double-const.patch @@ -0,0 +1,36 @@ +From 4281fcc02ed9f902dfa52d3635ac7f04b1a7341f Mon Sep 17 00:00:00 2001 +From: Nicholas Mc Guire +Date: Thu, 12 Jan 2017 11:48:11 +0100 +Subject: ASoC: rt5660: remove double const + +From: Nicholas Mc Guire + +commit 4281fcc02ed9f902dfa52d3635ac7f04b1a7341f upstream. + +Drop the const qualifier as it is being added by SOC_ENUM_DOUBLE_DECL() +already which is called by SOC_ENUM_SINGLE_DECL() here. + +Fixes: commit 2b26dd4c1fc5 ("ASoC: rt5660: add rt5660 codec driver") +Signed-off-by: Nicholas Mc Guire +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/codecs/rt5660.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/sound/soc/codecs/rt5660.c ++++ b/sound/soc/codecs/rt5660.c +@@ -526,10 +526,10 @@ static const char * const rt5660_data_se + "L/R", "R/L", "L/L", "R/R" + }; + +-static const SOC_ENUM_SINGLE_DECL(rt5660_if1_dac_enum, ++static SOC_ENUM_SINGLE_DECL(rt5660_if1_dac_enum, + RT5660_DIG_INF1_DATA, RT5660_IF1_DAC_IN_SFT, rt5660_data_select); + +-static const SOC_ENUM_SINGLE_DECL(rt5660_if1_adc_enum, ++static SOC_ENUM_SINGLE_DECL(rt5660_if1_adc_enum, + RT5660_DIG_INF1_DATA, RT5660_IF1_ADC_IN_SFT, rt5660_data_select); + + static const struct snd_kcontrol_new rt5660_if1_dac_swap_mux = diff --git a/queue-4.9/ib-qib-fix-false-postive-maybe-uninitialized-warning.patch b/queue-4.9/ib-qib-fix-false-postive-maybe-uninitialized-warning.patch new file mode 100644 index 00000000000..fd993e41f5f --- /dev/null +++ b/queue-4.9/ib-qib-fix-false-postive-maybe-uninitialized-warning.patch @@ -0,0 +1,39 @@ +From f6aafac184a3e46e919769dd4faa8bf0dc436534 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Tue, 14 Mar 2017 13:18:45 +0100 +Subject: IB/qib: fix false-postive maybe-uninitialized warning + +From: Arnd Bergmann + +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 +Acked-by: Ira Weiny +Signed-off-by: Doug Ledford +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -7080,7 +7080,7 @@ static void qib_7322_txchk_change(struct + unsigned long flags; + + while (wait) { +- unsigned long shadow; ++ unsigned long shadow = 0; + int cstart, previ = -1; + + /* diff --git a/queue-4.9/series b/queue-4.9/series index 3e537f6fce5..4b12688ed84 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -94,3 +94,10 @@ asoc-wm_adsp-return-an-error-on-write-to-a-disabled-volatile-control.patch libata-transport-remove-circular-dependency-at-free-time.patch arm-dts-bcm5301x-fix-memory-start-address.patch tools-power-turbostat-bugfix-gfxmhz-column-not-changing.patch +ib-qib-fix-false-postive-maybe-uninitialized-warning.patch +arm-remove-duplicate-const-annotations.patch +asoc-rt5514-fix-gcc-7-warning.patch +asoc-rt5659-drop-double-const.patch +asoc-rt5660-remove-double-const.patch +alsa-au88x0-avoid-theoretical-uninitialized-access.patch +ttpci-address-stringop-overflow-warning.patch diff --git a/queue-4.9/ttpci-address-stringop-overflow-warning.patch b/queue-4.9/ttpci-address-stringop-overflow-warning.patch new file mode 100644 index 00000000000..07a08588a50 --- /dev/null +++ b/queue-4.9/ttpci-address-stringop-overflow-warning.patch @@ -0,0 +1,115 @@ +From 69d3973af1acd4c0989ec8218c05f12d303cd7cf Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Thu, 2 Feb 2017 12:51:28 -0200 +Subject: [media] ttpci: address stringop overflow warning + +From: Arnd Bergmann + +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 +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman + +--- + 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 */ + + 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; -- 2.47.3