]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
spi: cadence-qspi: Remove an useless operation
authorMiquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
Thu, 22 Jan 2026 15:13:31 +0000 (16:13 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 28 Jan 2026 20:41:22 +0000 (20:41 +0000)
Right above writing the register value back based on 'div' value, there
is the following check:

    if (div > CQSPI_REG_CONFIG_BAUD_MASK)
            div = CQSPI_REG_CONFIG_BAUD_MASK;

which means div does not need to be AND'ed against the bitfield mask.

Remove this redundant operation.

Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
Tested-by: Santhosh Kumar K <s-k6@ti.com>
Link: https://patch.msgid.link/20260122-schneider-6-19-rc1-qspi-v4-6-f9c21419a3e6@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-cadence-quadspi.c

index c94f827afe2fc7cbed79d188f1c4bbe2d6b38419..a8437d9c37a79ed588ddd4900328acabf16e1f10 100644 (file)
@@ -1258,7 +1258,7 @@ static void cqspi_config_baudrate_div(struct cqspi_st *cqspi)
 
        reg = readl(reg_base + CQSPI_REG_CONFIG);
        reg &= ~(CQSPI_REG_CONFIG_BAUD_MASK << CQSPI_REG_CONFIG_BAUD_LSB);
-       reg |= (div & CQSPI_REG_CONFIG_BAUD_MASK) << CQSPI_REG_CONFIG_BAUD_LSB;
+       reg |= div << CQSPI_REG_CONFIG_BAUD_LSB;
        writel(reg, reg_base + CQSPI_REG_CONFIG);
 }