[U-Boot] [PATCH v4 03/24] spi: altera_spi: Use BIT macro
Jagan Teki
jteki at openedev.com
Thu Oct 22 22:50:03 CEST 2015
Replace numerical bit shift with BIT macro in altera_spi
:%s/(1 << nr)/BIT(nr)/g
where nr = 0, 1, 2 .... 31
Cc: Marek Vasut <marex at denx.de>
Signed-off-by: Jagan Teki <jteki at openedev.com>
---
drivers/spi/altera_spi.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/spi/altera_spi.c b/drivers/spi/altera_spi.c
index a4d03d9..2302117 100644
--- a/drivers/spi/altera_spi.c
+++ b/drivers/spi/altera_spi.c
@@ -29,19 +29,19 @@ struct altera_spi_regs {
u32 slave_sel;
};
-#define ALTERA_SPI_STATUS_ROE_MSK (1 << 3)
-#define ALTERA_SPI_STATUS_TOE_MSK (1 << 4)
-#define ALTERA_SPI_STATUS_TMT_MSK (1 << 5)
-#define ALTERA_SPI_STATUS_TRDY_MSK (1 << 6)
-#define ALTERA_SPI_STATUS_RRDY_MSK (1 << 7)
-#define ALTERA_SPI_STATUS_E_MSK (1 << 8)
-
-#define ALTERA_SPI_CONTROL_IROE_MSK (1 << 3)
-#define ALTERA_SPI_CONTROL_ITOE_MSK (1 << 4)
-#define ALTERA_SPI_CONTROL_ITRDY_MSK (1 << 6)
-#define ALTERA_SPI_CONTROL_IRRDY_MSK (1 << 7)
-#define ALTERA_SPI_CONTROL_IE_MSK (1 << 8)
-#define ALTERA_SPI_CONTROL_SSO_MSK (1 << 10)
+#define ALTERA_SPI_STATUS_ROE_MSK BIT(3)
+#define ALTERA_SPI_STATUS_TOE_MSK BIT(4)
+#define ALTERA_SPI_STATUS_TMT_MSK BIT(5)
+#define ALTERA_SPI_STATUS_TRDY_MSK BIT(6)
+#define ALTERA_SPI_STATUS_RRDY_MSK BIT(7)
+#define ALTERA_SPI_STATUS_E_MSK BIT(8)
+
+#define ALTERA_SPI_CONTROL_IROE_MSK BIT(3)
+#define ALTERA_SPI_CONTROL_ITOE_MSK BIT(4)
+#define ALTERA_SPI_CONTROL_ITRDY_MSK BIT(6)
+#define ALTERA_SPI_CONTROL_IRRDY_MSK BIT(7)
+#define ALTERA_SPI_CONTROL_IE_MSK BIT(8)
+#define ALTERA_SPI_CONTROL_SSO_MSK BIT(10)
static ulong altera_spi_base_list[] = CONFIG_SYS_ALTERA_SPI_LIST;
--
1.9.1
More information about the U-Boot
mailing list