Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1038599ybh; Wed, 11 Mar 2020 16:15:02 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsvjzAAu+V3AWgtoo8bPinhrhYK+96yoqKfhdp5Y13W4vzwyuYTPdHtKhIcn9jOJvg/P3yT X-Received: by 2002:a4a:d0cd:: with SMTP id u13mr1968512oor.22.1583968501994; Wed, 11 Mar 2020 16:15:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583968501; cv=none; d=google.com; s=arc-20160816; b=sV9O1yLITCViDnRXWWGNxRXmAs1MdixAkWXbcBRKIpJGYGb+9b2bZhL6OjyK5q1yFu kXxrFkcqjXphtJi0pAN+njFFC/KtlC9RLChFSMBsGToXtQ3O4T/bnBSMY1GXu0vkTC9F e6fGj11KZ+GFY9XPwI8I09gHxWeaZjWwy+9HxcJJibe20IuPOFkmuTXZIgL5KcUa2tBH bxjJbcpl+8w7Nb3lfAoAXSUZzELoD9W5evuLuQvUvSucqxWV+1yZetuS6UKv6mhj7HxN hgrMhz/RKj9EyjSvSniGgOdkvTZLYolNalqIxzzd41/JMrmmKUTEi44HCT36syGtL5hr tUfA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UWBjFQXkSBNRsjQ6miPhHt5bde1mFApW8A9hXCEPvFI=; b=QKvN4s0adcsr9pLHPHeZwrSeKIaK4Qar1ohHXM+rQb6cLOqzq6kKz3Q0Ko4QsziLyd yC2nDENvZCqB9DWoYFkwOqt3r8DFkYuKBnMbEw8yw4Ms6w1wyhEM1S/Nz/c/V6dVrsZo sTDLgWvYEHUHoBwpifUsLhW6/n+lLdVkaNHXzN91aM4fVLOd/g/Sc1oFQrmVMSR04w7+ yM831KCyFW46LxyKw37TWJwDXJlCGtb9ykuhLF+UGAUHlbQCE6TVVEUFahUdRSEx6Hn9 5tDPPM0t96ifvq46AYidhnCWGjDNeDZzkx3KoFb1eL0mKotkorGYNGDRRTh+LAguo/7l oTSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LguTebpO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t125si1652219oie.167.2020.03.11.16.14.46; Wed, 11 Mar 2020 16:15:01 -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=@chromium.org header.s=google header.b=LguTebpO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731501AbgCKXOV (ORCPT + 99 others); Wed, 11 Mar 2020 19:14:21 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:38299 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731338AbgCKXOT (ORCPT ); Wed, 11 Mar 2020 19:14:19 -0400 Received: by mail-pf1-f193.google.com with SMTP id z5so2216267pfn.5 for ; Wed, 11 Mar 2020 16:14:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UWBjFQXkSBNRsjQ6miPhHt5bde1mFApW8A9hXCEPvFI=; b=LguTebpOgMY1OHVxiVcNye4AXrA527VpjMXtXNfeo1dOVyA4+iLfLEzY8FsMnsBAsc E6BeIn78I+gQO162VXEyatPZ5hSVUz1sCr0Q9juzHnJPv97xSLNAMDMGN/fK/sWmkyW1 hKK+VbVYaIOIcGVe1tHh1Avo40fMjblj7/SZc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UWBjFQXkSBNRsjQ6miPhHt5bde1mFApW8A9hXCEPvFI=; b=EOkYBIuc0cn37+uqoO4LvkJYRJEcpkQr1Ztn8lW280gEafMsqeuI9iJVqpRUhCjYxR YM8ou6TyOSE51fdJFkCppznby4Q/lIiqUouRDrivYwmE/oq0kYgTSilQU9PpsSf/VyAh AwNZqdw7PFuFtJiJzuQMi/jkfwSP/UEF7rULZkm0/x2vM8405APhIcJjKiok3p8Nr2d3 NOHTDbncIHibtvYnpNOxCOmBhnKE1nNm5FPfMAqzdIKgn8r2GcUtaxqhAE1DLFuyhtuN VwvUUoohsfIAb6K9+2WNSUjp1/okTz/OGCw8kwQ1SgGmDwXUKyRGHkTpfLOv4c1Sz/ur zwsA== X-Gm-Message-State: ANhLgQ04gAuWc82C5QgZOlTdBP0lkm2ETDgMtrcAVWqvj+y7wOje0dQM t24s87EhpWIOq12nSxUKGsARaQ== X-Received: by 2002:a65:43cb:: with SMTP id n11mr4796908pgp.65.1583968456977; Wed, 11 Mar 2020 16:14:16 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id g75sm2606334pje.37.2020.03.11.16.14.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2020 16:14:16 -0700 (PDT) From: Douglas Anderson To: Andy Gross , Bjorn Andersson , Maulik Shah Cc: mka@chromium.org, Rajendra Nayak , evgreen@chromium.org, Lina Iyer , swboyd@chromium.org, Douglas Anderson , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 04/10] drivers: qcom: rpmh-rsc: Remove get_tcs_of_type() abstraction Date: Wed, 11 Mar 2020 16:13:42 -0700 Message-Id: <20200311161104.RFT.v2.4.Ia348ade7c6ed1d0d952ff2245bc854e5834c8d9a@changeid> X-Mailer: git-send-email 2.25.1.481.gfbce0eb801-goog In-Reply-To: <20200311231348.129254-1-dianders@chromium.org> References: <20200311231348.129254-1-dianders@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) -- 2.25.1.481.gfbce0eb801-goog