Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp810916imm; Fri, 13 Jul 2018 06:46:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf0gES48EF9b9ymY0Y7hhlB6MsI5kccSHpCPpvToPS/w8faxOSphOvQe3Ud62LDsYuMa1p6 X-Received: by 2002:a65:66d7:: with SMTP id c23-v6mr6231780pgw.427.1531489610153; Fri, 13 Jul 2018 06:46:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531489610; cv=none; d=google.com; s=arc-20160816; b=nyAWT8pZ3nxAxj+1TZxLHUq1Tp5TlzqrGRa+NlZdzLVayaGKwnLxVK/14VqhOCNgdS R7zavwQvlI54BiTItQWBOVo6sHw/ibBSI07IX2YAY0mpKQ5EOr32nF39sHCJX25BU8sK s7veo8aUWxsLeQYk/XY4/ReZ8vRPbsu4Qrn1/QQE9dYdsJnyfqVdoW9Dz3Qb+3YK4heZ 0WfeYT2j6xyWKGAJaKon1vSakLKSpnDI3wgfRkTLYkfJZF+G9r7q9QYlTzyKW4JP6FIX b0vRiv8T8Oa7J1u+Gm9O+ATqbRguy4bWrDOT8o8mgBa8cQTzA6j0V05FE0dWDMA5xnLp 30qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dmarc-filter:dkim-signature :dkim-signature:arc-authentication-results; bh=AuErNIkHJGJrGZ7B9d4lU8T50DN10NLKfXZDbDeSZh8=; b=iVvZupaCj3BIT7kPAH0+FeyXl7zwPEVjkiABZLX1EOyleejawaIJqffvfjgKndxJoR rJTXvfo/FiR3zUkZOla0HRQ1SDczdh5J5byH0fbYY/MyKUDu2jhEhzO65qSlgxXH43bd BtnyrzYtx992qd8SWr8IW6whkq8/oVj+o0nlLAXAsPVxAS6H+H7xDsOoSzEaKLt24t85 2YWTsL0mjBsN23aiXRt5i52lHPK6KUahGZqEaDJkhd2lofS5tBq3Bai3iASLsLqdbDXv 5YfS5olumP9fTcpGroLu5Owr++4XBkNW1gm+rOoP9Nr2lQhiNld/4onocLRyVZcE4m7m bxag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=b2qmcL0f; dkim=pass header.i=@codeaurora.org header.s=default header.b=JAPUA97K; 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 s21-v6si24612489pfk.213.2018.07.13.06.46.35; Fri, 13 Jul 2018 06:46:50 -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=b2qmcL0f; dkim=pass header.i=@codeaurora.org header.s=default header.b=JAPUA97K; 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 S1729723AbeGMOAo (ORCPT + 99 others); Fri, 13 Jul 2018 10:00:44 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:56910 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729632AbeGMOAo (ORCPT ); Fri, 13 Jul 2018 10:00:44 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id A4A2C60B81; Fri, 13 Jul 2018 13:46:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1531489560; bh=tZFhWy0SMkwojbek8yTnOyiBzZIFsxBif47kn8AoQJ4=; h=From:To:Cc:Subject:Date:From; b=b2qmcL0fmGAjqqQ7jpfY3sky7IDPvMlOGLa2Du37R22raFt4gRdeZH8hh9VZyI7Ha AgMThR0t8e8+3OqeU681B7mHbqa3eHAU4nsogQMMZYkyvUCFUW6VMsai0IRproUlYh ODXcKQMAEKuwPcb1BznercW+FOtltqN4yB4xQRbc= 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.3 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,FROM_LOCAL_NOVOWEL,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from rplsssn-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rplsssn@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 797F360227; Fri, 13 Jul 2018 13:45:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1531489559; bh=tZFhWy0SMkwojbek8yTnOyiBzZIFsxBif47kn8AoQJ4=; h=From:To:Cc:Subject:Date:From; b=JAPUA97KRdoCaDhTNJOYM5P7j3ImKjIsFZ2FsqvT+ErOBknzAw/QhZdBTk3y5ifCU Sv+25tVSz57pKI/VYAP1ENVyxuZzRzSAMJsr9XJX1boykofBi9kbDL29zPlU7WBnFp ZGbD/jyJbXpQhPVgTn6jxbtmlRxNyr1611mJ5Kyk= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 797F360227 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=rplsssn@codeaurora.org From: Raju P L S S S N To: andy.gross@linaro.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org Cc: rnayak@codeaurora.org, bjorn.andersson@linaro.org, linux-kernel@vger.kernel.org, sboyd@kernel.org, evgreen@chromium.org, dianders@chromium.org, mka@chromium.org, ilina@codeaurora.org, "Raju P.L.S.S.S.N" Subject: [PATCH] drivers: qcom: rpmh: fix unwanted error check for get_tcs_of_type() Date: Fri, 13 Jul 2018 19:15:46 +0530 Message-Id: <1531489546-21577-1-git-send-email-rplsssn@codeaurora.org> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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