From: Mario Six Date: Sun, 28 Apr 2019 20:28:43 +0000 (+0530) Subject: spi: mpc8xxx: Simplify if X-Git-Tag: v2019.07-rc4~1^2~11 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=76c82afef353aa4f36a22bf2d2ed5e53bba931f0;p=oweals%2Fu-boot.git spi: mpc8xxx: Simplify if Instead of having a nested if block, just have two branches within the overarching if block to eliminate one nesting level. Signed-off-by: Mario Six Acked-by: Jagan Teki --- diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index da9e1e3f98..ca34570901 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -120,13 +120,11 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, clrbits_be32(&spi->mode, SPI_MODE_EN); - if (bitlen <= 16) { - if (bitlen <= 4) - clrsetbits_be32(&spi->mode, 0x00f00000, - (3 << 20)); - else - clrsetbits_be32(&spi->mode, 0x00f00000, - ((bitlen - 1) << 20)); + if (bitlen <= 4) { + clrsetbits_be32(&spi->mode, 0x00f00000, (3 << 20)); + } else if (bitlen <= 16) { + clrsetbits_be32(&spi->mode, 0x00f00000, + ((bitlen - 1) << 20)); } else { clrbits_be32(&spi->mode, 0x00f00000); /* Set up the next iteration if sending > 32 bits */