public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] net: smc911x: Fix can not compile smc911x
@ 2008-06-30  8:45 Nobuhiro Iwamatsu
  2008-06-30 10:04 ` Jens Gehrlein
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Nobuhiro Iwamatsu @ 2008-06-30  8:45 UTC (permalink / raw)
  To: u-boot

When enable CONFIG_DRIVER_SMC911X_16_BIT in smc911x, can not compile it.
I revised it from "elif" preprocessor to "elif defined".

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
---
 drivers/net/smc911x.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 7555cb9..a2d3cb2 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -33,7 +33,7 @@
 	CONFIG_DRIVER_SMC911X_16_BIT shall be set"
 #endif

-#ifdef CONFIG_DRIVER_SMC911X_32_BIT
+#if defined (CONFIG_DRIVER_SMC911X_32_BIT)
 static inline u32 reg_read(u32 addr)
 {
 	return *(volatile u32*)addr;
@@ -42,7 +42,7 @@ static inline void reg_write(u32 addr, u32 val)
 {
 	*(volatile u32*)addr = val;
 }
-#elif CONFIG_DRIVER_SMC911X_16_BIT
+#elif defined (CONFIG_DRIVER_SMC911X_16_BIT)
 static inline u32 reg_read(u32 addr)
 {
 	volatile u16 *addr_16 = (u16 *)addr;
-- 
1.5.5.1

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

* [U-Boot-Users] [PATCH] net: smc911x: Fix can not compile smc911x
  2008-06-30  8:45 [U-Boot-Users] [PATCH] net: smc911x: Fix can not compile smc911x Nobuhiro Iwamatsu
@ 2008-06-30 10:04 ` Jens Gehrlein
  2008-06-30 17:25 ` Ben Warren
  2008-07-06 22:20 ` Wolfgang Denk
  2 siblings, 0 replies; 5+ messages in thread
From: Jens Gehrlein @ 2008-06-30 10:04 UTC (permalink / raw)
  To: u-boot

Hi Nobuhiro,

Nobuhiro Iwamatsu schrieb:
> When enable CONFIG_DRIVER_SMC911X_16_BIT in smc911x, can not compile it.
> I revised it from "elif" preprocessor to "elif defined".

You are right. It depends on if one writes
#define NAME
or
#define NAME 1

"#elif" and "#elif defined" behave different then.
Probably, I only tested with the "number"-version.

Thank you for catching this.

Best Regards,
Jens

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

* [U-Boot-Users] [PATCH] net: smc911x: Fix can not compile smc911x
  2008-06-30  8:45 [U-Boot-Users] [PATCH] net: smc911x: Fix can not compile smc911x Nobuhiro Iwamatsu
  2008-06-30 10:04 ` Jens Gehrlein
@ 2008-06-30 17:25 ` Ben Warren
  2008-07-06 22:20   ` Wolfgang Denk
  2008-07-06 22:20 ` Wolfgang Denk
  2 siblings, 1 reply; 5+ messages in thread
From: Ben Warren @ 2008-06-30 17:25 UTC (permalink / raw)
  To: u-boot

Nobuhiro,

Nice catch!  Thanks.

Wolfgang/Detlev,

Please pull directly.

regards,
Ben

Nobuhiro Iwamatsu wrote:
> When enable CONFIG_DRIVER_SMC911X_16_BIT in smc911x, can not compile it.
> I revised it from "elif" preprocessor to "elif defined".
>
> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
>   
Acked-by: Ben Warren <biggerbadderben@gmail.com>
> ---
>  drivers/net/smc911x.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
> index 7555cb9..a2d3cb2 100644
> --- a/drivers/net/smc911x.c
> +++ b/drivers/net/smc911x.c
> @@ -33,7 +33,7 @@
>  	CONFIG_DRIVER_SMC911X_16_BIT shall be set"
>  #endif
>
> -#ifdef CONFIG_DRIVER_SMC911X_32_BIT
> +#if defined (CONFIG_DRIVER_SMC911X_32_BIT)
>  static inline u32 reg_read(u32 addr)
>  {
>  	return *(volatile u32*)addr;
> @@ -42,7 +42,7 @@ static inline void reg_write(u32 addr, u32 val)
>  {
>  	*(volatile u32*)addr = val;
>  }
> -#elif CONFIG_DRIVER_SMC911X_16_BIT
> +#elif defined (CONFIG_DRIVER_SMC911X_16_BIT)
>  static inline u32 reg_read(u32 addr)
>  {
>  	volatile u16 *addr_16 = (u16 *)addr;
>   

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

* [U-Boot-Users] [PATCH] net: smc911x: Fix can not compile smc911x
  2008-06-30  8:45 [U-Boot-Users] [PATCH] net: smc911x: Fix can not compile smc911x Nobuhiro Iwamatsu
  2008-06-30 10:04 ` Jens Gehrlein
  2008-06-30 17:25 ` Ben Warren
@ 2008-07-06 22:20 ` Wolfgang Denk
  2 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2008-07-06 22:20 UTC (permalink / raw)
  To: u-boot

In message <29ab51dc0806300145n5d5dbbcdq7a11e3780b71840f@mail.gmail.com> you wrote:
> When enable CONFIG_DRIVER_SMC911X_16_BIT in smc911x, can not compile it.
> I revised it from "elif" preprocessor to "elif defined".
> 
> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
> ---
>  drivers/net/smc911x.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
We do not colonize. We conquer. We rule. There is no  other  way  for
us.
	-- Rojan, "By Any Other Name", stardate 4657.5

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

* [U-Boot-Users] [PATCH] net: smc911x: Fix can not compile smc911x
  2008-06-30 17:25 ` Ben Warren
@ 2008-07-06 22:20   ` Wolfgang Denk
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2008-07-06 22:20 UTC (permalink / raw)
  To: u-boot

In message <48691714.80004@gmail.com> you wrote:
> Nobuhiro,
> 
> Nice catch!  Thanks.
> 
> Wolfgang/Detlev,
> 
> Please pull directly.

Done.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Wherever you go...There you are.                    - Buckaroo Banzai

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

end of thread, other threads:[~2008-07-06 22:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-30  8:45 [U-Boot-Users] [PATCH] net: smc911x: Fix can not compile smc911x Nobuhiro Iwamatsu
2008-06-30 10:04 ` Jens Gehrlein
2008-06-30 17:25 ` Ben Warren
2008-07-06 22:20   ` Wolfgang Denk
2008-07-06 22:20 ` Wolfgang Denk

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