drivers: qcom: rpmh: fix unwanted error check for get_tcs_of_type()
Subsystems (2)
PATCH 1/1 drivers: qcom: rpmh: fix unwanted error check for get_tcs_of_type()
From: "Raju P.L.S.S.S.N" <[email protected]>
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_PTRdrivers/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
of sleep/wake TCS")
--- drivers/soc/qcom/rpmh-rsc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/soc/qcom/rpmh-rsc.c +2 -4
@@ -107,8 +107,6 @@ static int tcs_invalidate(struct rsc_drv *drv, int type)struct tcs_group *tcs; tcs =get_tcs_of_type (drv, type); -if (IS_ERR (tcs)) -return PTR_ERR (tcs);spin_lock (&tcs->lock);if (bitmap_empty (tcs->slots,MAX_TCS_SLOTS )) {
@@ -174,9 +172,9 @@ static struct tcs_group *get_tcs_for_msg(struct rsc_drv *drv,* TCSes before making an active state request. */ tcs =get_tcs_of_type (drv, type); -if (msg->state ==RPMH_ACTIVE_ONLY_STATE &&IS_ERR (tcs)) { +if (msg->state ==RPMH_ACTIVE_ONLY_STATE && !tcs->num_tcs) { tcs =get_tcs_of_type (drv,WAKE_TCS ); -if (!IS_ERR (tcs)) { +if (tcs->num_tcs) { ret =rpmh_rsc_invalidate (drv);if (ret)return ERR_PTR (ret);
Signature · 1 line
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project
+ Dan
Quoted 52 lines · Raju P L S S S N
From: "Raju P.L.S.S.S.N" <[email protected]>
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:111tcs_invalidate()
warn: 'tcs' isn't anERR_PTR
See also:drivers/soc/qcom/rpmh-rsc.c:178get_tcs_for_msg()warn: 'tcs' isn't anERR_PTRdrivers/soc/qcom/rpmh-rsc.c:180get_tcs_for_msg()warn: 'tcs' isn't anERR_PTRhttps://www.spinics.net/lists/linux-soc/msg04624.html
Fixes 48dbb0f02d34 ("drivers: qcom: rpmh-rsc: allow invalidationof sleep/wake TCS")
Reported-by Dan Carpenter <[email protected]>Signed-off-by Raju P.L.S.S.S.N <[email protected]>---
drivers/soc/qcom/rpmh-rsc.c| 6 ++----1 file changed, 2 insertions(+), 4 deletions(-)drivers/soc/qcom/rpmh-rsc.c +2
-5@@ -107,8 +107,6 @@ static int tcs_invalidate(struct rsc_drv *drv, int type)struct tcs_group *tcs; tcs =get_tcs_of_type (drv, type); -if (IS_ERR (tcs)) -return PTR_ERR (tcs);spin_lock (&tcs->lock);if (bitmap_empty (tcs->slots,MAX_TCS_SLOTS )) {@@ -174,9 +172,9 @@ static struct tcs_group *get_tcs_for_msg(struct rsc_drv *drv,* TCSes before making an active state request. */ tcs =get_tcs_of_type (drv, type); -if (msg->state ==RPMH_ACTIVE_ONLY_STATE &&IS_ERR (tcs)) { +if (msg->state ==RPMH_ACTIVE_ONLY_STATE && !tcs->num_tcs) { tcs =get_tcs_of_type (drv,WAKE_TCS ); -if (!IS_ERR (tcs)) { +if (tcs->num_tcs) { ret =rpmh_rsc_invalidate (drv);if (ret)return ERR_PTR (ret); --The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project
Quoted 14 lines · Raju P L S S S N
From: "Raju P.L.S.S.S.N" <[email protected]>
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:111tcs_invalidate()
warn: 'tcs' isn't anERR_PTR
See also:drivers/soc/qcom/rpmh-rsc.c:178get_tcs_for_msg()warn: 'tcs' isn't anERR_PTRdrivers/soc/qcom/rpmh-rsc.c:180get_tcs_for_msg()warn: 'tcs' isn't anERR_PTR
Quoted 6 lines
https://www.spinics.net/lists/linux-soc/msg04624.html
Fixes 48dbb0f02d34 ("drivers: qcom: rpmh-rsc: allow invalidationof sleep/wake TCS")
Reported-by Dan Carpenter <[email protected]>Signed-off-by Raju P.L.S.S.S.N <[email protected]>
Quoted 32 lines
---
drivers/soc/qcom/rpmh-rsc.c| 6 ++----1 file changed, 2 insertions(+), 4 deletions(-)drivers/soc/qcom/rpmh-rsc.c +2
-5@@ -107,8 +107,6 @@ static int tcs_invalidate(struct rsc_drv *drv, int type)struct tcs_group *tcs; tcs =get_tcs_of_type (drv, type); -if (IS_ERR (tcs)) -return PTR_ERR (tcs);spin_lock (&tcs->lock);if (bitmap_empty (tcs->slots,MAX_TCS_SLOTS )) {@@ -174,9 +172,9 @@ static struct tcs_group *get_tcs_for_msg(struct rsc_drv *drv,* TCSes before making an active state request. */ tcs =get_tcs_of_type (drv, type); -if (msg->state ==RPMH_ACTIVE_ONLY_STATE &&IS_ERR (tcs)) { +if (msg->state ==RPMH_ACTIVE_ONLY_STATE && !tcs->num_tcs) { tcs =get_tcs_of_type (drv,WAKE_TCS ); -if (!IS_ERR (tcs)) { +if (tcs->num_tcs) { ret =rpmh_rsc_invalidate (drv);if (ret)return ERR_PTR (ret); --The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project