Skip to contentSkip to conversation

net: smc911x: Fix can not compile smc911x

PATCH New Nobuhiro Iwamatsu 4 participants 5 messages Jun 30, 2008 – Jul 6, 2008 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: smc911x: Fix can not compile smc911x

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

---
 drivers/net/smc911x.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/smc911x.c +2 -2
index 7555cb9..a2d3cb2 100644
@@ -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;
Signature · 1 line
1.5.5.1
#1 lore raw

PATCH 1/1 net: smc911x: Fix can not compile smc911x

Hi Nobuhiro,

Quoted 2 lines · Nobuhiro Iwamatsu

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

#2 lore raw

PATCH 1/1 net: smc911x: Fix can not compile smc911x

In reply to Nobuhiro Iwamatsu

Nobuhiro,

Nice catch! Thanks.

Wolfgang/Detlev,

Please pull directly.

regards,
Ben

Quoted 5 lines · Nobuhiro Iwamatsu

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

Quoted 27 lines
---
 drivers/net/smc911x.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/smc911x.c +2 -2
index 7555cb9..a2d3cb2 100644
@@ -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;
#3 lore raw

PATCH 1/1 net: smc911x: Fix can not compile smc911x

Quoted 7 lines · In message <[email protected]> you wrote:

Nobuhiro,

Nice catch! Thanks.

Wolfgang/Detlev,

Please pull directly.

Done.

Best regards,

Wolfgang Denk

Signature · 4 lines
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
#4 lore raw

PATCH 1/1 net: smc911x: Fix can not compile smc911x

In reply to Nobuhiro Iwamatsu
Quoted 7 lines · In message <[email protected]> you…

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

---
 drivers/net/smc911x.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
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