Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp922956imm; Fri, 13 Jul 2018 08:31:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdE1p2VVsPIS2lJ9kFzfI9Q0v/o65MHrUsl9VxvNtuo1cE/4ovXS1y6aJu7P8zCBPdSYpIx X-Received: by 2002:a62:98d6:: with SMTP id d83-v6mr7649617pfk.186.1531495873740; Fri, 13 Jul 2018 08:31:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531495873; cv=none; d=google.com; s=arc-20160816; b=mrj+L4UHkCY2PrIcPoIGAYL1MbaomgJp3dbqXdDi4GNRITo4hoVhjqQ6v338xX14D3 kNv0KrnsFVOTiPXqPO5InOXDp7ID0VPJ35TrIEeOCz3mbjAFXN3+uLLsGxyb0zAaZpgV XAER95C8crdgZSdTm+FG5MFq1Fkii2BnjsMyW+ALb0xUgl0/xTxx6e7nrhvPDOzCcIa8 /P+pn9I9HJZ014NNcSgIZRm2DlGZKS4wJrRUdAKjGvopg/NbMatZ17e592oY4PemShOy 6F/jUrdMNYCN0wq2y/N8trrbDGGks89d54hcS14+mGttbVGf6F48ufIRozTwnGrsL6bC c+iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=EMsgbpw+oLw1qLyFV8XgdTWxnDti1cP1JvfrUOOu4vo=; b=evAs6eNkFACmv5Yt1RWEXTfXH4sh78uAv+DZS0TOkPo8WsTP1ZBp0Ab8JC7fYpHMOz enIIjEALTDkEDyOKNV6j2QvN4h7Q6YALTn5LqN+ElK3R30XRNkuoCNq54JlwG+28xgk9 kMuCLnom7QiRTCvM10PsKZuZ21yPRcT7rTfuHMhG/v4VWYxUkcqBJkmkimXF9tAHQevw neKtqScLdRaUwPRFC6GY5ForEkNYRMhIOadiK5z5BDfO+0Akam+kePjqFKMVBGCJi9Zx DI3v+vN4U0whOU7yrTVyTvjWesf5MktKJOMRPLgWbbrN1W/vsjxt3mHEwJksk6vZzXDk r71Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=b98KUMVL; dkim=pass header.i=@codeaurora.org header.s=default header.b=b98KUMVL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k185-v6si23672897pgd.15.2018.07.13.08.30.57; Fri, 13 Jul 2018 08:31:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=b98KUMVL; dkim=pass header.i=@codeaurora.org header.s=default header.b=b98KUMVL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729998AbeGMPp0 (ORCPT + 99 others); Fri, 13 Jul 2018 11:45:26 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:54158 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729725AbeGMPp0 (ORCPT ); Fri, 13 Jul 2018 11:45:26 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id EF5E960721; Fri, 13 Jul 2018 15:30:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1531495819; bh=jRArqfE597GXYwjf+bjxqh5kA9bfwRQ0vat30rKds7Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=b98KUMVLr9+kHXfC+fHQKwEv5e+5wGpHtgtlk9XGXUaJyXKYPJ2mRyFlWVENK46+D C1IJNNhzFv3iz7IucEYPUzKIoTjgzNmSmRWiEuSBzKNfmSSUr392t+yhaKzMVxjy5n Q3tEiNHctqMraAxih6bEQ/YRuEUlsZKdRvjn0yvU= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from localhost (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ilina@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 04F9760541; Fri, 13 Jul 2018 15:30:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1531495819; bh=jRArqfE597GXYwjf+bjxqh5kA9bfwRQ0vat30rKds7Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=b98KUMVLr9+kHXfC+fHQKwEv5e+5wGpHtgtlk9XGXUaJyXKYPJ2mRyFlWVENK46+D C1IJNNhzFv3iz7IucEYPUzKIoTjgzNmSmRWiEuSBzKNfmSSUr392t+yhaKzMVxjy5n Q3tEiNHctqMraAxih6bEQ/YRuEUlsZKdRvjn0yvU= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 04F9760541 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=ilina@codeaurora.org Date: Fri, 13 Jul 2018 09:30:18 -0600 From: Lina Iyer To: Raju P L S S S N Cc: andy.gross@linaro.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, rnayak@codeaurora.org, bjorn.andersson@linaro.org, linux-kernel@vger.kernel.org, sboyd@kernel.org, evgreen@chromium.org, dianders@chromium.org, mka@chromium.org, dan.carpenter@oracle.com Subject: Re: [PATCH] drivers: qcom: rpmh: fix unwanted error check for get_tcs_of_type() Message-ID: <20180713153018.GB887@codeaurora.org> References: <1531489546-21577-1-git-send-email-rplsssn@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1531489546-21577-1-git-send-email-rplsssn@codeaurora.org> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org + 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" > >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 >Signed-off-by: Raju P.L.S.S.S.N >--- > 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 >