drivers/char/speakup/synthlist.h - Fix warnings with -Wundef
PATCH 1/1 drivers/char/speakup/synthlist.h - Fix warnings with -Wundef
This patch fixes (it should) the following warnings generated with -Wundef in the file drivers/char/speakup/synthlist.h
drivers/char/speakup/synthlist.h:13:35: warning: "CONFIG_SPEAKUP_ACNTPC" is not defined drivers/char/speakup/synthlist.h:16:35: warning: "CONFIG_SPEAKUP_ACNTSA" is not defined drivers/char/speakup/synthlist.h:19:35: warning: "CONFIG_SPEAKUP_APOLLO" is not defined drivers/char/speakup/synthlist.h:22:35: warning: "CONFIG_SPEAKUP_AUDPTR" is not defined drivers/char/speakup/synthlist.h:25:32: warning: "CONFIG_SPEAKUP_BNS" is not defined drivers/char/speakup/synthlist.h:28:35: warning: "CONFIG_SPEAKUP_DECEXT" is not defined drivers/char/speakup/synthlist.h:31:35: warning: "CONFIG_SPEAKUP_DECTLK" is not defined drivers/char/speakup/synthlist.h:34:33: warning: "CONFIG_SPEAKUP_DTLK" is not defined drivers/char/speakup/synthlist.h:37:34: warning: "CONFIG_SPEAKUP_KEYPC" is not defined drivers/char/speakup/synthlist.h:40:33: warning: "CONFIG_SPEAKUP_LTLK" is not defined drivers/char/speakup/synthlist.h:43:35: warning: "CONFIG_SPEAKUP_SFTSYN" is not defined drivers/char/speakup/synthlist.h:46:35: warning: "CONFIG_SPEAKUP_SPKOUT" is not defined drivers/char/speakup/synthlist.h:49:34: warning: "CONFIG_SPEAKUP_TXPRT" is not defined drivers/char/speakup/synthlist.h:13:35: warning: "CONFIG_SPEAKUP_ACNTPC" is not defined drivers/char/speakup/synthlist.h:16:35: warning: "CONFIG_SPEAKUP_ACNTSA" is not defined drivers/char/speakup/synthlist.h:19:35: warning: "CONFIG_SPEAKUP_APOLLO" is not defined drivers/char/speakup/synthlist.h:22:35: warning: "CONFIG_SPEAKUP_AUDPTR" is not defined drivers/char/speakup/synthlist.h:25:32: warning: "CONFIG_SPEAKUP_BNS" is not defined drivers/char/speakup/synthlist.h:28:35: warning: "CONFIG_SPEAKUP_DECEXT" is not defined drivers/char/speakup/synthlist.h:31:35: warning: "CONFIG_SPEAKUP_DECTLK" is not defined drivers/char/speakup/synthlist.h:34:33: warning: "CONFIG_SPEAKUP_DTLK" is not defined drivers/char/speakup/synthlist.h:37:34: warning: "CONFIG_SPEAKUP_KEYPC" is not defined drivers/char/speakup/synthlist.h:40:33: warning: "CONFIG_SPEAKUP_LTLK" is not defined drivers/char/speakup/synthlist.h:43:35: warning: "CONFIG_SPEAKUP_SFTSYN" is not defined drivers/char/speakup/synthlist.h:46:35: warning: "CONFIG_SPEAKUP_SPKOUT" is not defined drivers/char/speakup/synthlist.h:49:34: warning: "CONFIG_SPEAKUP_TXPRT" is not defined drivers/char/speakup/synthlist.h:13:35: warning: "CONFIG_SPEAKUP_ACNTPC" is not defined drivers/char/speakup/synthlist.h:16:35: warning: "CONFIG_SPEAKUP_ACNTSA" is not defined drivers/char/speakup/synthlist.h:19:35: warning: "CONFIG_SPEAKUP_APOLLO" is not defined drivers/char/speakup/synthlist.h:22:35: warning: "CONFIG_SPEAKUP_AUDPTR" is not defined drivers/char/speakup/synthlist.h:25:32: warning: "CONFIG_SPEAKUP_BNS" is not defined drivers/char/speakup/synthlist.h:28:35: warning: "CONFIG_SPEAKUP_DECEXT" is not defined drivers/char/speakup/synthlist.h:31:35: warning: "CONFIG_SPEAKUP_DECTLK" is not defined drivers/char/speakup/synthlist.h:34:33: warning: "CONFIG_SPEAKUP_DTLK" is not defined drivers/char/speakup/synthlist.h:37:34: warning: "CONFIG_SPEAKUP_KEYPC" is not defined drivers/char/speakup/synthlist.h:40:33: warning: "CONFIG_SPEAKUP_LTLK" is not defined drivers/char/speakup/synthlist.h:43:35: warning: "CONFIG_SPEAKUP_SFTSYN" is not defined drivers/char/speakup/synthlist.h:46:35: warning: "CONFIG_SPEAKUP_SPKOUT" is not defined drivers/char/speakup/synthlist.h:49:34: warning: "CONFIG_SPEAKUP_TXPRT" is not defined drivers/char/speakup/synthlist.h:13:35: warning: "CONFIG_SPEAKUP_ACNTPC" is not defined drivers/char/speakup/synthlist.h:16:35: warning: "CONFIG_SPEAKUP_ACNTSA" is not defined drivers/char/speakup/synthlist.h:19:35: warning: "CONFIG_SPEAKUP_APOLLO" is not defined drivers/char/speakup/synthlist.h:22:35: warning: "CONFIG_SPEAKUP_AUDPTR" is not defined drivers/char/speakup/synthlist.h:25:32: warning: "CONFIG_SPEAKUP_BNS" is not defined drivers/char/speakup/synthlist.h:28:35: warning: "CONFIG_SPEAKUP_DECEXT" is not defined drivers/char/speakup/synthlist.h:31:35: warning: "CONFIG_SPEAKUP_DECTLK" is not defined drivers/char/speakup/synthlist.h:34:33: warning: "CONFIG_SPEAKUP_DTLK" is not defined drivers/char/speakup/synthlist.h:37:34: warning: "CONFIG_SPEAKUP_KEYPC" is not defined drivers/char/speakup/synthlist.h:40:33: warning: "CONFIG_SPEAKUP_LTLK" is not defined drivers/char/speakup/synthlist.h:43:35: warning: "CONFIG_SPEAKUP_SFTSYN" is not defined drivers/char/speakup/synthlist.h:46:35: warning: "CONFIG_SPEAKUP_SPKOUT" is not defined drivers/char/speakup/synthlist.h:49:34: warning: "CONFIG_SPEAKUP_TXPRT" is not defined
drivers/char/speakup/synthlist.h +1 -1
@@ -7,7 +7,7 @@/* declare extern built in synths */ #define SYNTH_DECL (who) extern struct spk_synth synth_##who;#define PASS2 -#define CFG_TEST (name) (name) +#define CFG_TEST (name) defined(name)#endif #if CFG_TEST (CONFIG_SPEAKUP_ACNTPC )
drivers/char/speakup/synthlist.h line 10
Quoted 11 lines · Nick Sillik
This patch fixes (it should) the following warnings generated with -Wundef in the file
drivers/char/speakup/synthlist.h
drivers/char/speakup/synthlist.h:13:35: warning: "CONFIG_SPEAKUP_ACNTPC" is not defineddrivers/char/speakup/synthlist.h +1
-1-#define CFG_TEST (name) (name) +#define CFG_TEST (name) defined(name)
No. Just remove this obfuscating macro.
Quoted 3 lines
#endif
#if
CFG_TEST(CONFIG_SPEAKUP_ACNTPC)
^^^^^^^^^^^^
Yuck.
Quoted 6 lines · Alexey Dobriyan
drivers/char/speakup/synthlist.h line 10
Quoted 3 lines
drivers/char/speakup/synthlist.h +1
-1-#define CFG_TEST (name) (name) +#define CFG_TEST (name) defined(name)No. Just remove this obfuscating macro.
Agreed, here is the fixed patch
Quoted 11 lines · Nick Sillik
Quoted 7 lines · Alexey Dobriyan
Review
Quoted 3 lines
(quoted diff) +1
-1-#define CFG_TEST(name) (name) +#define CFG_TEST(name) defined(name)No. Just remove this obfuscating macro.
Quoted 3 lines
Agreed, here is the fixed patch
Signed-off-by Nick Sillik <[email protected]>
No here it really is... (sorry)
drivers/char/speakup/synthlist.h +14 -16
@@ -2,53 +2,51 @@#if defined(PASS2 )/* table of built in synths */ #define SYNTH_DECL (who) &synth_##who, -#define CFG_TEST (name) (name)#else /* declare extern built in synths */ #define SYNTH_DECL (who) extern struct spk_synth synth_##who;#define PASS2 -#define CFG_TEST (name) (name)#endif -#if CFG_TEST (CONFIG_SPEAKUP_ACNTPC ) +#ifdef CONFIG_SPEAKUP_ACNTPC SYNTH_DECL(acntpc)#endif -#if CFG_TEST (CONFIG_SPEAKUP_ACNTSA ) +#ifdef CONFIG_SPEAKUP_ACNTSA SYNTH_DECL(acntsa)#endif -#if CFG_TEST (CONFIG_SPEAKUP_APOLLO ) +#ifdef CONFIG_SPEAKUP_APOLLO SYNTH_DECL(apollo)#endif -#if CFG_TEST (CONFIG_SPEAKUP_AUDPTR ) +#ifdef CONFIG_SPEAKUP_AUDPTR SYNTH_DECL(audptr)#endif -#if CFG_TEST (CONFIG_SPEAKUP_BNS ) +#ifdef CONFIG_SPEAKUP_BNS SYNTH_DECL(bns)#endif -#if CFG_TEST (CONFIG_SPEAKUP_DECEXT ) +#ifdef CONFIG_SPEAKUP_DECEXT SYNTH_DECL(decext)#endif -#if CFG_TEST (CONFIG_SPEAKUP_DECTLK ) +#ifdef CONFIG_SPEAKUP_DECTLK SYNTH_DECL(dectlk)#endif -#if CFG_TEST (CONFIG_SPEAKUP_DTLK ) +#ifdef CONFIG_SPEAKUP_DTLK SYNTH_DECL(dtlk)#endif -#if CFG_TEST (CONFIG_SPEAKUP_KEYPC ) +#ifdef CONFIG_SPEAKUP_KEYPC SYNTH_DECL(keypc)#endif -#if CFG_TEST (CONFIG_SPEAKUP_LTLK ) +#ifdef CONFIG_SPEAKUP_LTLK SYNTH_DECL(ltlk)#endif -#if CFG_TEST (CONFIG_SPEAKUP_SFTSYN ) +#ifdef CONFIG_SPEAKUP_SFTSYN SYNTH_DECL(sftsyn)#endif -#if CFG_TEST (CONFIG_SPEAKUP_SPKOUT ) +#ifdef CONFIG_SPEAKUP_SPKOUT SYNTH_DECL(spkout)#endif -#if CFG_TEST (CONFIG_SPEAKUP_TXPRT ) +#ifdef CONFIG_SPEAKUP_TXPRT SYNTH_DECL(txprt)#endif #undef SYNTH_DECL -#undef CFG_TEST +#undef
drivers/char/speakup/synthlist.h line 52
Quoted 5 lines · Nick Sillik
drivers/char/speakup/synthlist.h +1
-1-#undef CFG_TEST +#undef
Thou shal test-compile, then send.
Please, be attentive.