Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp369ybz; Thu, 30 Apr 2020 15:15:29 -0700 (PDT) X-Google-Smtp-Source: APiQypK72FSekKItc5+aelHZ8aNDcvszemDaXD4T6cngheoDf53I4203Dwon8GpDBY7hRND7F17Q X-Received: by 2002:a17:906:4903:: with SMTP id b3mr598456ejq.80.1588284928861; Thu, 30 Apr 2020 15:15:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588284928; cv=none; d=google.com; s=arc-20160816; b=P5OGb5tcmWJd1qeTU4SIGytVQO72ql87W8XsE+24pp/Ch/PHNCeuTprl/dfemoAuN0 qqTi1Q8Kwee5hoGf6qH6vYkOL3gdVYmYboMqs4iMDXXDppNDTqtBkmM9M4XHTDI+pvSn DYl0hR56T3I7taM2F6cfvls5TkA97IDq6QHYjHmvGOTCtnLQnJLC+82dbnKaHzAtT1/g OSTqM8RF82hu81c1CI0hXe1QC9HJ9kNjkOyllLwDpLm2ctejwKi1NE1fiw71HGwWypIT MXIfHgrvwty1lHapC+FWiPwiZ/dRjQ3Z0UNJzyvRNEeVjQlQvbatFJaEjzDy2PRLn4pV gucg== 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=1eX7WSK+5t5gndojFUhLnWThbbKlBFG3tYGdIpF55Xw=; b=ALmQFD2ZU9Bn/v2r9r+tILmVAaX9qitcUPHRP3P5t7KRD8ZPFC3+sVDBHPCaL3Li3n bsZht+svbF5Cwi6U9ePPWlQdZoYhGcuxWScggf5op6UWfCHlglgE8U6P3Xz9czdGiTuU wuyJj+WLRcR3T9Asjao3XD8R5FkstUKaOMk9KCTbi7m5HVQUGHZXEGxUllSgEdob3/6k F0jXXgPP/F9/5Ujn1PPWvUw2aUDrdGSPeJYyLTOfMCeasRHeUGtKzicrs1abDHfBWuws lYZ2dRWEiY1gB4r5X/GKrfPK5oxl9FTayTFg1CzaA9Nzk3Pf75wh7vjx4R/K9oEmvJqL iN4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ks5peESQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v28si482773edb.497.2020.04.30.15.15.03; Thu, 30 Apr 2020 15:15:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ks5peESQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727074AbgD3WNe (ORCPT + 99 others); Thu, 30 Apr 2020 18:13:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726336AbgD3WNc (ORCPT ); Thu, 30 Apr 2020 18:13:32 -0400 Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16E4AC035495 for ; Thu, 30 Apr 2020 15:13:32 -0700 (PDT) Received: by mail-qk1-x744.google.com with SMTP id s9so4831922qkm.6 for ; Thu, 30 Apr 2020 15:13:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1eX7WSK+5t5gndojFUhLnWThbbKlBFG3tYGdIpF55Xw=; b=ks5peESQSMAP6mY2kYfPMOd79E2Eo9HhU4hymwuP408laGbs3/CSQho1C9UKZzUJes Xs8/wUEc+G9aBGnCSbiqbZoESQNDCLqPLTja+Hu3cGlcX+hku+LAUUltTeC6NbbpWPum EAYB541Wf5S0wAd/yy1xuCAqH04URkMgJYpvUTkeT8AYzYTifFCwEiYPtAKL7okAgT3O EBJMFjVOlXTPfuF9yFFXYXa0U5Az+idqTbj0CbyPYkOWrQ3TRmMpeveUDFkmKS1cG4Nb 3tBr4zb6muxFs8j2yI6yuJNH50PjfkDVWpSYzf9J9WtICxJgJcuuAvCErYB6mO/kLE+1 zD2Q== 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=1eX7WSK+5t5gndojFUhLnWThbbKlBFG3tYGdIpF55Xw=; b=Y/jCrfeftRKC0MAc9RW5vdI2+PeLu8iwxKtmdNgbICF64Gdvi2UJAhDP1YI9F3ZNNc Axoz97IjmfQg67i033ecsZIVwrSCBvyGtj2RVeBbJKaQtZKU19+TGdmkiIyKU+niAER7 xD4wO9xDXuJCUF38V/qQ98FHQl7tsMe9T7j7iliVZtAXnr6mKtv6lBHphy+yeUMSVD2D 4LP0GC8HJY44QLpGXuoDuMBwnNyg+UCXFeODvC3W8gAz9qi0AD/2+yYBnastm+8zm3Co nnl40o06lzyMVWv6aNvzNr3oKF925LAL2t7MF9ZZLJqWMHMf45hRV4/jWu1qUL2CaKfb G+3w== X-Gm-Message-State: AGi0PuYI5iHtNt4K3hbEtMdqCfX+YITeNYmSGEaNDnlrYfNlrFyROoL7 sz4GKdr+9pfq37cJgTJQ6CpWqFVEsXM= X-Received: by 2002:a05:620a:c8c:: with SMTP id q12mr781886qki.74.1588284811293; Thu, 30 Apr 2020 15:13:31 -0700 (PDT) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id w42sm957028qtj.63.2020.04.30.15.13.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 15:13:30 -0700 (PDT) From: Alex Elder To: davem@davemloft.net Cc: evgreen@chromium.org.net, subashab@codeaurora.org, cpratapa@codeaurora.org, bjorn.andersson@linaro.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 1/2] net: ipa: pass channel pointer to gsi_channel_state() Date: Thu, 30 Apr 2020 17:13:22 -0500 Message-Id: <20200430221323.5449-2-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430221323.5449-1-elder@linaro.org> References: <20200430221323.5449-1-elder@linaro.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 Pass a channel pointer rather than a GSI pointer and channel ID to gsi_channel_state(). Signed-off-by: Alex Elder --- drivers/net/ipa/gsi.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c index 845478a19a4f..6946c39b664a 100644 --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -416,12 +416,13 @@ static void gsi_evt_ring_de_alloc_command(struct gsi *gsi, u32 evt_ring_id) } /* Return the hardware's notion of the current state of a channel */ -static enum gsi_channel_state -gsi_channel_state(struct gsi *gsi, u32 channel_id) +static enum gsi_channel_state gsi_channel_state(struct gsi_channel *channel) { + u32 channel_id = gsi_channel_id(channel); + void *virt = channel->gsi->virt; u32 val; - val = ioread32(gsi->virt + GSI_CH_C_CNTXT_0_OFFSET(channel_id)); + val = ioread32(virt + GSI_CH_C_CNTXT_0_OFFSET(channel_id)); return u32_get_bits(val, CHSTATE_FMASK); } @@ -453,7 +454,7 @@ static int gsi_channel_alloc_command(struct gsi *gsi, u32 channel_id) int ret; /* Get initial channel state */ - channel->state = gsi_channel_state(gsi, channel_id); + channel->state = gsi_channel_state(channel); if (channel->state != GSI_CHANNEL_STATE_NOT_ALLOCATED) return -EINVAL; @@ -940,7 +941,7 @@ static void gsi_isr_chan_ctrl(struct gsi *gsi) channel_mask ^= BIT(channel_id); channel = &gsi->channel[channel_id]; - channel->state = gsi_channel_state(gsi, channel_id); + channel->state = gsi_channel_state(channel); complete(&channel->completion); } -- 2.20.1