Skip to contentSkip to conversation

serial: altera_jtag_uart: use BIT macro

PATCH New Thomas Chou 2 participants 24 messages Oct 30, 2015 – Nov 3, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/8 serial: altera_jtag_uart: use BIT macro

Replace numerical bit shift with BIT macro
in altera_jtag_uart

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

---
 drivers/serial/altera_jtag_uart.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/serial/altera_jtag_uart.c +3 -3
index 39d4a4e..0aa741c 100644
@@ -22,11 +22,11 @@ struct altera_jtaguart_platdata {
 };
 
 /* data register */
-#define ALTERA_JTAG_RVALID	(1<<15)		/* Read valid */
+#define ALTERA_JTAG_RVALID	BIT(15)	/* Read valid */
 
 /* control register */
-#define ALTERA_JTAG_AC		(1 << 10)	/* activity indicator */
-#define ALTERA_JTAG_RRDY	(1 << 12)	/* read available */
+#define ALTERA_JTAG_AC		BIT(10)	/* activity indicator */
+#define ALTERA_JTAG_RRDY	BIT(12)	/* read available */
 #define ALTERA_JTAG_WSPACE(d)	((d)>>16)	/* Write space avail */
 /* Write fifo size. FIXME: this should be extracted with sopc2dts */
 #define ALTERA_JTAG_WRITE_DEPTH	64
Signature · 1 line
2.5.0
#1 lore raw

PATCH 1/8 serial: altera_jtag_uart: use BIT macro

Quoted 11 lines · Thomas Chou

Replace numerical bit shift with BIT macro
in altera_jtag_uart

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

---
  drivers/serial/altera_jtag_uart.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

Applied to u-boot-nios.

Quoted 20 lines
drivers/serial/altera_jtag_uart.c +3 -3
index 39d4a4e..0aa741c 100644
@@ -22,11 +22,11 @@ struct altera_jtaguart_platdata {
  };
 
  /* data register */
-#define ALTERA_JTAG_RVALID	(1<<15)		/* Read valid */
+#define ALTERA_JTAG_RVALID	BIT(15)	/* Read valid */
 
  /* control register */
-#define ALTERA_JTAG_AC		(1 << 10)	/* activity indicator */
-#define ALTERA_JTAG_RRDY	(1 << 12)	/* read available */
+#define ALTERA_JTAG_AC		BIT(10)	/* activity indicator */
+#define ALTERA_JTAG_RRDY	BIT(12)	/* read available */
  #define ALTERA_JTAG_WSPACE(d)	((d)>>16)	/* Write space avail */
  /* Write fifo size. FIXME: this should be extracted with sopc2dts */
  #define ALTERA_JTAG_WRITE_DEPTH	64
#2 lore raw

PATCH 2/8 serial: altera_jtag_uart: minor clean up

In reply to Thomas Chou

- Moved macro definitions to top
- Give spaces around the '>>' in ALTERA_JTAG_WSPACE()
- Re-arrange header includes ascending order
- Remove unused header linux/compiler.h
- Remove the penultimate comma in of_match ids

---
 drivers/serial/altera_jtag_uart.c | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)
drivers/serial/altera_jtag_uart.c +12 -13
index 0aa741c..fd69188 100644
@@ -8,18 +8,10 @@
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
-#include <asm/io.h>
-#include <linux/compiler.h>
 #include <serial.h>
+#include <asm/io.h>
 
-struct altera_jtaguart_regs {
-	u32	data;			/* Data register */
-	u32	control;		/* Control register */
-};
-
-struct altera_jtaguart_platdata {
-	struct altera_jtaguart_regs *regs;
-};
+DECLARE_GLOBAL_DATA_PTR;
 
 /* data register */
 #define ALTERA_JTAG_RVALID	BIT(15)	/* Read valid */
@@ -27,11 +19,18 @@ struct altera_jtaguart_platdata {
 /* control register */
 #define ALTERA_JTAG_AC		BIT(10)	/* activity indicator */
 #define ALTERA_JTAG_RRDY	BIT(12)	/* read available */
-#define ALTERA_JTAG_WSPACE(d)	((d)>>16)	/* Write space avail */
+#define ALTERA_JTAG_WSPACE(d)	((d) >> 16)	/* Write space avail */
 /* Write fifo size. FIXME: this should be extracted with sopc2dts */
 #define ALTERA_JTAG_WRITE_DEPTH	64
 
-DECLARE_GLOBAL_DATA_PTR;
+struct altera_jtaguart_regs {
+	u32	data;			/* Data register */
+	u32	control;		/* Control register */
+};
+
+struct altera_jtaguart_platdata {
+	struct altera_jtaguart_regs *regs;
+};
 
 static int altera_jtaguart_setbrg(struct udevice *dev, int baudrate)
 {
@@ -112,7 +111,7 @@ static const struct dm_serial_ops altera_jtaguart_ops = {
 };
 
 static const struct udevice_id altera_jtaguart_ids[] = {
-	{ .compatible = "altr,juart-1.0", },
+	{ .compatible = "altr,juart-1.0" },
 	{ }
 };
 
Signature · 1 line
2.5.0
#3 lore raw

PATCH 2/8 serial: altera_jtag_uart: minor clean up

Quoted 8 lines · Thomas Chou

- Moved macro definitions to top
- Give spaces around the '>>' in ALTERA_JTAG_WSPACE()
- Re-arrange header includes ascending order
- Remove unused header linux/compiler.h
- Remove the penultimate comma in of_match ids

---

Quoted 59 lines
 drivers/serial/altera_jtag_uart.c | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)
drivers/serial/altera_jtag_uart.c +12 -14
index 0aa741c..fd69188 100644
@@ -8,18 +8,10 @@
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
-#include <asm/io.h>
-#include <linux/compiler.h>
 #include <serial.h>
+#include <asm/io.h>
 
-struct altera_jtaguart_regs {
-       u32     data;                   /* Data register */
-       u32     control;                /* Control register */
-};
-
-struct altera_jtaguart_platdata {
-       struct altera_jtaguart_regs *regs;
-};
+DECLARE_GLOBAL_DATA_PTR;
 
 /* data register */
 #define ALTERA_JTAG_RVALID     BIT(15) /* Read valid */
@@ -27,11 +19,18 @@ struct altera_jtaguart_platdata {
 /* control register */
 #define ALTERA_JTAG_AC         BIT(10) /* activity indicator */
 #define ALTERA_JTAG_RRDY       BIT(12) /* read available */
-#define ALTERA_JTAG_WSPACE(d)  ((d)>>16)       /* Write space avail */
+#define ALTERA_JTAG_WSPACE(d)  ((d) >> 16)     /* Write space avail */
 /* Write fifo size. FIXME: this should be extracted with sopc2dts */
 #define ALTERA_JTAG_WRITE_DEPTH        64
 
-DECLARE_GLOBAL_DATA_PTR;
+struct altera_jtaguart_regs {
+       u32     data;                   /* Data register */
+       u32     control;                /* Control register */
+};
+
+struct altera_jtaguart_platdata {
+       struct altera_jtaguart_regs *regs;
+};
 
 static int altera_jtaguart_setbrg(struct udevice *dev, int baudrate)
 {
@@ -112,7 +111,7 @@ static const struct dm_serial_ops altera_jtaguart_ops = {
 };
 
 static const struct udevice_id altera_jtaguart_ids[] = {
-       { .compatible = "altr,juart-1.0", },
+       { .compatible = "altr,juart-1.0" },
        { }
 };
 
--
Quoted 1 line

2.5.0

thanks!

Signature · 1 line
Jagan | openedev.
#4 lore raw

PATCH 2/8 serial: altera_jtag_uart: minor clean up

In reply to Thomas Chou
Quoted 11 lines · Thomas Chou

- Moved macro definitions to top
- Give spaces around the '>>' in ALTERA_JTAG_WSPACE()
- Re-arrange header includes ascending order
- Remove unused header linux/compiler.h
- Remove the penultimate comma in of_match ids

---
  drivers/serial/altera_jtag_uart.c | 25 ++++++++++++-------------
  1 file changed, 12 insertions(+), 13 deletions(-)

Applied to u-boot-nios.

Quoted 56 lines
drivers/serial/altera_jtag_uart.c +12 -13
index 0aa741c..fd69188 100644
@@ -8,18 +8,10 @@
  #include <common.h>
  #include <dm.h>
  #include <errno.h>
-#include <asm/io.h>
-#include <linux/compiler.h>
  #include <serial.h>
+#include <asm/io.h>
 
-struct altera_jtaguart_regs {
-	u32	data;			/* Data register */
-	u32	control;		/* Control register */
-};
-
-struct altera_jtaguart_platdata {
-	struct altera_jtaguart_regs *regs;
-};
+DECLARE_GLOBAL_DATA_PTR;
 
  /* data register */
  #define ALTERA_JTAG_RVALID	BIT(15)	/* Read valid */
@@ -27,11 +19,18 @@ struct altera_jtaguart_platdata {
  /* control register */
  #define ALTERA_JTAG_AC		BIT(10)	/* activity indicator */
  #define ALTERA_JTAG_RRDY	BIT(12)	/* read available */
-#define ALTERA_JTAG_WSPACE(d)	((d)>>16)	/* Write space avail */
+#define ALTERA_JTAG_WSPACE(d)	((d) >> 16)	/* Write space avail */
  /* Write fifo size. FIXME: this should be extracted with sopc2dts */
  #define ALTERA_JTAG_WRITE_DEPTH	64
 
-DECLARE_GLOBAL_DATA_PTR;
+struct altera_jtaguart_regs {
+	u32	data;			/* Data register */
+	u32	control;		/* Control register */
+};
+
+struct altera_jtaguart_platdata {
+	struct altera_jtaguart_regs *regs;
+};
 
  static int altera_jtaguart_setbrg(struct udevice *dev, int baudrate)
  {
@@ -112,7 +111,7 @@ static const struct dm_serial_ops altera_jtaguart_ops = {
  };
 
  static const struct udevice_id altera_jtaguart_ids[] = {
-	{ .compatible = "altr,juart-1.0", },
+	{ .compatible = "altr,juart-1.0" },
  	{ }
  };
 
#5 lore raw

PATCH 3/8 serial: altera_uart: use BIT macro

In reply to Thomas Chou

Replace numerical bit shift with BIT macro
in altera_uart

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

---
 drivers/serial/altera_uart.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/serial/altera_uart.c +3 -3
index 4ff9fe2..7d5197a 100644
@@ -27,9 +27,9 @@ struct altera_uart_platdata {
 };
 
 /* status register */
-#define ALTERA_UART_TMT		(1 << 5)	/* tx empty */
-#define ALTERA_UART_TRDY	(1 << 6)	/* tx ready */
-#define ALTERA_UART_RRDY	(1 << 7)	/* rx ready */
+#define ALTERA_UART_TMT		BIT(5)	/* tx empty */
+#define ALTERA_UART_TRDY	BIT(6)	/* tx ready */
+#define ALTERA_UART_RRDY	BIT(7)	/* rx ready */
 
 DECLARE_GLOBAL_DATA_PTR;
 
Signature · 1 line
2.5.0
#6 lore raw

PATCH 3/8 serial: altera_uart: use BIT macro

Quoted 8 lines · Thomas Chou

Replace numerical bit shift with BIT macro
in altera_uart

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

---

Quoted 9 lines
 drivers/serial/altera_uart.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/serial/altera_uart.c +0 -0
index 4ff9fe2..7d5197a 100644
@@ -27,9 +27,9 @@ struct altera_uart_platdata {
 };

drivers/serial/altera_uart.c struct altera_uart_platdata { · line 34

Quoted 10 lines
drivers/serial/altera_uart.c +3 -3
 
 /* status register */
-#define ALTERA_UART_TMT                (1 << 5)        /* tx empty */
-#define ALTERA_UART_TRDY       (1 << 6)        /* tx ready */
-#define ALTERA_UART_RRDY       (1 << 7)        /* rx ready */
+#define ALTERA_UART_TMT                BIT(5)  /* tx empty */
+#define ALTERA_UART_TRDY       BIT(6)  /* tx ready */
+#define ALTERA_UART_RRDY       BIT(7)  /* rx ready */
 
 DECLARE_GLOBAL_DATA_PTR;

thanks!

Signature · 1 line
Jagan | openedev.
#7 lore raw

PATCH 3/8 serial: altera_uart: use BIT macro

In reply to Thomas Chou
Quoted 11 lines · Thomas Chou

Replace numerical bit shift with BIT macro
in altera_uart

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

---
  drivers/serial/altera_uart.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

Applied to u-boot-nios.

Quoted 18 lines
drivers/serial/altera_uart.c +3 -3
index 4ff9fe2..7d5197a 100644
@@ -27,9 +27,9 @@ struct altera_uart_platdata {
  };
 
  /* status register */
-#define ALTERA_UART_TMT		(1 << 5)	/* tx empty */
-#define ALTERA_UART_TRDY	(1 << 6)	/* tx ready */
-#define ALTERA_UART_RRDY	(1 << 7)	/* rx ready */
+#define ALTERA_UART_TMT		BIT(5)	/* tx empty */
+#define ALTERA_UART_TRDY	BIT(6)	/* tx ready */
+#define ALTERA_UART_RRDY	BIT(7)	/* rx ready */
 
  DECLARE_GLOBAL_DATA_PTR;
 
#8 lore raw

PATCH 4/8 serial: altera_uart: minor clean up

In reply to Thomas Chou

- Moved macro definitions to top
- Re-arrange header includes ascending order
- Remove unused header linux/compiler.h
- Remove the penultimate comma in of_match ids

---
 drivers/serial/altera_uart.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
drivers/serial/altera_uart.c +9 -10
index 7d5197a..cc68b1c 100644
@@ -8,9 +8,15 @@
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
-#include <asm/io.h>
-#include <linux/compiler.h>
 #include <serial.h>
+#include <asm/io.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* status register */
+#define ALTERA_UART_TMT		BIT(5)	/* tx empty */
+#define ALTERA_UART_TRDY	BIT(6)	/* tx ready */
+#define ALTERA_UART_RRDY	BIT(7)	/* rx ready */
 
 struct altera_uart_regs {
 	u32	rxdata;		/* Rx data reg */
@@ -26,13 +32,6 @@ struct altera_uart_platdata {
 	unsigned int uartclk;
 };
 
-/* status register */
-#define ALTERA_UART_TMT		BIT(5)	/* tx empty */
-#define ALTERA_UART_TRDY	BIT(6)	/* tx ready */
-#define ALTERA_UART_RRDY	BIT(7)	/* rx ready */
-
-DECLARE_GLOBAL_DATA_PTR;
-
 static int altera_uart_setbrg(struct udevice *dev, int baudrate)
 {
 	struct altera_uart_platdata *plat = dev->platdata;
@@ -106,7 +105,7 @@ static const struct dm_serial_ops altera_uart_ops = {
 };
 
 static const struct udevice_id altera_uart_ids[] = {
-	{ .compatible = "altr,uart-1.0", },
+	{ .compatible = "altr,uart-1.0" },
 	{ }
 };
 
Signature · 1 line
2.5.0
#9 lore raw

PATCH 4/8 serial: altera_uart: minor clean up

Quoted 7 lines · Thomas Chou

- Moved macro definitions to top
- Re-arrange header includes ascending order
- Remove unused header linux/compiler.h
- Remove the penultimate comma in of_match ids

---

Quoted 49 lines
 drivers/serial/altera_uart.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
drivers/serial/altera_uart.c +9 -11
index 7d5197a..cc68b1c 100644
@@ -8,9 +8,15 @@
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
-#include <asm/io.h>
-#include <linux/compiler.h>
 #include <serial.h>
+#include <asm/io.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* status register */
+#define ALTERA_UART_TMT                BIT(5)  /* tx empty */
+#define ALTERA_UART_TRDY       BIT(6)  /* tx ready */
+#define ALTERA_UART_RRDY       BIT(7)  /* rx ready */
 
 struct altera_uart_regs {
        u32     rxdata;         /* Rx data reg */
@@ -26,13 +32,6 @@ struct altera_uart_platdata {
        unsigned int uartclk;
 };
 
-/* status register */
-#define ALTERA_UART_TMT                BIT(5)  /* tx empty */
-#define ALTERA_UART_TRDY       BIT(6)  /* tx ready */
-#define ALTERA_UART_RRDY       BIT(7)  /* rx ready */
-
-DECLARE_GLOBAL_DATA_PTR;
-
 static int altera_uart_setbrg(struct udevice *dev, int baudrate)
 {
        struct altera_uart_platdata *plat = dev->platdata;
@@ -106,7 +105,7 @@ static const struct dm_serial_ops altera_uart_ops = {
 };
 
 static const struct udevice_id altera_uart_ids[] = {
-       { .compatible = "altr,uart-1.0", },
+       { .compatible = "altr,uart-1.0" },
        { }
 };
 
--
Quoted 1 line

2.5.0

thanks!

Signature · 1 line
Jagan | openedev.
#10 lore raw

PATCH 4/8 serial: altera_uart: minor clean up

In reply to Thomas Chou
Quoted 10 lines · Thomas Chou

- Moved macro definitions to top
- Re-arrange header includes ascending order
- Remove unused header linux/compiler.h
- Remove the penultimate comma in of_match ids

---
  drivers/serial/altera_uart.c | 19 +++++++++----------
  1 file changed, 9 insertions(+), 10 deletions(-)

Applied to u-boot-nios.

Quoted 46 lines
drivers/serial/altera_uart.c +9 -10
index 7d5197a..cc68b1c 100644
@@ -8,9 +8,15 @@
  #include <common.h>
  #include <dm.h>
  #include <errno.h>
-#include <asm/io.h>
-#include <linux/compiler.h>
  #include <serial.h>
+#include <asm/io.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* status register */
+#define ALTERA_UART_TMT		BIT(5)	/* tx empty */
+#define ALTERA_UART_TRDY	BIT(6)	/* tx ready */
+#define ALTERA_UART_RRDY	BIT(7)	/* rx ready */
 
  struct altera_uart_regs {
  	u32	rxdata;		/* Rx data reg */
@@ -26,13 +32,6 @@ struct altera_uart_platdata {
  	unsigned int uartclk;
  };
 
-/* status register */
-#define ALTERA_UART_TMT		BIT(5)	/* tx empty */
-#define ALTERA_UART_TRDY	BIT(6)	/* tx ready */
-#define ALTERA_UART_RRDY	BIT(7)	/* rx ready */
-
-DECLARE_GLOBAL_DATA_PTR;
-
  static int altera_uart_setbrg(struct udevice *dev, int baudrate)
  {
  	struct altera_uart_platdata *plat = dev->platdata;
@@ -106,7 +105,7 @@ static const struct dm_serial_ops altera_uart_ops = {
  };
 
  static const struct udevice_id altera_uart_ids[] = {
-	{ .compatible = "altr,uart-1.0", },
+	{ .compatible = "altr,uart-1.0" },
  	{ }
  };
 
#11 lore raw

PATCH 5/8 timer: altera_timer: use BIT macro

In reply to Thomas Chou

Replace numerical bit shift with BIT macro
in altera_timer

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

---
 drivers/timer/altera_timer.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/timer/altera_timer.c +3 -3
index 2ef9ad6..288357c 100644
@@ -31,9 +31,9 @@ struct altera_timer_platdata {
 };
 
 /* control register */
-#define ALTERA_TIMER_CONT	(1 << 1)	/* Continuous mode */
-#define ALTERA_TIMER_START	(1 << 2)	/* Start timer */
-#define ALTERA_TIMER_STOP	(1 << 3)	/* Stop timer */
+#define ALTERA_TIMER_CONT	BIT(1)	/* Continuous mode */
+#define ALTERA_TIMER_START	BIT(2)	/* Start timer */
+#define ALTERA_TIMER_STOP	BIT(3)	/* Stop timer */
 
 static int altera_timer_get_count(struct udevice *dev, unsigned long *count)
 {
Signature · 1 line
2.5.0
#12 lore raw

PATCH 5/8 timer: altera_timer: use BIT macro

Quoted 8 lines · Thomas Chou

Replace numerical bit shift with BIT macro
in altera_timer

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

---

Quoted 21 lines
 drivers/timer/altera_timer.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/timer/altera_timer.c +3 -4
index 2ef9ad6..288357c 100644
@@ -31,9 +31,9 @@ struct altera_timer_platdata {
 };
 
 /* control register */
-#define ALTERA_TIMER_CONT      (1 << 1)        /* Continuous mode */
-#define ALTERA_TIMER_START     (1 << 2)        /* Start timer */
-#define ALTERA_TIMER_STOP      (1 << 3)        /* Stop timer */
+#define ALTERA_TIMER_CONT      BIT(1)  /* Continuous mode */
+#define ALTERA_TIMER_START     BIT(2)  /* Start timer */
+#define ALTERA_TIMER_STOP      BIT(3)  /* Stop timer */
 
 static int altera_timer_get_count(struct udevice *dev, unsigned long *count)
 {
--
Quoted 1 line

2.5.0

thanks!

Signature · 1 line
Jagan | openedev.
#13 lore raw

PATCH 5/8 timer: altera_timer: use BIT macro

In reply to Thomas Chou
Quoted 11 lines · Thomas Chou

Replace numerical bit shift with BIT macro
in altera_timer

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

---
  drivers/timer/altera_timer.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

Applied to u-boot-nios.

Quoted 18 lines
drivers/timer/altera_timer.c +3 -3
index 2ef9ad6..288357c 100644
@@ -31,9 +31,9 @@ struct altera_timer_platdata {
  };
 
  /* control register */
-#define ALTERA_TIMER_CONT	(1 << 1)	/* Continuous mode */
-#define ALTERA_TIMER_START	(1 << 2)	/* Start timer */
-#define ALTERA_TIMER_STOP	(1 << 3)	/* Stop timer */
+#define ALTERA_TIMER_CONT	BIT(1)	/* Continuous mode */
+#define ALTERA_TIMER_START	BIT(2)	/* Start timer */
+#define ALTERA_TIMER_STOP	BIT(3)	/* Stop timer */
 
  static int altera_timer_get_count(struct udevice *dev, unsigned long *count)
  {
#14 lore raw

PATCH 6/8 timer: altera_timer: minor clean up

In reply to Thomas Chou

- Moved macro definitions to top
- Remove the penultimate comma in of_match ids

---
 drivers/timer/altera_timer.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/timer/altera_timer.c +6 -6
index 288357c..7952ad7 100644
@@ -16,6 +16,11 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+/* control register */
+#define ALTERA_TIMER_CONT	BIT(1)	/* Continuous mode */
+#define ALTERA_TIMER_START	BIT(2)	/* Start timer */
+#define ALTERA_TIMER_STOP	BIT(3)	/* Stop timer */
+
 struct altera_timer_regs {
 	u32	status;		/* Timer status reg */
 	u32	control;	/* Timer control reg */
@@ -30,11 +35,6 @@ struct altera_timer_platdata {
 	unsigned long clock_rate;
 };
 
-/* control register */
-#define ALTERA_TIMER_CONT	BIT(1)	/* Continuous mode */
-#define ALTERA_TIMER_START	BIT(2)	/* Start timer */
-#define ALTERA_TIMER_STOP	BIT(3)	/* Stop timer */
-
 static int altera_timer_get_count(struct udevice *dev, unsigned long *count)
 {
 	struct altera_timer_platdata *plat = dev->platdata;
@@ -88,7 +88,7 @@ static const struct timer_ops altera_timer_ops = {
 };
 
 static const struct udevice_id altera_timer_ids[] = {
-	{ .compatible = "altr,timer-1.0", },
+	{ .compatible = "altr,timer-1.0" },
 	{ }
 };
 
Signature · 1 line
2.5.0
#15 lore raw

PATCH 6/8 timer: altera_timer: minor clean up

Quoted 5 lines · Thomas Chou

- Moved macro definitions to top
- Remove the penultimate comma in of_match ids

---

Quoted 32 lines
 drivers/timer/altera_timer.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/timer/altera_timer.c +5 -5
index 288357c..7952ad7 100644
@@ -16,6 +16,11 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+/* control register */
+#define ALTERA_TIMER_CONT      BIT(1)  /* Continuous mode */
+#define ALTERA_TIMER_START     BIT(2)  /* Start timer */
+#define ALTERA_TIMER_STOP      BIT(3)  /* Stop timer */
+
 struct altera_timer_regs {
        u32     status;         /* Timer status reg */
        u32     control;        /* Timer control reg */
@@ -30,11 +35,6 @@ struct altera_timer_platdata {
        unsigned long clock_rate;
 };
 
-/* control register */
-#define ALTERA_TIMER_CONT      BIT(1)  /* Continuous mode */
-#define ALTERA_TIMER_START     BIT(2)  /* Start timer */
-#define ALTERA_TIMER_STOP      BIT(3)  /* Stop timer */
-
 static int altera_timer_get_count(struct udevice *dev, unsigned long *count)
 {
        struct altera_timer_platdata *plat = dev->platdata;

drivers/timer/altera_timer.c static const struct timer_ops altera_timer_ops = { · line 94

Quoted 8 lines
drivers/timer/altera_timer.c +1 -1
@@ -88,7 +88,7 @@ static const struct timer_ops altera_timer_ops = {
 };
 
 static const struct udevice_id altera_timer_ids[] = {
-       { .compatible = "altr,timer-1.0", },
+       { .compatible = "altr,timer-1.0" },
        { }
 };
 

thanks!

Signature · 1 line
Jagan | openedev.
#16 lore raw

PATCH 6/8 timer: altera_timer: minor clean up

In reply to Thomas Chou
Quoted 8 lines · Thomas Chou

- Moved macro definitions to top
- Remove the penultimate comma in of_match ids

---
  drivers/timer/altera_timer.c | 12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)

Applied to u-boot-nios.

Quoted 38 lines
drivers/timer/altera_timer.c +6 -6
index 288357c..7952ad7 100644
@@ -16,6 +16,11 @@
 
  DECLARE_GLOBAL_DATA_PTR;
 
+/* control register */
+#define ALTERA_TIMER_CONT	BIT(1)	/* Continuous mode */
+#define ALTERA_TIMER_START	BIT(2)	/* Start timer */
+#define ALTERA_TIMER_STOP	BIT(3)	/* Stop timer */
+
  struct altera_timer_regs {
  	u32	status;		/* Timer status reg */
  	u32	control;	/* Timer control reg */
@@ -30,11 +35,6 @@ struct altera_timer_platdata {
  	unsigned long clock_rate;
  };
 
-/* control register */
-#define ALTERA_TIMER_CONT	BIT(1)	/* Continuous mode */
-#define ALTERA_TIMER_START	BIT(2)	/* Start timer */
-#define ALTERA_TIMER_STOP	BIT(3)	/* Stop timer */
-
  static int altera_timer_get_count(struct udevice *dev, unsigned long *count)
  {
  	struct altera_timer_platdata *plat = dev->platdata;
@@ -88,7 +88,7 @@ static const struct timer_ops altera_timer_ops = {
  };
 
  static const struct udevice_id altera_timer_ids[] = {
-	{ .compatible = "altr,timer-1.0", },
+	{ .compatible = "altr,timer-1.0" },
  	{ }
  };
 
#17 lore raw

PATCH 7/8 misc: altera_sysid: minor clean up

In reply to Thomas Chou

- Remove the penultimate comma in of_match ids

---
 drivers/misc/altera_sysid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/altera_sysid.c +1 -1
index 249b273..1859b80 100644
@@ -87,7 +87,7 @@ static const struct misc_ops altera_sysid_ops = {
 };
 
 static const struct udevice_id altera_sysid_ids[] = {
-	{ .compatible = "altr,sysid-1.0", },
+	{ .compatible = "altr,sysid-1.0" },
 	{ }
 };
 
Signature · 1 line
2.5.0
#18 lore raw

PATCH 7/8 misc: altera_sysid: minor clean up

Quoted 4 lines · Thomas Chou

- Remove the penultimate comma in of_match ids

---

Quoted 8 lines
 drivers/misc/altera_sysid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/altera_sysid.c +0 -0
index 249b273..1859b80 100644

drivers/misc/altera_sysid.c static const struct misc_ops altera_sysid_ops = { · line 93

Quoted 8 lines
drivers/misc/altera_sysid.c +1 -1
@@ -87,7 +87,7 @@ static const struct misc_ops altera_sysid_ops = {
 };
 
 static const struct udevice_id altera_sysid_ids[] = {
-       { .compatible = "altr,sysid-1.0", },
+       { .compatible = "altr,sysid-1.0" },
        { }
 };
 

thanks!

Signature · 1 line
Jagan | openedev.
#19 lore raw

PATCH 7/8 misc: altera_sysid: minor clean up

In reply to Thomas Chou
Quoted 7 lines · Thomas Chou

- Remove the penultimate comma in of_match ids

---
  drivers/misc/altera_sysid.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to u-boot-nios.

Quoted 14 lines
drivers/misc/altera_sysid.c +1 -1
index 249b273..1859b80 100644
@@ -87,7 +87,7 @@ static const struct misc_ops altera_sysid_ops = {
  };
 
  static const struct udevice_id altera_sysid_ids[] = {
-	{ .compatible = "altr,sysid-1.0", },
+	{ .compatible = "altr,sysid-1.0" },
  	{ }
  };
 
#20 lore raw

PATCH 1/8 serial: altera_jtag_uart: use BIT macro

In reply to Thomas Chou
Quoted 8 lines · Thomas Chou

Replace numerical bit shift with BIT macro
in altera_jtag_uart

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

---

Quoted 23 lines
 drivers/serial/altera_jtag_uart.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/serial/altera_jtag_uart.c +3 -4
index 39d4a4e..0aa741c 100644
@@ -22,11 +22,11 @@ struct altera_jtaguart_platdata {
 };
 
 /* data register */
-#define ALTERA_JTAG_RVALID     (1<<15)         /* Read valid */
+#define ALTERA_JTAG_RVALID     BIT(15) /* Read valid */
 
 /* control register */
-#define ALTERA_JTAG_AC         (1 << 10)       /* activity indicator */
-#define ALTERA_JTAG_RRDY       (1 << 12)       /* read available */
+#define ALTERA_JTAG_AC         BIT(10) /* activity indicator */
+#define ALTERA_JTAG_RRDY       BIT(12) /* read available */
 #define ALTERA_JTAG_WSPACE(d)  ((d)>>16)       /* Write space avail */
 /* Write fifo size. FIXME: this should be extracted with sopc2dts */
 #define ALTERA_JTAG_WRITE_DEPTH        64
--
Quoted 1 line

2.5.0

thanks!

Signature · 1 line
Jagan | openedev.
#21 lore raw

PATCH 8/8 spi: altera_spi: minor clean up

In reply to Thomas Chou

- Remove the penultimate comma in of_match ids

---
 drivers/spi/altera_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/altera_spi.c +1 -1
index e49949b..432a8e7 100644
@@ -193,7 +193,7 @@ static const struct dm_spi_ops altera_spi_ops = {
 };
 
 static const struct udevice_id altera_spi_ids[] = {
-	{ .compatible = "altr,spi-1.0", },
+	{ .compatible = "altr,spi-1.0" },
 	{ }
 };
 
Signature · 1 line
2.5.0
#22 lore raw

PATCH 8/8 spi: altera_spi: minor clean up

Quoted 5 lines · Thomas Chou

- Remove the penultimate comma in of_match ids

---

Quoted 8 lines
 drivers/spi/altera_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/altera_spi.c +0 -0
index e49949b..432a8e7 100644

drivers/spi/altera_spi.c static const struct dm_spi_ops altera_spi_ops = {

Quoted 9 lines
drivers/spi/altera_spi.c +1 -2
@@ -193,7 +193,7 @@ static const struct dm_spi_ops altera_spi_ops = {
 };
 
 static const struct udevice_id altera_spi_ids[] = {
-       { .compatible = "altr,spi-1.0", },
+       { .compatible = "altr,spi-1.0" },
        { }
 };
 
--

thanks!

Signature · 1 line
Jagan | openedev.
#23 lore raw

PATCH 8/8 spi: altera_spi: minor clean up

In reply to Thomas Chou
Quoted 8 lines · Thomas Chou

- Remove the penultimate comma in of_match ids

---
  drivers/spi/altera_spi.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to u-boot-nios.

Quoted 14 lines
drivers/spi/altera_spi.c +1 -1
index e49949b..432a8e7 100644
@@ -193,7 +193,7 @@ static const struct dm_spi_ops altera_spi_ops = {
  };
 
  static const struct udevice_id altera_spi_ids[] = {
-	{ .compatible = "altr,spi-1.0", },
+	{ .compatible = "altr,spi-1.0" },
  	{ }
  };