diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-05-19 02:37:15 -0400 |
---|---|---|
committer | Sudeep Holla <sudeep.holla@arm.com> | 2018-07-09 05:50:20 -0400 |
commit | 23cae492b4ed8cb2eb741f21a48bfd712960e87f (patch) | |
tree | 950fd98ba32ae373e4ccd9f554a5ecd57ea82999 | |
parent | ce397d215ccd07b8ae3f71db689aedb85d56ab40 (diff) |
firmware: arm_scmi: remove some unnecessary checks
The "pi->dom_info" buffer is allocated in init() and it can't be NULL
here. These tests are sort of weird as well because if "pi->dom_info"
was NULL but "domain" was non-zero then it would lead to an Oops.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
-rw-r--r-- | drivers/firmware/arm_scmi/perf.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c index 2a219b1261b1..721e6c57beae 100644 --- a/drivers/firmware/arm_scmi/perf.c +++ b/drivers/firmware/arm_scmi/perf.c | |||
@@ -363,8 +363,6 @@ static int scmi_dvfs_device_opps_add(const struct scmi_handle *handle, | |||
363 | return domain; | 363 | return domain; |
364 | 364 | ||
365 | dom = pi->dom_info + domain; | 365 | dom = pi->dom_info + domain; |
366 | if (!dom) | ||
367 | return -EIO; | ||
368 | 366 | ||
369 | for (opp = dom->opp, idx = 0; idx < dom->opp_count; idx++, opp++) { | 367 | for (opp = dom->opp, idx = 0; idx < dom->opp_count; idx++, opp++) { |
370 | freq = opp->perf * dom->mult_factor; | 368 | freq = opp->perf * dom->mult_factor; |
@@ -394,9 +392,6 @@ static int scmi_dvfs_transition_latency_get(const struct scmi_handle *handle, | |||
394 | return domain; | 392 | return domain; |
395 | 393 | ||
396 | dom = pi->dom_info + domain; | 394 | dom = pi->dom_info + domain; |
397 | if (!dom) | ||
398 | return -EIO; | ||
399 | |||
400 | /* uS to nS */ | 395 | /* uS to nS */ |
401 | return dom->opp[dom->opp_count - 1].trans_latency_us * 1000; | 396 | return dom->opp[dom->opp_count - 1].trans_latency_us * 1000; |
402 | } | 397 | } |