projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
681fe68
)
cpufreq: Use WARN_ON_ONCE() for invalid relation
author
Viresh Kumar
<viresh.kumar@linaro.org>
Thu, 27 Aug 2020 05:24:16 +0000
(10:54 +0530)
committer
Rafael J. Wysocki
<rafael.j.wysocki@intel.com>
Thu, 27 Aug 2020 10:51:25 +0000
(12:51 +0200)
The relation can't be invalid here, so if it turns out to be invalid,
just WARN_ON_ONCE() and return 0.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
include/linux/cpufreq.h
patch
|
blob
|
history
diff --git
a/include/linux/cpufreq.h
b/include/linux/cpufreq.h
index 8f141d4c859ce20cf8f6068148d8c78d4e7fb4c4..a911e5d06845497f3e72ee5f7dfa9ec262e4679b 100644
(file)
--- 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
;
}
}