linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [TRIVIAL] include/asm-i386/module.h defined() fix
@ 2003-08-30 14:42 Petri Koistinen
  2003-09-02  5:14 ` Rusty Russell
  0 siblings, 1 reply; 2+ messages in thread
From: Petri Koistinen @ 2003-08-30 14:42 UTC (permalink / raw)
  To: trivial; +Cc: linux-kernel

Hi!

Take a look at The C Programming Language (2nd ed.) page 91. "The
expression defined(name) in a #if is 1 if the name has been defined, and 0
otherwise." So defined should be used with parenthesis, I think. At least
most of Linux kernel source code is doing so. Ok?

Petri

--- linux-2.5/include/asm-i386/module.h.~1.7.~	2003-02-15 22:24:11.000000000 +0200
+++ linux-2.5/include/asm-i386/module.h	2003-08-30 17:16:06.000000000 +0300
@@ -12,41 +12,41 @@

 #ifdef CONFIG_M386
 #define MODULE_PROC_FAMILY "386 "
-#elif defined CONFIG_M486
+#elif defined(CONFIG_M486)
 #define MODULE_PROC_FAMILY "486 "
-#elif defined CONFIG_M586
+#elif defined(CONFIG_M586)
 #define MODULE_PROC_FAMILY "586 "
-#elif defined CONFIG_M586TSC
+#elif defined(CONFIG_M586TSC)
 #define MODULE_PROC_FAMILY "586TSC "
-#elif defined CONFIG_M586MMX
+#elif defined(CONFIG_M586MMX)
 #define MODULE_PROC_FAMILY "586MMX "
-#elif defined CONFIG_M686
+#elif defined(CONFIG_M686)
 #define MODULE_PROC_FAMILY "686 "
-#elif defined CONFIG_MPENTIUMII
+#elif defined(CONFIG_MPENTIUMII)
 #define MODULE_PROC_FAMILY "PENTIUMII "
-#elif defined CONFIG_MPENTIUMIII
+#elif defined(CONFIG_MPENTIUMIII)
 #define MODULE_PROC_FAMILY "PENTIUMIII "
-#elif defined CONFIG_MPENTIUM4
+#elif defined(CONFIG_MPENTIUM4)
 #define MODULE_PROC_FAMILY "PENTIUM4 "
-#elif defined CONFIG_MK6
+#elif defined(CONFIG_MK6)
 #define MODULE_PROC_FAMILY "K6 "
-#elif defined CONFIG_MK7
+#elif defined(CONFIG_MK7)
 #define MODULE_PROC_FAMILY "K7 "
-#elif defined CONFIG_MK8
+#elif defined(CONFIG_MK8)
 #define MODULE_PROC_FAMILY "K8 "
-#elif defined CONFIG_MELAN
+#elif defined(CONFIG_MELAN)
 #define MODULE_PROC_FAMILY "ELAN "
-#elif defined CONFIG_MCRUSOE
+#elif defined(CONFIG_MCRUSOE)
 #define MODULE_PROC_FAMILY "CRUSOE "
-#elif defined CONFIG_MWINCHIPC6
+#elif defined(CONFIG_MWINCHIPC6)
 #define MODULE_PROC_FAMILY "WINCHIPC6 "
-#elif defined CONFIG_MWINCHIP2
+#elif defined(CONFIG_MWINCHIP2)
 #define MODULE_PROC_FAMILY "WINCHIP2 "
-#elif defined CONFIG_MWINCHIP3D
+#elif defined(CONFIG_MWINCHIP3D)
 #define MODULE_PROC_FAMILY "WINCHIP3D "
-#elif defined CONFIG_MCYRIXIII
+#elif defined(CONFIG_MCYRIXIII)
 #define MODULE_PROC_FAMILY "CYRIXIII "
-#elif CONFIG_MVIAC3_2
+#elif defined(CONFIG_MVIAC3_2)
 #define MODULE_PROC_FAMILY "VIAC3-2 "
 #else
 #error unknown processor family

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

* Re: [TRIVIAL] include/asm-i386/module.h defined() fix
  2003-08-30 14:42 [TRIVIAL] include/asm-i386/module.h defined() fix Petri Koistinen
@ 2003-09-02  5:14 ` Rusty Russell
  0 siblings, 0 replies; 2+ messages in thread
From: Rusty Russell @ 2003-09-02  5:14 UTC (permalink / raw)
  To: Petri Koistinen; +Cc: linux-kernel

In message <Pine.LNX.4.56.0308301717480.18600@dsl-hkigw4a35.dial.inet.fi> you w
rite:
> Hi!
> 
> Take a look at The C Programming Language (2nd ed.) page 91. "The
> expression defined(name) in a #if is 1 if the name has been defined, and 0
> otherwise." So defined should be used with parenthesis, I think. At least
> most of Linux kernel source code is doing so. Ok?

And page 232 indicates that the brackets are not required (hey, I had
to check, too).

Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

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

end of thread, other threads:[~2003-09-02  6:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-30 14:42 [TRIVIAL] include/asm-i386/module.h defined() fix Petri Koistinen
2003-09-02  5:14 ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).