From nobody Tue Dec 30 09:50:58 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B437C54FB9 for ; Fri, 17 Nov 2023 20:14:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346262AbjKQUO2 (ORCPT ); Fri, 17 Nov 2023 15:14:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346223AbjKQUOT (ORCPT ); Fri, 17 Nov 2023 15:14:19 -0500 Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 287741727 for ; Fri, 17 Nov 2023 12:14:01 -0800 (PST) Received: by mail-oi1-x232.google.com with SMTP id 5614622812f47-3b3e13fc1f7so1496423b6e.0 for ; Fri, 17 Nov 2023 12:14:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1700252040; x=1700856840; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zreOIPUyiZAgHTr9pZpsQXo6OBnZGTBQCaGdmdfM/3Q=; b=zoLAan9fa7rF1Edza9nm2jZE0ZBA2io3ee+yQtzpom8/qDZNmf1O2inL7rvBihiqXt uSKPLQcs1pynXpmq7QkhlUa/ts1LLe1MhE5Bq1Tejlu3WRjKEy1rybpUqZHtovTjacwF C+ROjK58rYm5bH32qxjS34t59j539+SG+xgAWf2388nKTANOJ12A21PlkuBP2bAtgi2x c5dl/2ktAwHeJL1RDvKxHGZSn7SPVfBWW4P13t3SRQsZO+W6CxmFJ/jTieWDYBSJIeQo CaGDwtT4JrG724a+zDuKoWV8iV8YjsVVAQEXvu9JAJPfkWV9aT1XPSAl/wcPgYo+wMCb qMNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700252040; x=1700856840; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zreOIPUyiZAgHTr9pZpsQXo6OBnZGTBQCaGdmdfM/3Q=; b=ZcRZauHhZnv0YG7kgj1NmOlxJ8hcYkOkChCqnwmTYLOwWtXqxXyGyRcDEZJJTocvzh 8K13W7qgKVIPjmoEr5xOuIkic9C9uCVymsJFh8BJPeA/E3JLLkjNP0ggwZUL4JjGuFET NVhCapDQ750LzST/rHlA2NI3w7DL7gnmsVShZ5ffCc2G8iCixwmR9A/c8H8KkYjZO+KX U51ByHyG/2tJFrktyX4KoDPMYvHU9/lQ743qsC6ntn6Ma4+rXNZO3iwl0D42yE3D0CL2 FpswF8uhTj4eOnOM5L+d806MJtJ3jbkCtDZN9o19e9KEAO8EXBSnFy46D57NpP2rZJw1 n37Q== X-Gm-Message-State: AOJu0YyMJ6oe7OjcUqwu840bZ4xEcWjjJQDhBoAmkcnomFGZaCvxws2M L01uxjbs1kqvIOE+a/sUu39X4w== X-Google-Smtp-Source: AGHT+IEqiwWYiN6HZnqgB/+CsCCnBfOkvomVsWS+AdUE9yqrHGAW/CfIPxPRNw63N4msQ3nIF68LFQ== X-Received: by 2002:a05:6808:60b:b0:3b2:a9bd:c38f with SMTP id y11-20020a056808060b00b003b2a9bdc38fmr428452oih.37.1700252040479; Fri, 17 Nov 2023 12:14:00 -0800 (PST) Received: from freyr.lechnology.com (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id l21-20020a544515000000b003a8560a9d34sm393814oil.25.2023.11.17.12.13.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 12:13:59 -0800 (PST) From: David Lechner To: linux-spi@vger.kernel.org, devicetree@vger.kernel.org Cc: David Lechner , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Lars-Peter Clausen , linux-kernel@vger.kernel.org Subject: [PATCH 11/14] spi: axi-spi-engine: remove completed_id from driver state Date: Fri, 17 Nov 2023 14:13:02 -0600 Message-ID: <20231117-axi-spi-engine-series-1-v1-11-cc59db999b87@baylibre.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231117-axi-spi-engine-series-1-v1-0-cc59db999b87@baylibre.com> References: <20231117-axi-spi-engine-series-1-v1-0-cc59db999b87@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Mailer: b4 0.12.4 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the AXI SPI Engine driver, the completed_id field in the driver state is only used in one function and the value does not need to persist between function calls. Therefore, it can be removed from the driver state and made a local variable in the function where it is used. Signed-off-by: David Lechner --- drivers/spi/spi-axi-spi-engine.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-axi-spi-engine.c b/drivers/spi/spi-axi-spi-eng= ine.c index 210bea23f433..120001dbc4dc 100644 --- a/drivers/spi/spi-axi-spi-engine.c +++ b/drivers/spi/spi-axi-spi-engine.c @@ -115,7 +115,6 @@ struct spi_engine { =20 struct spi_message *msg; struct ida sync_ida; - unsigned int completed_id; =20 unsigned int int_enable; }; @@ -380,13 +379,14 @@ static irqreturn_t spi_engine_irq(int irq, void *devi= d) struct spi_engine *spi_engine =3D spi_controller_get_devdata(host); unsigned int disable_int =3D 0; unsigned int pending; + int completed_id =3D -1; =20 pending =3D readl_relaxed(spi_engine->base + SPI_ENGINE_REG_INT_PENDING); =20 if (pending & SPI_ENGINE_INT_SYNC) { writel_relaxed(SPI_ENGINE_INT_SYNC, spi_engine->base + SPI_ENGINE_REG_INT_PENDING); - spi_engine->completed_id =3D readl_relaxed( + completed_id =3D readl_relaxed( spi_engine->base + SPI_ENGINE_REG_SYNC_ID); } =20 @@ -410,7 +410,7 @@ static irqreturn_t spi_engine_irq(int irq, void *devid) if (pending & SPI_ENGINE_INT_SYNC && spi_engine->msg) { struct spi_engine_message_state *st =3D spi_engine->msg->state; =20 - if (spi_engine->completed_id =3D=3D st->sync_id) { + if (completed_id =3D=3D st->sync_id) { struct spi_message *msg =3D spi_engine->msg; =20 msg->status =3D 0; --=20 2.42.0