linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers: qcom: rpmh: fix unwanted error check for get_tcs_of_type()
@ 2018-07-13 13:45 Raju P L S S S N
  2018-07-13 15:30 ` Lina Iyer
  2018-07-18 17:08 ` Lina Iyer
  0 siblings, 2 replies; 3+ messages in thread
From: Raju P L S S S N @ 2018-07-13 13:45 UTC (permalink / raw)
  To: andy.gross, david.brown, linux-arm-msm, linux-soc
  Cc: rnayak, bjorn.andersson, linux-kernel, sboyd, evgreen, dianders,
	mka, ilina, Raju P.L.S.S.S.N

From: "Raju P.L.S.S.S.N" <rplsssn@codeaurora.org>

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: 48dbb0f02d34 ("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>
---
 drivers/soc/qcom/rpmh-rsc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
index 098feb9..fefda0f 100644
--- a/drivers/soc/qcom/rpmh-rsc.c
+++ b/drivers/soc/qcom/rpmh-rsc.c
@@ -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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drivers: qcom: rpmh: fix unwanted error check for get_tcs_of_type()
  2018-07-13 13:45 [PATCH] drivers: qcom: rpmh: fix unwanted error check for get_tcs_of_type() Raju P L S S S N
@ 2018-07-13 15:30 ` Lina Iyer
  2018-07-18 17:08 ` Lina Iyer
  1 sibling, 0 replies; 3+ messages in thread
From: Lina Iyer @ 2018-07-13 15:30 UTC (permalink / raw)
  To: Raju P L S S S N
  Cc: andy.gross, david.brown, linux-arm-msm, linux-soc, rnayak,
	bjorn.andersson, linux-kernel, sboyd, evgreen, dianders, mka,
	dan.carpenter

+ Dan

On Fri, Jul 13 2018 at 07:46 -0600, Raju P L S S S N wrote:
>From: "Raju P.L.S.S.S.N" <rplsssn@codeaurora.org>
>
>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: 48dbb0f02d34 ("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>
>---
> drivers/soc/qcom/rpmh-rsc.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
>index 098feb9..fefda0f 100644
>--- a/drivers/soc/qcom/rpmh-rsc.c
>+++ b/drivers/soc/qcom/rpmh-rsc.c
>@@ -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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drivers: qcom: rpmh: fix unwanted error check for get_tcs_of_type()
  2018-07-13 13:45 [PATCH] drivers: qcom: rpmh: fix unwanted error check for get_tcs_of_type() Raju P L S S S N
  2018-07-13 15:30 ` Lina Iyer
@ 2018-07-18 17:08 ` Lina Iyer
  1 sibling, 0 replies; 3+ messages in thread
From: Lina Iyer @ 2018-07-18 17:08 UTC (permalink / raw)
  To: Raju P L S S S N
  Cc: andy.gross, david.brown, linux-arm-msm, linux-soc, rnayak,
	bjorn.andersson, linux-kernel, sboyd, evgreen, dianders, mka

On Fri, Jul 13 2018 at 07:46 -0600, Raju P L S S S N wrote:
>From: "Raju P.L.S.S.S.N" <rplsssn@codeaurora.org>
>
>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: 48dbb0f02d34 ("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>

>---
> drivers/soc/qcom/rpmh-rsc.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
>index 098feb9..fefda0f 100644
>--- a/drivers/soc/qcom/rpmh-rsc.c
>+++ b/drivers/soc/qcom/rpmh-rsc.c
>@@ -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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-18 17:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-13 13:45 [PATCH] drivers: qcom: rpmh: fix unwanted error check for get_tcs_of_type() Raju P L S S S N
2018-07-13 15:30 ` Lina Iyer
2018-07-18 17:08 ` Lina Iyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).