]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
spi: bfin_spi6xx: Use BIT macro
authorJagan Teki <jteki@openedev.com>
Thu, 22 Oct 2015 20:05:47 +0000 (01:35 +0530)
committerJagan Teki <jteki@openedev.com>
Tue, 27 Oct 2015 17:49:29 +0000 (23:19 +0530)
Replace numerical bit shift with BIT macro
in bfin_spi6xx

:%s/(1 << nr)/BIT(nr)/g
where nr = 0, 1, 2 .... 31

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Jagan Teki <jteki@openedev.com>
drivers/spi/bfin_spi6xx.c

index eba01d16f50d7d6f095cf87625624a7b33fd1ef7..8359d760f95d5822152fbf83fa46238bbf421eb2 100644 (file)
@@ -63,9 +63,9 @@ void spi_cs_activate(struct spi_slave *slave)
                ssel = bfin_read32(&bss->regs->ssel);
                ssel |= 1 << slave->cs;
                if (bss->cs_pol)
-                       ssel |= (1 << 8) << slave->cs;
+                       ssel |= BIT(8) << slave->cs;
                else
-                       ssel &= ~((1 << 8) << slave->cs);
+                       ssel &= ~(BIT(8) << slave->cs);
                bfin_write32(&bss->regs->ssel, ssel);
        }
 
@@ -83,9 +83,9 @@ void spi_cs_deactivate(struct spi_slave *slave)
                u32 ssel;
                ssel = bfin_read32(&bss->regs->ssel);
                if (bss->cs_pol)
-                       ssel &= ~((1 << 8) << slave->cs);
+                       ssel &= ~(BIT(8) << slave->cs);
                else
-                       ssel |= (1 << 8) << slave->cs;
+                       ssel |= BIT(8) << slave->cs;
                /* deassert cs */
                bfin_write32(&bss->regs->ssel, ssel);
                SSYNC();