mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] <linux/mm{,zone}.h> const
@ 2004-07-20 18:39 Geert Uytterhoeven
  0 siblings, 0 replies; only message in thread
From: Geert Uytterhoeven @ 2004-07-20 18:39 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton
  Cc: Linux Kernel Development, Geert Uytterhoeven

Make input parameters const where possible.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

--- linux-2.6.8-rc2/include/linux/mm.h	2004-07-15 23:15:19.000000000 +0200
+++ linux-m68k-2.6.8-rc2/include/linux/mm.h	2004-07-18 16:07:51.000000000 +0200
@@ -373,11 +373,11 @@
 #define NODEZONE_SHIFT (sizeof(page_flags_t)*8 - MAX_NODES_SHIFT - MAX_ZONES_SHIFT)
 #define NODEZONE(node, zone)	((node << ZONES_SHIFT) | zone)
 
-static inline unsigned long page_zonenum(struct page *page)
+static inline unsigned long page_zonenum(const struct page *page)
 {
 	return (page->flags >> NODEZONE_SHIFT) & (~(~0UL << ZONES_SHIFT));
 }
-static inline unsigned long page_to_nid(struct page *page)
+static inline unsigned long page_to_nid(const struct page *page)
 {
 	return (page->flags >> (NODEZONE_SHIFT + ZONES_SHIFT));
 }
@@ -385,7 +385,7 @@
 struct zone;
 extern struct zone *zone_table[];
 
-static inline struct zone *page_zone(struct page *page)
+static inline struct zone *page_zone(const struct page *page)
 {
 	return zone_table[page->flags >> NODEZONE_SHIFT];
 }
@@ -401,7 +401,7 @@
 extern struct page *mem_map;
 #endif
 
-static inline void *lowmem_page_address(struct page *page)
+static inline void *lowmem_page_address(const struct page *page)
 {
 	return __va(page_to_pfn(page) << PAGE_SHIFT);
 }
@@ -455,7 +455,7 @@
  * Return the pagecache index of the passed page.  Regular pagecache pages
  * use ->index whereas swapcache pages use ->private
  */
-static inline pgoff_t page_index(struct page *page)
+static inline pgoff_t page_index(const struct page *page)
 {
 	if (unlikely(PageSwapCache(page)))
 		return page->private;
@@ -465,7 +465,7 @@
 /*
  * Return true if this page is mapped into pagetables.
  */
-static inline int page_mapped(struct page *page)
+static inline int page_mapped(const struct page *page)
 {
 	return page->mapcount != 0;
 }
--- linux-2.6.8-rc2/include/linux/mmzone.h	2004-07-15 23:15:19.000000000 +0200
+++ linux-m68k-2.6.8-rc2/include/linux/mmzone.h	2004-07-20 15:10:18.000000000 +0200
@@ -360,20 +360,29 @@
  *              to ZONE_{DMA/NORMAL/HIGHMEM/etc} in general code to a minimum.
  * @zone - pointer to struct zone variable
  */
-static inline int is_highmem(struct zone *zone)
+static inline int is_highmem(const struct zone *zone)
 {
 	return (zone - zone->zone_pgdat->node_zones == ZONE_HIGHMEM);
 }
 
-static inline int is_normal(struct zone *zone)
+static inline int is_normal(const struct zone *zone)
 {
 	return (zone - zone->zone_pgdat->node_zones == ZONE_NORMAL);
 }
 
 /* These two functions are used to setup the per zone pages min values */

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-07-20 18:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-20 18:39 [PATCH] <linux/mm{,zone}.h> const Geert Uytterhoeven

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®