From 6bed3b6a46893f497e25f2447730f4a7256c2d4f Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 5 Jun 2023 21:08:55 +0200 Subject: [PATCH] 4.14-stable patches added patches: lib-dynamic_debug.c-use-address-of-operator-on-section-symbols.patch regulator-da905-2-5-remove-unnecessary-array-check.patch wifi-rtlwifi-remove-always-true-condition-pointed-out-by-gcc-12.patch --- ...dress-of-operator-on-section-symbols.patch | 45 ++++++++++++++++ ...5-2-5-remove-unnecessary-array-check.patch | 54 +++++++++++++++++++ queue-4.14/series | 3 ++ ...true-condition-pointed-out-by-gcc-12.patch | 37 +++++++++++++ 4 files changed, 139 insertions(+) create mode 100644 queue-4.14/lib-dynamic_debug.c-use-address-of-operator-on-section-symbols.patch create mode 100644 queue-4.14/regulator-da905-2-5-remove-unnecessary-array-check.patch create mode 100644 queue-4.14/wifi-rtlwifi-remove-always-true-condition-pointed-out-by-gcc-12.patch diff --git a/queue-4.14/lib-dynamic_debug.c-use-address-of-operator-on-section-symbols.patch b/queue-4.14/lib-dynamic_debug.c-use-address-of-operator-on-section-symbols.patch new file mode 100644 index 00000000000..114a47064d4 --- /dev/null +++ b/queue-4.14/lib-dynamic_debug.c-use-address-of-operator-on-section-symbols.patch @@ -0,0 +1,45 @@ +From 8306b057a85ec07482da5d4b99d5c0b47af69be1 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Mon, 6 Apr 2020 20:10:45 -0700 +Subject: lib/dynamic_debug.c: use address-of operator on section symbols + +From: Nathan Chancellor + +commit 8306b057a85ec07482da5d4b99d5c0b47af69be1 upstream. + +Clang warns: + +../lib/dynamic_debug.c:1034:24: warning: array comparison always +evaluates to false [-Wtautological-compare] + if (__start___verbose == __stop___verbose) { + ^ +1 warning generated. + +These are not true arrays, they are linker defined symbols, which are just +addresses. Using the address of operator silences the warning and does +not change the resulting assembly with either clang/ld.lld or gcc/ld +(tested with diff + objdump -Dr). + +Suggested-by: Nick Desaulniers +Signed-off-by: Nathan Chancellor +Signed-off-by: Andrew Morton +Acked-by: Jason Baron +Link: https://github.com/ClangBuiltLinux/linux/issues/894 +Link: http://lkml.kernel.org/r/20200220051320.10739-1-natechancellor@gmail.com +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + lib/dynamic_debug.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/lib/dynamic_debug.c ++++ b/lib/dynamic_debug.c +@@ -984,7 +984,7 @@ static int __init dynamic_debug_init(voi + int n = 0, entries = 0, modct = 0; + int verbose_bytes = 0; + +- if (__start___verbose == __stop___verbose) { ++ if (&__start___verbose == &__stop___verbose) { + pr_warn("_ddebug table is empty in a CONFIG_DYNAMIC_DEBUG build\n"); + return 1; + } diff --git a/queue-4.14/regulator-da905-2-5-remove-unnecessary-array-check.patch b/queue-4.14/regulator-da905-2-5-remove-unnecessary-array-check.patch new file mode 100644 index 00000000000..ed7d70793b6 --- /dev/null +++ b/queue-4.14/regulator-da905-2-5-remove-unnecessary-array-check.patch @@ -0,0 +1,54 @@ +From 5a7d7d0f9f791b1e13f26dbbb07c86482912ad62 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Thu, 20 Sep 2018 17:04:20 -0700 +Subject: regulator: da905{2,5}: Remove unnecessary array check + +From: Nathan Chancellor + +commit 5a7d7d0f9f791b1e13f26dbbb07c86482912ad62 upstream. + +Clang warns that the address of a pointer will always evaluated as true +in a boolean context: + +drivers/regulator/da9052-regulator.c:423:22: warning: address of array +'pdata->regulators' will always evaluate to 'true' +[-Wpointer-bool-conversion] + if (pdata && pdata->regulators) { + ~~ ~~~~~~~^~~~~~~~~~ +drivers/regulator/da9055-regulator.c:615:22: warning: address of array +'pdata->regulators' will always evaluate to 'true' +[-Wpointer-bool-conversion] + if (pdata && pdata->regulators) { + ~~ ~~~~~~~^~~~~~~~~~ + +Link: https://github.com/ClangBuiltLinux/linux/issues/142 +Signed-off-by: Nathan Chancellor +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + drivers/regulator/da9052-regulator.c | 2 +- + drivers/regulator/da9055-regulator.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/regulator/da9052-regulator.c ++++ b/drivers/regulator/da9052-regulator.c +@@ -421,7 +421,7 @@ static int da9052_regulator_probe(struct + config.dev = &pdev->dev; + config.driver_data = regulator; + config.regmap = da9052->regmap; +- if (pdata && pdata->regulators) { ++ if (pdata) { + config.init_data = pdata->regulators[cell->id]; + } else { + #ifdef CONFIG_OF +--- a/drivers/regulator/da9055-regulator.c ++++ b/drivers/regulator/da9055-regulator.c +@@ -612,7 +612,7 @@ static int da9055_regulator_probe(struct + config.driver_data = regulator; + config.regmap = da9055->regmap; + +- if (pdata && pdata->regulators) { ++ if (pdata) { + config.init_data = pdata->regulators[pdev->id]; + } else { + ret = da9055_regulator_dt_init(pdev, regulator, &config, diff --git a/queue-4.14/series b/queue-4.14/series index 9384506dcb5..8725801aba4 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -44,3 +44,6 @@ acpi-thermal-drop-an-always-true-check.patch gcc-12-disable-wdangling-pointer-warning-for-now.patch eth-sun-cassini-remove-dead-code.patch kernel-extable.c-use-address-of-operator-on-section-symbols.patch +lib-dynamic_debug.c-use-address-of-operator-on-section-symbols.patch +wifi-rtlwifi-remove-always-true-condition-pointed-out-by-gcc-12.patch +regulator-da905-2-5-remove-unnecessary-array-check.patch diff --git a/queue-4.14/wifi-rtlwifi-remove-always-true-condition-pointed-out-by-gcc-12.patch b/queue-4.14/wifi-rtlwifi-remove-always-true-condition-pointed-out-by-gcc-12.patch new file mode 100644 index 00000000000..d8e676bcbca --- /dev/null +++ b/queue-4.14/wifi-rtlwifi-remove-always-true-condition-pointed-out-by-gcc-12.patch @@ -0,0 +1,37 @@ +From ee3db469dd317e82f57b13aa3bc61be5cb60c2b4 Mon Sep 17 00:00:00 2001 +From: Jakub Kicinski +Date: Fri, 20 May 2022 12:43:15 -0700 +Subject: wifi: rtlwifi: remove always-true condition pointed out by GCC 12 + +From: Jakub Kicinski + +commit ee3db469dd317e82f57b13aa3bc61be5cb60c2b4 upstream. + +The .value is a two-dim array, not a pointer. + +struct iqk_matrix_regs { + bool iqk_done; + long value[1][IQK_MATRIX_REG_NUM]; +}; + +Acked-by: Kalle Valo +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c ++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c +@@ -2414,10 +2414,7 @@ void rtl92d_phy_reload_iqk_setting(struc + RT_TRACE(rtlpriv, COMP_SCAN, DBG_LOUD, + "Just Read IQK Matrix reg for channel:%d....\n", + channel); +- if ((rtlphy->iqk_matrix[indexforchannel]. +- value[0] != NULL) +- /*&&(regea4 != 0) */) +- _rtl92d_phy_patha_fill_iqk_matrix(hw, true, ++ _rtl92d_phy_patha_fill_iqk_matrix(hw, true, + rtlphy->iqk_matrix[ + indexforchannel].value, 0, + (rtlphy->iqk_matrix[ -- 2.47.3