Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp759828imm; Wed, 18 Jul 2018 10:09:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc+WvcPPkY2N+OFQOE7DWThRsbu2BkIuZJ2BAo7W3O79T0N87X35GPwKWTP1HckW+XSDiDL X-Received: by 2002:a65:5004:: with SMTP id f4-v6mr6630380pgo.54.1531933784322; Wed, 18 Jul 2018 10:09:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531933784; cv=none; d=google.com; s=arc-20160816; b=b+NKv527qqsEDzACodqwbbNOTaebQPbToQEMuomDPU9folPgsC8MgNMePEZFr4fllc KFpiKE05TuSwvOfupi0MU+48wiDNZ3/LTZactNaq2s+4Yyur3YFaBmdEtofHN2uaJN9H or4XpB18di43LEDGruMbr2DxoHhIHKNGrFtQRbENY6IUvd25al3JMNTC2WaCrEjWQmxb HhVWrvnWkMzJSCl8NLHkz2g3S14IzAKfsRz8IX4BNsV0upb7OlQZRAL7PKFMs/gfco74 0uaKxrsSVE2UN4jQglzrj1WhCwJcIob1fLP+XVaIBVepxgXWxiDamTP4S7GXlunRtLqF Tp+A== 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=d7SRM/6BRhwpXzVVNCadeVp/YCdfWyFwZCiRqBiL238=; b=pybbIVq7DmMODxnQ3yM6diewHRxaVxuF3nQ6IU1bz5UYwoftGgR5mkta7U1PFcQYM9 DkV9+RsO37F/J6nWtSiJhkvrYOnjZfYGUHRwbAJLM5lCS+ZQvcU+1eVYgZdMc7sQWZao F0t0PHH9neaIlg94LM/tiXPrWapqSPXhzPQQ6hd8KulvRzOHGc49IaL77qdw7Wp3UQr6 zsCcJgWdmWEM/tF+GGksdG6kaNqg/4dzZkZ1lBCPH3V2BjPJI+wd3V/zH5+P9F3ZCXJy OC077GJqLCKY+nk6vfeyUoHyLItgxr6oV/Sym7/zWemrS2iznCszMyC+laQUZcu6xUX0 Iadg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=WRNWSjGy; dkim=pass header.i=@codeaurora.org header.s=default header.b=dxo8cpd5; 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 a20-v6si3811567pgb.600.2018.07.18.10.09.29; Wed, 18 Jul 2018 10:09:44 -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=WRNWSjGy; dkim=pass header.i=@codeaurora.org header.s=default header.b=dxo8cpd5; 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 S1731431AbeGRRrd (ORCPT + 99 others); Wed, 18 Jul 2018 13:47:33 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:54388 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728276AbeGRRrd (ORCPT ); Wed, 18 Jul 2018 13:47:33 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 0658F607C6; Wed, 18 Jul 2018 17:08:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1531933723; bh=6FHwTyJqww16tdrWqS6R0l6JBVVAzAv/Xdp5NiGDEmE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WRNWSjGyY5SqaRpCnsHAD7GQJPFeNrgglB3xCOoFzcmB3UgxfgEy6effoueK2QM1b 9u0UZJ67R3UbTy85r59gaTBNG8qAaJRmZlHIMXA08ZyJIkamoZuRtEvbTZNOm6fMBP sQaVP2a8sLnbBBzBFgQdh30MOkR+w/ipufmY8cK4= 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 6A033602B3; Wed, 18 Jul 2018 17:08:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1531933722; bh=6FHwTyJqww16tdrWqS6R0l6JBVVAzAv/Xdp5NiGDEmE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dxo8cpd5sEKrk/wJWnB5ZGiyvNS4FgJI3YUS53tmtXvAN2VQwxdeSZ4VKNQbUMvft xhv5kPlmC9vkBdK/x4MCQukoSjkCOi11iWmuXoIx0xUcqh6JoOJSY/+r7cn/idPWwy IYE+lCdrBpKeAIfw3qsvG4g/RNw8zlA4vOJjQynE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6A033602B3 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: Wed, 18 Jul 2018 11:08:41 -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 Subject: Re: [PATCH] drivers: qcom: rpmh: fix unwanted error check for get_tcs_of_type() Message-ID: <20180718170841.GB10905@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 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 Reviewed-by: Lina Iyer >--- > 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 >