From: Greg Kroah-Hartman Date: Mon, 5 Jun 2023 19:09:05 +0000 (+0200) Subject: 4.19-stable patches X-Git-Tag: v4.14.317~52 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8e08b2206bb5e4f0615cf23d435675c65bcc3e78;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: hwmon-scmi-remove-redundant-pointer-check.patch lib-dynamic_debug.c-use-address-of-operator-on-section-symbols.patch regulator-da905-2-5-remove-unnecessary-array-check.patch rsi-remove-unnecessary-boolean-condition.patch wifi-rtlwifi-remove-always-true-condition-pointed-out-by-gcc-12.patch --- diff --git a/queue-4.19/hwmon-scmi-remove-redundant-pointer-check.patch b/queue-4.19/hwmon-scmi-remove-redundant-pointer-check.patch new file mode 100644 index 00000000000..d28c9c04f49 --- /dev/null +++ b/queue-4.19/hwmon-scmi-remove-redundant-pointer-check.patch @@ -0,0 +1,43 @@ +From a31796c30e423f58d266df30a9bbf321fc071b30 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Sat, 15 Sep 2018 17:05:07 -0700 +Subject: hwmon: (scmi) Remove redundant pointer check + +From: Nathan Chancellor + +commit a31796c30e423f58d266df30a9bbf321fc071b30 upstream. + +Clang warns when the address of a pointer is used in a boolean context +as it will always return true. + +drivers/hwmon/scmi-hwmon.c:59:24: warning: address of array +'sensor->name' will always evaluate to 'true' +[-Wpointer-bool-conversion] + if (sensor && sensor->name) + ~~ ~~~~~~~~^~~~ +1 warning generated. + +Remove the check as it isn't doing anything currently; if validation +of the contents of the data structure was intended by the original +author (since this line has been present from the first version of +this driver), it can be added in a follow-up patch. + +Reported-by: Nick Desaulniers +Signed-off-by: Nathan Chancellor +Signed-off-by: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hwmon/scmi-hwmon.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/hwmon/scmi-hwmon.c ++++ b/drivers/hwmon/scmi-hwmon.c +@@ -56,7 +56,7 @@ scmi_hwmon_is_visible(const void *drvdat + const struct scmi_sensors *scmi_sensors = drvdata; + + sensor = *(scmi_sensors->info[type] + channel); +- if (sensor && sensor->name) ++ if (sensor) + return S_IRUGO; + + return 0; diff --git a/queue-4.19/lib-dynamic_debug.c-use-address-of-operator-on-section-symbols.patch b/queue-4.19/lib-dynamic_debug.c-use-address-of-operator-on-section-symbols.patch new file mode 100644 index 00000000000..114a47064d4 --- /dev/null +++ b/queue-4.19/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.19/regulator-da905-2-5-remove-unnecessary-array-check.patch b/queue-4.19/regulator-da905-2-5-remove-unnecessary-array-check.patch new file mode 100644 index 00000000000..ed7d70793b6 --- /dev/null +++ b/queue-4.19/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.19/rsi-remove-unnecessary-boolean-condition.patch b/queue-4.19/rsi-remove-unnecessary-boolean-condition.patch new file mode 100644 index 00000000000..a267f70b27e --- /dev/null +++ b/queue-4.19/rsi-remove-unnecessary-boolean-condition.patch @@ -0,0 +1,38 @@ +From f613e4803dd6d1f41a86f6406d4c994fa3d387a0 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Fri, 21 Sep 2018 02:48:29 -0700 +Subject: rsi: Remove unnecessary boolean condition + +From: Nathan Chancellor + +commit f613e4803dd6d1f41a86f6406d4c994fa3d387a0 upstream. + +Clang warns that the address of a pointer will always evaluated as true +in a boolean context. + +drivers/net/wireless/rsi/rsi_91x_mac80211.c:927:50: warning: address of +array 'key->key' will always evaluate to 'true' +[-Wpointer-bool-conversion] + if (vif->type == NL80211_IFTYPE_STATION && key->key && + ~~ ~~~~~^~~ +1 warning generated. + +Link: https://github.com/ClangBuiltLinux/linux/issues/136 +Signed-off-by: Nathan Chancellor +Signed-off-by: Kalle Valo +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/wireless/rsi/rsi_91x_mac80211.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c ++++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c +@@ -924,7 +924,7 @@ static int rsi_hal_key_config(struct iee + if (status) + return status; + +- if (vif->type == NL80211_IFTYPE_STATION && key->key && ++ if (vif->type == NL80211_IFTYPE_STATION && + (key->cipher == WLAN_CIPHER_SUITE_WEP104 || + key->cipher == WLAN_CIPHER_SUITE_WEP40)) { + if (!rsi_send_block_unblock_frame(adapter->priv, false)) diff --git a/queue-4.19/series b/queue-4.19/series index 5e58b090c93..38de1b1cc34 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -72,3 +72,8 @@ 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 +hwmon-scmi-remove-redundant-pointer-check.patch +regulator-da905-2-5-remove-unnecessary-array-check.patch +rsi-remove-unnecessary-boolean-condition.patch diff --git a/queue-4.19/wifi-rtlwifi-remove-always-true-condition-pointed-out-by-gcc-12.patch b/queue-4.19/wifi-rtlwifi-remove-always-true-condition-pointed-out-by-gcc-12.patch new file mode 100644 index 00000000000..d8e676bcbca --- /dev/null +++ b/queue-4.19/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[