Skip to contentSkip to conversation

Revert "cpufreq: brcmstb-avs-cpufreq: Fix initial command check"

PATCH Applied Colin Ian King 3 participants 3 messages Oct 29, 2024 – Oct 30, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "cpufreq: brcmstb-avs-cpufreq: Fix initial command check"

Currently the condition ((rc != -ENOTSUPP) || (rc != -EINVAL)) is always true because rc cannot be equal to two different values at the same time, so it must be not equal to at least one of them. Fix the original commit that introduced the issue.

This reverts commit 22a26cc6a51ef73dcfeb64c50513903f6b2d53d8.

---
 drivers/cpufreq/brcmstb-avs-cpufreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/cpufreq/brcmstb-avs-cpufreq.c +2 -2
index 5d03a295a085..2fd0f6be6fa3 100644
@@ -474,8 +474,8 @@ static bool brcm_avs_is_firmware_loaded(struct private_data *priv)
 	rc = brcm_avs_get_pmap(priv, NULL);
 	magic = readl(priv->base + AVS_MBOX_MAGIC);
 
-	return (magic == AVS_FIRMWARE_MAGIC) && ((rc != -ENOTSUPP) ||
-		(rc != -EINVAL));
+	return (magic == AVS_FIRMWARE_MAGIC) && (rc != -ENOTSUPP) &&
+		(rc != -EINVAL);
 }
 
 static unsigned int brcm_avs_cpufreq_get(unsigned int cpu)
Signature · 1 line
2.39.5
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Colin Ian King

Currently the condition ((rc != -ENOTSUPP) || (rc != -EINVAL)) is always true because rc cannot be equal to two different values at the same time, so it must be not equal to at least one of them. Fix the original commit that introduced the issue.

This reverts commit 22a26cc6a51ef73dcfeb64c50513903f6b2d53d8.

Sorry for not replying earlier on.

Signature · 1 line
Florian
maintainer Applied
#2 lore raw
Quoted 11 lines · Florian Fainelli
Quoted 8 lines · Colin Ian King

Currently the condition ((rc != -ENOTSUPP) || (rc != -EINVAL)) is always true because rc cannot be equal to two different values at the same time, so it must be not equal to at least one of them. Fix the original commit that introduced the issue.

This reverts commit 22a26cc6a51ef73dcfeb64c50513903f6b2d53d8.

Applied. Thanks.

Signature · 1 line
viresh