mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "William A. Kennington III" <william@wkennington.com>,
	Mark Brown <broonie@kernel.org>, Sasha Levin <sashal@kernel.org>,
	avifishman70@gmail.com, tmaimon77@gmail.com,
	tali.perry1@gmail.com, openbmc@lists.ozlabs.org,
	linux-spi@vger.kernel.org
Subject: [PATCH AUTOSEL 5.4 02/13] spi: npcm-fiu: Fix UMA reads when dummy.nbytes == 0
Date: Sun, 29 Oct 2023 19:00:35 -0400	[thread overview]
Message-ID: <20231029230057.792930-2-sashal@kernel.org> (raw)
In-Reply-To: <20231029230057.792930-1-sashal@kernel.org>

From: "William A. Kennington III" <william@wkennington.com>

[ Upstream commit 2ec8b010979036c2fe79a64adb6ecc0bd11e91d1 ]

We don't want to use the value of ilog2(0) as dummy.buswidth is 0 when
dummy.nbytes is 0. Since we have no dummy bytes, we don't need to
configure the dummy byte bits per clock register value anyway.

Signed-off-by: "William A. Kennington III" <william@wkennington.com>
Link: https://lore.kernel.org/r/20230922182812.2728066-1-william@wkennington.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/spi/spi-npcm-fiu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-npcm-fiu.c b/drivers/spi/spi-npcm-fiu.c
index 1e770d6739050..cc4e29cd86dab 100644
--- a/drivers/spi/spi-npcm-fiu.c
+++ b/drivers/spi/spi-npcm-fiu.c
@@ -334,8 +334,9 @@ static int npcm_fiu_uma_read(struct spi_mem *mem,
 		uma_cfg |= ilog2(op->cmd.buswidth);
 		uma_cfg |= ilog2(op->addr.buswidth)
 			<< NPCM_FIU_UMA_CFG_ADBPCK_SHIFT;
-		uma_cfg |= ilog2(op->dummy.buswidth)
-			<< NPCM_FIU_UMA_CFG_DBPCK_SHIFT;
+		if (op->dummy.nbytes)
+			uma_cfg |= ilog2(op->dummy.buswidth)
+				<< NPCM_FIU_UMA_CFG_DBPCK_SHIFT;
 		uma_cfg |= ilog2(op->data.buswidth)
 			<< NPCM_FIU_UMA_CFG_RDBPCK_SHIFT;
 		uma_cfg |= op->dummy.nbytes << NPCM_FIU_UMA_CFG_DBSIZ_SHIFT;
-- 
2.42.0


  reply	other threads:[~2023-10-29 23:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-29 23:00 [PATCH AUTOSEL 5.4 01/13] fbdev: atyfb: only use ioremap_uc() on i386 and ia64 Sasha Levin
2023-10-29 23:00 ` Sasha Levin [this message]
2023-10-29 23:00 ` [PATCH AUTOSEL 5.4 03/13] net: ipv6: fix return value check in esp_remove_trailer Sasha Levin
2023-10-29 23:00 ` [PATCH AUTOSEL 5.4 04/13] net: ipv4: " Sasha Levin
2023-10-29 23:00 ` [PATCH AUTOSEL 5.4 05/13] Bluetooth: vhci: Fix race when opening vhci device Sasha Levin
2023-10-29 23:00 ` [PATCH AUTOSEL 5.4 06/13] netfilter: nfnetlink_log: silence bogus compiler warning Sasha Levin
2023-10-29 23:00 ` [PATCH AUTOSEL 5.4 07/13] ASoC: rt5650: fix the wrong result of key button Sasha Levin
2023-10-29 23:00 ` [PATCH AUTOSEL 5.4 08/13] fbdev: uvesafb: Call cn_del_callback() at the end of uvesafb_exit() Sasha Levin
2023-10-29 23:00 ` [PATCH AUTOSEL 5.4 09/13] fbdev: core: cfbcopyarea: fix sloppy typing Sasha Levin
2023-10-29 23:00 ` [PATCH AUTOSEL 5.4 10/13] fbdev: core: syscopyarea: " Sasha Levin
2023-10-29 23:00 ` [PATCH AUTOSEL 5.4 11/13] scsi: mpt3sas: Fix in error path Sasha Levin
2023-10-29 23:00 ` [PATCH AUTOSEL 5.4 12/13] platform/x86: asus-wmi: Change ASUS_WMI_BRN_DOWN code from 0x20 to 0x2e Sasha Levin
2023-10-29 23:00 ` [PATCH AUTOSEL 5.4 13/13] platform/mellanox: mlxbf-tmfifo: Fix a warning message Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231029230057.792930-2-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=avifishman70@gmail.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=openbmc@lists.ozlabs.org \
    --cc=stable@vger.kernel.org \
    --cc=tali.perry1@gmail.com \
    --cc=tmaimon77@gmail.com \
    --cc=william@wkennington.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome