diff mbox

[U-Boot,3/8] serial: altera_uart: use BIT macro

Message ID 1446189498-26549-3-git-send-email-thomas@wytron.com.tw
State Accepted, archived
Delegated to: Thomas Chou
Headers show

Commit Message

Thomas Chou Oct. 30, 2015, 7:18 a.m. UTC
Replace numerical bit shift with BIT macro
in altera_uart

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

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
---
 drivers/serial/altera_uart.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jagan Teki Oct. 30, 2015, 8:10 a.m. UTC | #1
On 30 October 2015 at 12:48, Thomas Chou <thomas@wytron.com.tw> wrote:
> Replace numerical bit shift with BIT macro
> in altera_uart
>
> :%s/(1 << nr)/BIT(nr)/g
> where nr = 0, 1, 2 .... 31
>
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
> ---

Reviewed-by: Jagan Teki <jteki@openedev.com>

>  drivers/serial/altera_uart.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/serial/altera_uart.c b/drivers/serial/altera_uart.c
> index 4ff9fe2..7d5197a 100644
> --- a/drivers/serial/altera_uart.c
> +++ b/drivers/serial/altera_uart.c
> @@ -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;

thanks!
Thomas Chou Nov. 3, 2015, 5:20 a.m. UTC | #2
On 2015年10月30日 15:18, Thomas Chou wrote:
> Replace numerical bit shift with BIT macro
> in altera_uart
>
> :%s/(1 << nr)/BIT(nr)/g
> where nr = 0, 1, 2 .... 31
>
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
> ---
>   drivers/serial/altera_uart.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>

Applied to u-boot-nios.

> diff --git a/drivers/serial/altera_uart.c b/drivers/serial/altera_uart.c
> index 4ff9fe2..7d5197a 100644
> --- a/drivers/serial/altera_uart.c
> +++ b/drivers/serial/altera_uart.c
> @@ -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;
>
>
diff mbox

Patch

diff --git a/drivers/serial/altera_uart.c b/drivers/serial/altera_uart.c
index 4ff9fe2..7d5197a 100644
--- a/drivers/serial/altera_uart.c
+++ b/drivers/serial/altera_uart.c
@@ -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;