提交 23cae492 编写于 作者: D Dan Carpenter 提交者: Sudeep Holla

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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
上级 ce397d21
...@@ -363,8 +363,6 @@ static int scmi_dvfs_device_opps_add(const struct scmi_handle *handle, ...@@ -363,8 +363,6 @@ static int scmi_dvfs_device_opps_add(const struct scmi_handle *handle,
return domain; return domain;
dom = pi->dom_info + domain; dom = pi->dom_info + domain;
if (!dom)
return -EIO;
for (opp = dom->opp, idx = 0; idx < dom->opp_count; idx++, opp++) { for (opp = dom->opp, idx = 0; idx < dom->opp_count; idx++, opp++) {
freq = opp->perf * dom->mult_factor; freq = opp->perf * dom->mult_factor;
...@@ -394,9 +392,6 @@ static int scmi_dvfs_transition_latency_get(const struct scmi_handle *handle, ...@@ -394,9 +392,6 @@ static int scmi_dvfs_transition_latency_get(const struct scmi_handle *handle,
return domain; return domain;
dom = pi->dom_info + domain; dom = pi->dom_info + domain;
if (!dom)
return -EIO;
/* uS to nS */ /* uS to nS */
return dom->opp[dom->opp_count - 1].trans_latency_us * 1000; return dom->opp[dom->opp_count - 1].trans_latency_us * 1000;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册