[PATCH 2/2] cpufreq: Do WARN() for invalid relation
From: Viresh Kumar
Date: Thu Aug 27 2020 - 01:24:29 EST
The relation can't be invalid here, if it is just WARN() and return 0.
Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
---
include/linux/cpufreq.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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;
}
}
--
2.25.0.rc1.19.g042ed3e048af