public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] CONFIG_* In Comments Considered Harmful
@ 2003-10-01 13:26 Matthew Wilcox
  2003-10-01 14:19 ` Dave Jones
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Matthew Wilcox @ 2003-10-01 13:26 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel


I reviewed the dependency list for a file this morning to see why it was
being unnecessarily recompiled (a little fetish of mine, mostly harmless).
I was a little discombobulated to find this line:

    $(wildcard include/config/higmem.h) \

Naturally, I assumed a typo somewhere.  It turns out there is indeed
a CONFIG_HIGMEM in include/linux/mm.h, but it's in a comment.  The
fixdep script doesn't parse C itself, so it doesn't know that this should
be ignored.  Rather than fix the typo, I deleted the comment; the ifdef'ed
code is a mere two lines so the comment seems unnecessary.

This serves as a useful warning to people -- don't put CONFIG_FOO in a
comment unnecessarily.  Because even when it's true now, maybe the #if
gets changed and the comment doesn't.

Index: include/linux/mm.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/linux/mm.h,v
retrieving revision 1.5
diff -u -p -r1.5 mm.h
--- a/include/linux/mm.h	28 Sep 2003 04:06:20 -0000	1.5
+++ b/include/linux/mm.h	1 Oct 2003 13:15:53 -0000
@@ -196,7 +196,7 @@ struct page {
 #if defined(WANT_PAGE_VIRTUAL)
 	void *virtual;			/* Kernel virtual address (NULL if
 					   not kmapped, ie. highmem) */
-#endif /* CONFIG_HIGMEM || WANT_PAGE_VIRTUAL */
+#endif
 };
 
 /*

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk

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

end of thread, other threads:[~2003-10-01 20:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-01 13:26 [PATCH] CONFIG_* In Comments Considered Harmful Matthew Wilcox
2003-10-01 14:19 ` Dave Jones
2003-10-01 14:29   ` Valdis.Kletnieks
2003-10-01 14:42     ` Jörn Engel
2003-10-01 14:49       ` Matthew Wilcox
2003-10-01 14:41   ` Muli Ben-Yehuda
2003-10-01 14:39 ` Jörn Engel
     [not found]   ` <20031001145206.GH29313@actcom.co.il>
2003-10-01 15:10     ` Jörn Engel
2003-10-01 20:15       ` Muli Ben-Yehuda
2003-10-01 20:27         ` Linus Torvalds
2003-10-01 14:58 ` Sam Ravnborg

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