Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp365012ybb; Wed, 1 Apr 2020 01:19:36 -0700 (PDT) X-Google-Smtp-Source: APiQypKDTKy856F9FrbbpGK6/KlydHye9ruyOYLUfc3ORcHahFZLnq1Nqj6vSDwWpr8tA4wAIi6W X-Received: by 2002:aca:fd09:: with SMTP id b9mr1998467oii.88.1585729175871; Wed, 01 Apr 2020 01:19:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585729175; cv=none; d=google.com; s=arc-20160816; b=p891ATxCMQriE3ECpKf9/VRteSRHCGf2zeL4tu/1x+1qS8PJYPW+fMowMQowTcECs/ kV1tpe+5sgh1VX8bE5BqJbGBgCEHIPVSzl7nyZLPCSTRYQvfwQs7plAFYIdg2bZx7UkU j7hvahcmWT+SP9jDnEzsLNzzvkFXrouNgikLUqgst8C5T+GsjsJSyAWljfQTsmj8GbCY 7NnNPlMuGAfF9QnQDLIRZFXMPG3uzxsTAfodFdaGKQALVvQyPVHKtRYjYq2jbWct9meZ 88pND9XP99Dsr76BqBSdPAvQ48l6uJ8GtudipS4bmOmn0nEpbJEaNRAVomqKz8vd1M8P emPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature; bh=7PsHfH50Qa4x11/cHlqtR7JN55Rk0n8ciHDiIs770ho=; b=r8HtziDNbq0oS2QMOv9CbUXmwL0SnRZxippAkvyK3L8IVwBbL9DXdTGP2UZUENIc3P gubWTIqXsuTmee4EglOQx3sSK8nJ2eYnH64zwzDo7tq+boDzgrDQ64GyIdMvDtdbatxr xQyksEyqQvJbSy7nG0PCJXBied8G1YlpYjJ85R3nPUeyakGbpfVoQw2lazPmjIFPgh4W CM0V+QNxeVq+wQg3Re6m0ikss9XttFEHBR+UcaugCGW0JJPRXmHIO4o6Uhi/qJmnfPIM EMK0W1JsbfBtwKxAERkW3PsV5CmLnCwWekufTACqb874dzuOldS2ibEzNMavjbSsdQlM unHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b="U3heV/E0"; 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 q23si513029otm.181.2020.04.01.01.19.23; Wed, 01 Apr 2020 01:19:35 -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=fail header.i=@mg.codeaurora.org header.s=smtp header.b="U3heV/E0"; 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 S1732009AbgDAISq (ORCPT + 99 others); Wed, 1 Apr 2020 04:18:46 -0400 Received: from mail27.static.mailgun.info ([104.130.122.27]:48510 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731729AbgDAISp (ORCPT ); Wed, 1 Apr 2020 04:18:45 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1585729125; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=7PsHfH50Qa4x11/cHlqtR7JN55Rk0n8ciHDiIs770ho=; b=U3heV/E05kY6b5H1kHmQdYKYC1zucWlQB60xSdgjZbSVUKcjZ4V4j801oAi1k2ZlEorYAuW+ rLKuSPlgSmczwM7+jvoCSIBc6m2/8Uoz9URwJBFateSbKSY3bpO1qfvrwYwSEYiBDR1Whder V/wvYZsOP1PuFhclzq+fpmDLoT4= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e844e63.7f9b87da01b8-smtp-out-n02; Wed, 01 Apr 2020 08:18:43 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 49461C4478C; Wed, 1 Apr 2020 08:18:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from [192.168.43.137] (unknown [106.213.199.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mkshah) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4056AC433D2; Wed, 1 Apr 2020 08:18:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4056AC433D2 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=mkshah@codeaurora.org Subject: Re: [RFT PATCH v2 04/10] drivers: qcom: rpmh-rsc: Remove get_tcs_of_type() abstraction To: Douglas Anderson , Andy Gross , Bjorn Andersson Cc: mka@chromium.org, Rajendra Nayak , evgreen@chromium.org, Lina Iyer , swboyd@chromium.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200311231348.129254-1-dianders@chromium.org> <20200311161104.RFT.v2.4.Ia348ade7c6ed1d0d952ff2245bc854e5834c8d9a@changeid> From: Maulik Shah Message-ID: <24620fdc-4ac7-b54a-45aa-906da3dc3fa9@codeaurora.org> Date: Wed, 1 Apr 2020 13:48:33 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200311161104.RFT.v2.4.Ia348ade7c6ed1d0d952ff2245bc854e5834c8d9a@changeid> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Tested-by: Maulik Shah Thanks, Maulik On 3/12/2020 4:43 AM, Douglas Anderson wrote: > The get_tcs_of_type() function doesn't provide any value. It's not > conceptually difficult to access a value in an array, even if that > value is in a structure and we want a pointer to the value. Having > the function in there makes me feel like it's doing something fancier > like looping or searching. Remove it. > > Signed-off-by: Douglas Anderson > Reviewed-by: Maulik Shah > --- > > Changes in v2: None > > drivers/soc/qcom/rpmh-rsc.c | 13 +++---------- > 1 file changed, 3 insertions(+), 10 deletions(-) > > diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c > index 799847b08038..c9f29cbd5ee5 100644 > --- a/drivers/soc/qcom/rpmh-rsc.c > +++ b/drivers/soc/qcom/rpmh-rsc.c > @@ -170,17 +170,10 @@ static bool tcs_is_free(struct rsc_drv *drv, int tcs_id) > read_tcs_reg(drv, RSC_DRV_STATUS, tcs_id); > } > > -static struct tcs_group *get_tcs_of_type(struct rsc_drv *drv, int type) > -{ > - return &drv->tcs[type]; > -} > - > static int tcs_invalidate(struct rsc_drv *drv, int type) > { > int m; > - struct tcs_group *tcs; > - > - tcs = get_tcs_of_type(drv, type); > + struct tcs_group *tcs = &drv->tcs[type]; > > spin_lock(&tcs->lock); > if (bitmap_empty(tcs->slots, MAX_TCS_SLOTS)) { > @@ -246,9 +239,9 @@ static struct tcs_group *get_tcs_for_msg(struct rsc_drv *drv, > * dedicated AMC, and therefore would invalidate the sleep and wake > * TCSes before making an active state request. > */ > - tcs = get_tcs_of_type(drv, type); > + tcs = &drv->tcs[type]; > if (msg->state == RPMH_ACTIVE_ONLY_STATE && !tcs->num_tcs) { > - tcs = get_tcs_of_type(drv, WAKE_TCS); > + tcs = &drv->tcs[WAKE_TCS]; > if (tcs->num_tcs) { > ret = rpmh_rsc_invalidate(drv); > if (ret) -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation