linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Neaten page virtual choice
@ 2004-12-02 16:26 Matthew Wilcox
  2004-12-02 18:35 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Matthew Wilcox @ 2004-12-02 16:26 UTC (permalink / raw)
  To: linux-mm; +Cc: Andrew Morton

Make it more obvious that WANT_PAGE_VIRTUAL/HASHED_PAGE_VIRTUAL/!HIGHMEM
is a three way choice.

Index: linux/include/linux/mm.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/linux/mm.h,v
retrieving revision 1.22
diff -u -p -r1.22 mm.h
--- linux/include/linux/mm.h	29 Nov 2004 19:56:48 -0000	1.22
+++ linux/include/linux/mm.h	1 Dec 2004 20:53:38 -0000
@@ -414,29 +414,22 @@ static inline void *lowmem_page_address(
 	return __va(page_to_pfn(page) << PAGE_SHIFT);
 }
 
-#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL)
-#define HASHED_PAGE_VIRTUAL
-#endif
-
 #if defined(WANT_PAGE_VIRTUAL)
-#define page_address(page) ((page)->virtual)
-#define set_page_address(page, address)			\
+  #define page_address(page) ((page)->virtual)
+  #define set_page_address(page, address)			\
 	do {						\
 		(page)->virtual = (address);		\
 	} while(0)
-#define page_address_init()  do { } while(0)
-#endif
-
-#if defined(HASHED_PAGE_VIRTUAL)
-void *page_address(struct page *page);
-void set_page_address(struct page *page, void *virtual);
-void page_address_init(void);
-#endif
-
-#if !defined(HASHED_PAGE_VIRTUAL) && !defined(WANT_PAGE_VIRTUAL)
-#define page_address(page) lowmem_page_address(page)
-#define set_page_address(page, address)  do { } while(0)
-#define page_address_init()  do { } while(0)
+  #define page_address_init()  do { } while(0)
+#elif defined(CONFIG_HIGHMEM)
+  #define HASHED_PAGE_VIRTUAL
+  void *page_address(struct page *page);
+  void set_page_address(struct page *page, void *virtual);
+  void page_address_init(void);
+#else
+  #define page_address(page) lowmem_page_address(page)
+  #define set_page_address(page, address)  do { } while(0)
+  #define page_address_init()  do { } while(0)
 #endif
 
 /*
Index: linux/mm/highmem.c
===================================================================
RCS file: /var/cvs/linux-2.6/mm/highmem.c,v
retrieving revision 1.8
diff -u -p -r1.8 highmem.c
--- linux/mm/highmem.c	30 Sep 2004 12:08:53 -0000	1.8
+++ linux/mm/highmem.c	1 Dec 2004 21:49:21 -0000
@@ -483,7 +483,7 @@ void blk_queue_bounce(request_queue_t *q
 
 EXPORT_SYMBOL(blk_queue_bounce);
 
-#if defined(HASHED_PAGE_VIRTUAL)
+#ifdef HASHED_PAGE_VIRTUAL
 
 #define PA_HASH_ORDER	7
 
@@ -602,4 +602,4 @@ void __init page_address_init(void)
 	spin_lock_init(&pool_lock);
 }
 
-#endif	/* defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) */
+#endif	/* HASHED_PAGE_VIRTUAL */

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

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

* Re: [PATCH] Neaten page virtual choice
  2004-12-02 16:26 [PATCH] Neaten page virtual choice Matthew Wilcox
@ 2004-12-02 18:35 ` Christoph Hellwig
  2004-12-02 18:42   ` Martin J. Bligh
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2004-12-02 18:35 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: linux-mm, Andrew Morton

>  #if defined(WANT_PAGE_VIRTUAL)
> -#define page_address(page) ((page)->virtual)
> -#define set_page_address(page, address)			\
> +  #define page_address(page) ((page)->virtual)
> +  #define set_page_address(page, address)			\

urgg, this is a horrible non-standard indentation.

If you look at other kernel source you see either:

 - no indentation inside #ifdef at all (seems like most of the source)
 - indentation after the leading #
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

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

* Re: [PATCH] Neaten page virtual choice
  2004-12-02 18:35 ` Christoph Hellwig
@ 2004-12-02 18:42   ` Martin J. Bligh
  2004-12-02 19:12     ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Martin J. Bligh @ 2004-12-02 18:42 UTC (permalink / raw)
  To: Christoph Hellwig, Matthew Wilcox; +Cc: linux-mm, Andrew Morton

--Christoph Hellwig <hch@infradead.org> wrote (on Thursday, December 02, 2004 18:35:06 +0000):

>>  # if defined(WANT_PAGE_VIRTUAL)
>> -#define page_address(page) ((page)->virtual)
>> -#define set_page_address(page, address)			\
>> +  #define page_address(page) ((page)->virtual)
>> +  #define set_page_address(page, address)			\
> 
> urgg, this is a horrible non-standard indentation.
> 
> If you look at other kernel source you see either:
> 
>  - no indentation inside #ifdef at all (seems like most of the source)
>  - indentation after the leading #

To be fair, both of those seem far more horrible than the above ;-)
Though I'd agree it's not exactly standard.

M.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

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

* Re: [PATCH] Neaten page virtual choice
  2004-12-02 18:42   ` Martin J. Bligh
@ 2004-12-02 19:12     ` Christoph Hellwig
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2004-12-02 19:12 UTC (permalink / raw)
  To: Martin J. Bligh
  Cc: Christoph Hellwig, Matthew Wilcox, linux-mm, Andrew Morton

> >  - no indentation inside #ifdef at all (seems like most of the source)
> >  - indentation after the leading #
> 
> To be fair, both of those seem far more horrible than the above ;-)
> Though I'd agree it's not exactly standard.

I completely disagree.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

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

end of thread, other threads:[~2004-12-02 19:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-02 16:26 [PATCH] Neaten page virtual choice Matthew Wilcox
2004-12-02 18:35 ` Christoph Hellwig
2004-12-02 18:42   ` Martin J. Bligh
2004-12-02 19:12     ` Christoph Hellwig

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