Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp60807ybh; Fri, 6 Mar 2020 16:01:46 -0800 (PST) X-Google-Smtp-Source: ADFU+vtwuR3vzCcpq69T4uM6lvn1TydetAJYR5m4Dyd1X4dIJ61GLQY6nb/ebVeFZuLuV6wcFVYg X-Received: by 2002:a9d:443:: with SMTP id 61mr4199494otc.357.1583539306323; Fri, 06 Mar 2020 16:01:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583539306; cv=none; d=google.com; s=arc-20160816; b=BT2zMZ2zoz3/I0s7C1UMUUvGt/Hkx87QU+DsVNuHq7G4dQF/sBcoPtWFfiusdBFNWV TRABWTVQNUkHnDgDvlfQ66OmD9apn1smFjgVSVTQrLEz4GmlWhuYhGnWQ0qHWF1pH8zp vxGLXJvoS2KR2+I81ThwkgJa49y/MZEdPE2AGeNtxhai+SfiNlGH5thDNv8aXH1Fw7Eg G3vXvEkGfxPX5xyWITKjyO+JyiOYBR8MWzy/FSQCWB2TguDe9XOGvPDpjfzMYCxLMIgC GLGgDrIBoaEMyPsVkb87IEPeWTRv18yNOCzmMNoROyBr3w5M+7Otwx2PC/cYkxOB07wv ZH3A== 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=u8+XDECHKDnfFP2mU6jtvKWXeYjZc2hEZEODKmTyouM=; b=QQ1TFgEQE8xI38kQ4xj+cPvLAsHIaRVBv+1I0sSxQHlvLrTBxk7yDyuMoU8+dr0ybP OqLWiVO7IoeKnnqjexXiEz1XndQdkB6hJqn6WrKrZ9XE75D1em18QluZwhL3fRQMb9Dk JU6v/XAjCoFC5GZI0ZYa3HtdPCgg4/g9b0aFsPHbWi5StM5GygMWT3Se1ns4YHbokZZK tVPQSfii2p1P8SJ3M323aolVVFUni3jit0E05YBTIf+B39rcjHCWNIx37AWmIv1epp5k HYtS6WTqzDVHvz/NojAJOw0HmlKDCdj8GMvUp15Iq7t1pyDtHIb919KnR9wFO+zPnnB5 qbBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Rk1/bVnM"; 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 s13si2165308otr.94.2020.03.06.16.01.35; Fri, 06 Mar 2020 16:01:46 -0800 (PST) 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="Rk1/bVnM"; 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 S1726910AbgCGAA1 (ORCPT + 99 others); Fri, 6 Mar 2020 19:00:27 -0500 Received: from mail-pj1-f68.google.com ([209.85.216.68]:50763 "EHLO mail-pj1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726905AbgCGAA0 (ORCPT ); Fri, 6 Mar 2020 19:00:26 -0500 Received: by mail-pj1-f68.google.com with SMTP id u10so93908pjy.0 for ; Fri, 06 Mar 2020 16:00:26 -0800 (PST) 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=u8+XDECHKDnfFP2mU6jtvKWXeYjZc2hEZEODKmTyouM=; b=Rk1/bVnMbRF9Lx6Cx0Z+WlP/U4z3dT3o630PtJQW78Ee+ARVteSVzn9G09ald+vqpy Anl9XlNteMq5T7K5e8b2nVG19kbp/QVP5S0ps+nWFuCHVqh5ychoRrmSlDFEiSiEmLNL R6ac50QbuiTN35VMh81HB+/1D358MDgXZLFPM= 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=u8+XDECHKDnfFP2mU6jtvKWXeYjZc2hEZEODKmTyouM=; b=ZbEg5to3QK70fqmxxk97yBpmxjmhuQpWxiTicAP0QCPwCrJynvfzCcYZDXdaG4MgA7 wdQgK0uh7TmvXIu7f/g50tEcuqy6BURAvg1QmeVlbVW+PF7AgslaFU31y55oeTpKNpCf FQk98+mVPhnzy4eLkSzYslcTdXb9glOZ87lXIc8A1FHRJfocyuJye2CSXTUQr8pxev4V 1tgWrHFPrzr6eghJZMhsN8Truf1nZcHbZgeyxBMRNGUjchWPobDWoJNyUw9IncVciNiD bUb8xOZHICvaq+FNBDLPLqKsbW+bW1B16pT3JNNjbAXlmQd3aq8hWRbnxq0HzDtYP16B AAjA== X-Gm-Message-State: ANhLgQ1AWiCjYlCoYK9z2xmBzFhlbREyIUfN/Y2KPDTMIyzIbD9DMxpv LNyA4imgKPtjtjgJhKSJAPBclw== X-Received: by 2002:a17:90b:378d:: with SMTP id mz13mr6440459pjb.191.1583539225658; Fri, 06 Mar 2020 16:00:25 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id 9sm32302246pge.65.2020.03.06.16.00.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Mar 2020 16:00:25 -0800 (PST) From: Douglas Anderson To: Andy Gross , Bjorn Andersson , Maulik Shah Cc: Rajendra Nayak , mka@chromium.org, evgreen@chromium.org, swboyd@chromium.org, Lina Iyer , Douglas Anderson , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFT PATCH 4/9] drivers: qcom: rpmh-rsc: Remove get_tcs_of_type() abstraction Date: Fri, 6 Mar 2020 15:59:46 -0800 Message-Id: <20200306155707.RFT.4.Ia348ade7c6ed1d0d952ff2245bc854e5834c8d9a@changeid> X-Mailer: git-send-email 2.25.1.481.gfbce0eb801-goog In-Reply-To: <20200306235951.214678-1-dianders@chromium.org> References: <20200306235951.214678-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 --- 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 099603bf14bf..a1298035bcd2 100644 --- a/drivers/soc/qcom/rpmh-rsc.c +++ b/drivers/soc/qcom/rpmh-rsc.c @@ -169,17 +169,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)) { @@ -245,9 +238,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