diff mbox series

[2/2] cpufreq: Do WARN() for invalid relation

Message ID 1c643a64707d889e0ccab641df78c7a620325697.1598505843.git.viresh.kumar@linaro.org
State Accepted
Commit 30b8e6b22fd0f7a56911e69c681e92532e72e3b6
Headers show
Series [1/2] cpufreq: No need to verify cpufreq_driver in show_scaling_cur_freq() | expand

Commit Message

Viresh Kumar Aug. 27, 2020, 5:24 a.m. UTC
The relation can't be invalid here, if it is just WARN() and return 0.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

---
 include/linux/cpufreq.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.25.0.rc1.19.g042ed3e048af
diff mbox series

Patch

diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 8f141d4c859c..a911e5d06845 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -956,8 +956,8 @@  static inline int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
 	case CPUFREQ_RELATION_C:
 		return cpufreq_table_find_index_c(policy, target_freq);
 	default:
-		pr_err("%s: Invalid relation: %d\n", __func__, relation);
-		return -EINVAL;
+		WARN_ON_ONCE(1);
+		return 0;
 	}
 }