public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v6 03/23] spi: altera_spi: Use BIT macro
@ 2015-10-27 17:47 Jagan Teki
  2015-10-27 17:47 ` [U-Boot] [PATCH] spi: altera_spi: Minor cleanup Jagan Teki
  2015-10-28  7:14 ` [U-Boot] [PATCH v6 03/23] spi: altera_spi: Use BIT macro Thomas Chou
  0 siblings, 2 replies; 4+ messages in thread
From: Jagan Teki @ 2015-10-27 17:47 UTC (permalink / raw)
  To: u-boot

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@denx.de>
Cc: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Jagan Teki <jteki@openedev.com>
---
Changes for v6:
	- Rebase to master
 
 drivers/spi/altera_spi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/altera_spi.c b/drivers/spi/altera_spi.c
index ff3512a..3dbcfaa 100644
--- a/drivers/spi/altera_spi.c
+++ b/drivers/spi/altera_spi.c
@@ -38,8 +38,8 @@ struct altera_spi_priv {
 	struct altera_spi_regs *regs;
 };
 
-#define ALTERA_SPI_STATUS_RRDY_MSK	(1 << 7)
-#define ALTERA_SPI_CONTROL_SSO_MSK	(1 << 10)
+#define ALTERA_SPI_STATUS_RRDY_MSK	BIT(7)
+#define ALTERA_SPI_CONTROL_SSO_MSK	BIT(10)
 
 static void spi_cs_activate(struct udevice *dev, uint cs)
 {
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] spi: altera_spi: Minor cleanup
  2015-10-27 17:47 [U-Boot] [PATCH v6 03/23] spi: altera_spi: Use BIT macro Jagan Teki
@ 2015-10-27 17:47 ` Jagan Teki
  2015-10-28  7:14   ` Thomas Chou
  2015-10-28  7:14 ` [U-Boot] [PATCH v6 03/23] spi: altera_spi: Use BIT macro Thomas Chou
  1 sibling, 1 reply; 4+ messages in thread
From: Jagan Teki @ 2015-10-27 17:47 UTC (permalink / raw)
  To: u-boot

- Moved macro definitions to top
- Give tab space to CONFIG_ALTERA_SPI_IDLE_VAL value
- Re-arrange header includes to ascending order

Cc: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: Jagan Teki <jteki@openedev.com>
---
 drivers/spi/altera_spi.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/altera_spi.c b/drivers/spi/altera_spi.c
index 3dbcfaa..e49949b 100644
--- a/drivers/spi/altera_spi.c
+++ b/drivers/spi/altera_spi.c
@@ -11,14 +11,17 @@
 #include <dm.h>
 #include <errno.h>
 #include <malloc.h>
-#include <spi.h>
 #include <fdtdec.h>
+#include <spi.h>
 #include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#define ALTERA_SPI_STATUS_RRDY_MSK	BIT(7)
+#define ALTERA_SPI_CONTROL_SSO_MSK	BIT(10)
+
 #ifndef CONFIG_ALTERA_SPI_IDLE_VAL
-#define CONFIG_ALTERA_SPI_IDLE_VAL 0xff
+#define CONFIG_ALTERA_SPI_IDLE_VAL	0xff
 #endif
 
 struct altera_spi_regs {
@@ -38,9 +41,6 @@ struct altera_spi_priv {
 	struct altera_spi_regs *regs;
 };
 
-#define ALTERA_SPI_STATUS_RRDY_MSK	BIT(7)
-#define ALTERA_SPI_CONTROL_SSO_MSK	BIT(10)
-
 static void spi_cs_activate(struct udevice *dev, uint cs)
 {
 	struct udevice *bus = dev->parent;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH v6 03/23] spi: altera_spi: Use BIT macro
  2015-10-27 17:47 [U-Boot] [PATCH v6 03/23] spi: altera_spi: Use BIT macro Jagan Teki
  2015-10-27 17:47 ` [U-Boot] [PATCH] spi: altera_spi: Minor cleanup Jagan Teki
@ 2015-10-28  7:14 ` Thomas Chou
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Chou @ 2015-10-28  7:14 UTC (permalink / raw)
  To: u-boot

HI Jagan,

On 10/28/2015 01:47 AM, Jagan Teki wrote:
> 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@denx.de>
> Cc: Thomas Chou <thomas@wytron.com.tw>
> Reviewed-by: Tom Rini <trini@konsulko.com>
> Signed-off-by: Jagan Teki <jteki@openedev.com>
> ---
> Changes for v6:
> 	- Rebase to master
>
>   drivers/spi/altera_spi.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>

Acked-by: Thomas Chou <thomas@wytron.com.tw>

Thanks a lot.

Best regards,
Thomas Chou

> diff --git a/drivers/spi/altera_spi.c b/drivers/spi/altera_spi.c
> index ff3512a..3dbcfaa 100644
> --- a/drivers/spi/altera_spi.c
> +++ b/drivers/spi/altera_spi.c
> @@ -38,8 +38,8 @@ struct altera_spi_priv {
>   	struct altera_spi_regs *regs;
>   };
>
> -#define ALTERA_SPI_STATUS_RRDY_MSK	(1 << 7)
> -#define ALTERA_SPI_CONTROL_SSO_MSK	(1 << 10)
> +#define ALTERA_SPI_STATUS_RRDY_MSK	BIT(7)
> +#define ALTERA_SPI_CONTROL_SSO_MSK	BIT(10)
>
>   static void spi_cs_activate(struct udevice *dev, uint cs)
>   {
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] spi: altera_spi: Minor cleanup
  2015-10-27 17:47 ` [U-Boot] [PATCH] spi: altera_spi: Minor cleanup Jagan Teki
@ 2015-10-28  7:14   ` Thomas Chou
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Chou @ 2015-10-28  7:14 UTC (permalink / raw)
  To: u-boot

Hi Jagan,

On 10/28/2015 01:47 AM, Jagan Teki wrote:
> - Moved macro definitions to top
> - Give tab space to CONFIG_ALTERA_SPI_IDLE_VAL value
> - Re-arrange header includes to ascending order
>
> Cc: Thomas Chou <thomas@wytron.com.tw>
> Signed-off-by: Jagan Teki <jteki@openedev.com>
> ---
>   drivers/spi/altera_spi.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
>

Acked-by: Thomas Chou <thomas@wytron.com.tw>

Thanks a lot.

Best regards,
Thomas Chou

> diff --git a/drivers/spi/altera_spi.c b/drivers/spi/altera_spi.c
> index 3dbcfaa..e49949b 100644
> --- a/drivers/spi/altera_spi.c
> +++ b/drivers/spi/altera_spi.c
> @@ -11,14 +11,17 @@
>   #include <dm.h>
>   #include <errno.h>
>   #include <malloc.h>
> -#include <spi.h>
>   #include <fdtdec.h>
> +#include <spi.h>
>   #include <asm/io.h>
>
>   DECLARE_GLOBAL_DATA_PTR;
>
> +#define ALTERA_SPI_STATUS_RRDY_MSK	BIT(7)
> +#define ALTERA_SPI_CONTROL_SSO_MSK	BIT(10)
> +
>   #ifndef CONFIG_ALTERA_SPI_IDLE_VAL
> -#define CONFIG_ALTERA_SPI_IDLE_VAL 0xff
> +#define CONFIG_ALTERA_SPI_IDLE_VAL	0xff
>   #endif
>
>   struct altera_spi_regs {
> @@ -38,9 +41,6 @@ struct altera_spi_priv {
>   	struct altera_spi_regs *regs;
>   };
>
> -#define ALTERA_SPI_STATUS_RRDY_MSK	BIT(7)
> -#define ALTERA_SPI_CONTROL_SSO_MSK	BIT(10)
> -
>   static void spi_cs_activate(struct udevice *dev, uint cs)
>   {
>   	struct udevice *bus = dev->parent;
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-28  7:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-27 17:47 [U-Boot] [PATCH v6 03/23] spi: altera_spi: Use BIT macro Jagan Teki
2015-10-27 17:47 ` [U-Boot] [PATCH] spi: altera_spi: Minor cleanup Jagan Teki
2015-10-28  7:14   ` Thomas Chou
2015-10-28  7:14 ` [U-Boot] [PATCH v6 03/23] spi: altera_spi: Use BIT macro Thomas Chou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox