drivers/tty/nozomi.c: rename CONFIG_MAGIC
PATCH 1/1 drivers/tty/nozomi.c: rename CONFIG_MAGIC
The CONFIG_ prefix is reserved for Kconfig options in Make and CPP syntax. CONFIG_MAGIC is a file local CPP identifier so strip the prefix to apply to Kconfig's naming convention.
---
I found this issue with ./scripts/checkkconfigsymbols.py
--- drivers/tty/nozomi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/tty/nozomi.c +3 -3
@@ -140,7 +140,7 @@ static int debug;#define R_FCR 0x0000/* Flow Control Register */ #define R_IER 0x0004/* Interrupt Enable Register */ -#define CONFIG_MAGIC 0xEFEFFEFE +#define MAGIC 0xEFEFFEFE#define TOGGLE_VALID 0x0000/* Definition of interrupt tokens */
@@ -660,9 +660,9 @@ static int nozomi_read_config_table(struct nozomi *dc)read_mem32 ((u32 *) &dc->config_table, dc->base_addr +0 ,sizeof (struct config_table )); -if (dc->config_table.signature !=CONFIG_MAGIC ) { +if (dc->config_table.signature !=MAGIC ) {dev_err (&dc->pdev->dev,"ConfigTable Bad! 0x%08X != 0x%08X\n" , - dc->config_table.signature,CONFIG_MAGIC ); + dc->config_table.signature,MAGIC );return 0 ; }
Signature · 1 line
2.1.0
Hi Valentin,
Quoted 16 lines · Valentin Rothberg
The
CONFIG_prefix is reserved forKconfigoptions in Make and CPP syntax.CONFIG_MAGICis a file local CPP identifier so strip the prefix to apply to Kconfig's naming convention.Signed-off-by Valentin Rothberg <[email protected]>---
I found this issue with./scripts/checkkconfigsymbols.py--- drivers/tty/nozomi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/tty/nozomi.c +0
-0
drivers/tty/nozomi.c static int debug; · line 143
Quoted 5 lines
drivers/tty/nozomi.c +1
-1@@ -140,7 +140,7 @@ static int debug;#define R_FCR 0x0000/* Flow Control Register */ #define R_IER 0x0004/* Interrupt Enable Register */ -#define CONFIG_MAGIC 0xEFEFFEFE +#define MAGIC 0xEFEFFEFE
^^^^^
This is too general for a preprocessor symbol; how about NOZOMI_CONFIG_MAGIC?
Regards,
Peter Hurley
Quoted 16 lines
drivers/tty/nozomi.c +2
-2#define TOGGLE_VALID 0x0000/* Definition of interrupt tokens */ @@ -660,9 +660,9 @@ static int nozomi_read_config_table(struct nozomi *dc)read_mem32 ((u32 *) &dc->config_table, dc->base_addr +0 ,sizeof (struct config_table )); -if (dc->config_table.signature !=CONFIG_MAGIC ) { +if (dc->config_table.signature !=MAGIC ) {dev_err (&dc->pdev->dev,"ConfigTable Bad! 0x%08X != 0x%08X\n" , - dc->config_table.signature,CONFIG_MAGIC ); + dc->config_table.signature,MAGIC );return 0 ; }
Hi Peter,
Quoted 22 lines · Peter Hurley
Hi Valentin,
Quoted 19 lines · Valentin Rothberg
The
CONFIG_prefix is reserved forKconfigoptions in Make and CPP syntax.CONFIG_MAGICis a file local CPP identifier so strip the prefix to apply to Kconfig's naming convention.Signed-off-by Valentin Rothberg <[email protected]>---
I found this issue with./scripts/checkkconfigsymbols.py--- drivers/tty/nozomi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/tty/nozomi.c +0
-0@@ -140,7 +140,7 @@ static int debug;#define R_FCR 0x0000/* Flow Control Register */ #define R_IER 0x0004/* Interrupt Enable Register */
Quoted 5 lines
drivers/tty/nozomi.c static int debug; · line 143
Quoted 2 lines
drivers/tty/nozomi.c +1
-1-#define CONFIG_MAGIC 0xEFEFFEFE +#define MAGIC 0xEFEFFEFE^^^^^This is too general for a preprocessor symbol; how about
NOZOMI_CONFIG_MAGIC?
Okay, sounds much better than ``MAGIC''. I will send a second version of this patch.
Kind regards,
Valentin
Quoted 20 lines
Regards,
Peter HurleyQuoted 16 lines
drivers/tty/nozomi.c +2
-2#define TOGGLE_VALID 0x0000/* Definition of interrupt tokens */ @@ -660,9 +660,9 @@ static int nozomi_read_config_table(struct nozomi *dc)read_mem32 ((u32 *) &dc->config_table, dc->base_addr +0 ,sizeof (struct config_table )); -if (dc->config_table.signature !=CONFIG_MAGIC ) { +if (dc->config_table.signature !=MAGIC ) {dev_err (&dc->pdev->dev,"ConfigTable Bad! 0x%08X != 0x%08X\n" , - dc->config_table.signature,CONFIG_MAGIC ); + dc->config_table.signature,MAGIC );return 0 ; }