spi: npcm-fiu: Remove repeated test
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Tue, 12 Aug 2025 16:29:07 +0000 (17:29 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 28 Oct 2025 16:33:00 +0000 (10:33 -0600)
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 <andrew.goodbody@linaro.org>
drivers/spi/npcm_fiu_spi.c

index 7b8271c..761ef8c 100644 (file)
@@ -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], &regs->uma_dw0);
+               writel(data_reg[0], &regs->uma_dw0);
                if (nbytes > DW_SIZE)
                        writel(data_reg[1], &regs->uma_dw1);
                if (nbytes > DW_SIZE * 2)