From 9a6411daed49300a4182a0494d5a5a3b9f446429 Mon Sep 17 00:00:00 2001 From: Andrew Goodbody Date: Tue, 12 Aug 2025 17:29:07 +0100 Subject: [PATCH] spi: npcm-fiu: Remove repeated test In npcm_fiu_uma_operation to enter a code block nbytes must be non-zero. So testing for nbytes inside the code block is redundant and can be removed. This issue was found by Smatch. Signed-off-by: Andrew Goodbody --- drivers/spi/npcm_fiu_spi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/spi/npcm_fiu_spi.c b/drivers/spi/npcm_fiu_spi.c index 7b8271c8bbc..761ef8c058b 100644 --- a/drivers/spi/npcm_fiu_spi.c +++ b/drivers/spi/npcm_fiu_spi.c @@ -273,8 +273,7 @@ static int npcm_fiu_uma_operation(struct npcm_fiu_priv *priv, const struct spi_m if (op->data.dir == SPI_MEM_DATA_OUT && nbytes) { memcpy(data_reg, tx, nbytes); - if (nbytes) - writel(data_reg[0], ®s->uma_dw0); + writel(data_reg[0], ®s->uma_dw0); if (nbytes > DW_SIZE) writel(data_reg[1], ®s->uma_dw1); if (nbytes > DW_SIZE * 2) -- 2.47.3