mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Add documentation to some preprocessor directives in init/*.c.
@ 2007-08-28  5:56 Robert P. J. Day
  2007-08-28 20:42 ` Alexey Dobriyan
  0 siblings, 1 reply; 2+ messages in thread
From: Robert P. J. Day @ 2007-08-28  5:56 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: trivial


Add some documentation to potentially confusing preprocessor
directives in some source files in the init/ directory to show their
proper association and nesting.

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>

---

  not all of them, just those that are sufficiently distant from their
initial tests or are nested, to make perusing the code easier.

 init/calibrate.c |    2 +-
 init/initramfs.c |    4 ++--
 init/main.c      |    6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/init/calibrate.c b/init/calibrate.c
index 40ff3b4..783a907 100644
--- a/init/calibrate.c
+++ b/init/calibrate.c
@@ -101,7 +101,7 @@ static unsigned long __devinit calibrate_delay_direct(void)
 	       "estimate for loops_per_jiffy.\nProbably due to long platform interrupts. Consider using \"lpj=\" boot option.\n");
 	return 0;
 }
-#else
+#else /* !ARCH_HAS_READ_CURRENT_TIMER */
 static unsigned long __devinit calibrate_delay_direct(void) {return 0;}
 #endif

diff --git a/init/initramfs.c b/init/initramfs.c
index 1db02a0..2493c5b 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -539,7 +539,7 @@ skip:
 	initrd_end = 0;
 }

-#endif
+#endif /* CONFIG_BLK_DEV_INITRD */

 static int __init populate_rootfs(void)
 {
@@ -579,7 +579,7 @@ static int __init populate_rootfs(void)
 		free_initrd();
 #endif
 	}
-#endif
+#endif /* CONFIG_BLK_DEV_INITRD */
 	return 0;
 }
 rootfs_initcall(populate_rootfs);
diff --git a/init/main.c b/init/main.c
index 450e6ee..781b1fb 100644
--- a/init/main.c
+++ b/init/main.c
@@ -169,7 +169,7 @@ static int __init maxcpus(char *str)
 }

 early_param("maxcpus", maxcpus);
-#else
+#else /* !CONFIG_SMP */
 #define max_cpus NR_CPUS
 #endif

@@ -367,7 +367,7 @@ static void __init smp_init(void)
 static inline void setup_per_cpu_areas(void) { }
 static inline void smp_prepare_cpus(unsigned int maxcpus) { }

-#else
+#else /* CONFIG_SMP */

 #ifdef __GENERIC_PER_CPU
 unsigned long __per_cpu_offset[NR_CPUS] __read_mostly;
@@ -414,7 +414,7 @@ static void __init smp_init(void)
 	smp_cpus_done(max_cpus);
 }

-#endif
+#endif /* CONFIG_SMP */

 /*
  * We need to store the untouched command line for future reference.
-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
========================================================================

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

* Re: [PATCH] Add documentation to some preprocessor directives in init/*.c.
  2007-08-28  5:56 [PATCH] Add documentation to some preprocessor directives in init/*.c Robert P. J. Day
@ 2007-08-28 20:42 ` Alexey Dobriyan
  0 siblings, 0 replies; 2+ messages in thread
From: Alexey Dobriyan @ 2007-08-28 20:42 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Linux Kernel Mailing List, trivial

On Tue, Aug 28, 2007 at 01:56:24AM -0400, Robert P. J. Day wrote:
> Add some documentation to potentially confusing preprocessor
> directives in some source files in the init/ directory to show their
> proper association and nesting.

> --- a/init/calibrate.c
> +++ b/init/calibrate.c
> @@ -101,7 +101,7 @@ static unsigned long __devinit calibrate_delay_direct(void)
>  	       "estimate for loops_per_jiffy.\nProbably due to long platform interrupts. Consider using \"lpj=\" boot option.\n");
>  	return 0;
>  }
> -#else
> +#else /* !ARCH_HAS_READ_CURRENT_TIMER */
>  static unsigned long __devinit calibrate_delay_direct(void) {return 0;}
>  #endif

I'm sorry, but this is not useful. You're adding comments and compiler
ignores comments. So, one can't rely on such comments being accurate and
will go to start of section for recheck anyway.

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

end of thread, other threads:[~2007-08-28 20:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-28  5:56 [PATCH] Add documentation to some preprocessor directives in init/*.c Robert P. J. Day
2007-08-28 20:42 ` Alexey Dobriyan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®