aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaju P.L.S.S.S.N <rplsssn@codeaurora.org>2018-07-13 09:45:46 -0400
committerAndy Gross <andy.gross@linaro.org>2018-07-21 14:47:22 -0400
commit6c805adf17d491ea66d3cf80db3ada75b7180268 (patch)
tree131462355eeb199c3dc61db3e12bc9187b9273e1
parentefa1c257b3fc7ef2a1db604b260784cc8bcdfd23 (diff)
drivers: qcom: rpmh: fix unwanted error check for get_tcs_of_type()
The patch fixes the bug reported by Dan Carpenter. It removes the unnecessary err check for ‘tcs’ reported by static checker warning: drivers/soc/qcom/rpmh-rsc.c:111 tcs_invalidate() warn: 'tcs' isn't an ERR_PTR See also: drivers/soc/qcom/rpmh-rsc.c:178 get_tcs_for_msg() warn: 'tcs' isn't an ERR_PTR drivers/soc/qcom/rpmh-rsc.c:180 get_tcs_for_msg() warn: 'tcs' isn't an ERR_PTR https://www.spinics.net/lists/linux-soc/msg04624.html Fixes: 9a3afcf ("drivers: qcom: rpmh-rsc: allow invalidation of sleep/wake TCS") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org> Reviewed-by: Lina Iyer <ilina@codeaurora.org> Signed-off-by: Andy Gross <andy.gross@linaro.org>
-rw-r--r--drivers/soc/qcom/rpmh-rsc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
index 8d9da6e7df0e..ee75da66d64b 100644
--- a/drivers/soc/qcom/rpmh-rsc.c
+++ b/drivers/soc/qcom/rpmh-rsc.c
@@ -108,8 +108,6 @@ static int tcs_invalidate(struct rsc_drv *drv, int type)
108 struct tcs_group *tcs; 108 struct tcs_group *tcs;
109 109
110 tcs = get_tcs_of_type(drv, type); 110 tcs = get_tcs_of_type(drv, type);
111 if (IS_ERR(tcs))
112 return PTR_ERR(tcs);
113 111
114 spin_lock(&tcs->lock); 112 spin_lock(&tcs->lock);
115 if (bitmap_empty(tcs->slots, MAX_TCS_SLOTS)) { 113 if (bitmap_empty(tcs->slots, MAX_TCS_SLOTS)) {
@@ -175,9 +173,9 @@ static struct tcs_group *get_tcs_for_msg(struct rsc_drv *drv,
175 * TCSes before making an active state request. 173 * TCSes before making an active state request.
176 */ 174 */
177 tcs = get_tcs_of_type(drv, type); 175 tcs = get_tcs_of_type(drv, type);
178 if (msg->state == RPMH_ACTIVE_ONLY_STATE && IS_ERR(tcs)) { 176 if (msg->state == RPMH_ACTIVE_ONLY_STATE && !tcs->num_tcs) {
179 tcs = get_tcs_of_type(drv, WAKE_TCS); 177 tcs = get_tcs_of_type(drv, WAKE_TCS);
180 if (!IS_ERR(tcs)) { 178 if (tcs->num_tcs) {
181 ret = rpmh_rsc_invalidate(drv); 179 ret = rpmh_rsc_invalidate(drv);
182 if (ret) 180 if (ret)
183 return ERR_PTR(ret); 181 return ERR_PTR(ret);