net: smc911x: Fix can not compile smc911x
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
@@ -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
PATCH 1/1 net: smc911x: Fix can not compile smc911x
Hi Nobuhiro,
Quoted 2 lines · Nobuhiro Iwamatsu
When enable
CONFIG_DRIVER_SMC911X_16_BITin 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
PATCH 1/1 net: smc911x: Fix can not compile smc911x
In reply to Nobuhiro IwamatsuNobuhiro,
Nice catch! Thanks.
Wolfgang/Detlev,
Please pull directly.
regards,
Ben
Quoted 5 lines · Nobuhiro Iwamatsu
When enable
CONFIG_DRIVER_SMC911X_16_BITin smc911x, can not compile it. I revised it from "elif" preprocessor to "elif defined".Signed-off-by Nobuhiro Iwamatsu <[email protected]>
Quoted 27 lines
--- drivers/net/smc911x.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)drivers/net/smc911x.c +2
-2@@ -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;
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
Wolfgang Denk
AppliedPATCH 1/1 net: smc911x: Fix can not compile smc911x
In reply to Nobuhiro IwamatsuQuoted 7 lines · In message <[email protected]> you…
When enable
CONFIG_DRIVER_SMC911X_16_BITin smc911x, can not compile it. I revised it from "elif" preprocessor to "elif defined".Signed-off-by Nobuhiro Iwamatsu <[email protected]>--- 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