From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>
Cc: Linux Kernel Development <linux-kernel@vger.kernel.org>,
Geert Uytterhoeven <geert@linux-m68k.org>
Subject: [PATCH] <linux/mm{,zone}.h> const
Date: Tue, 20 Jul 2004 20:39:56 +0200 [thread overview]
Message-ID: <200407201839.i6KIduOg015570@anakin.of.borg> (raw)
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
reply other threads:[~2004-07-20 18:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200407201839.i6KIduOg015570@anakin.of.borg \
--to=geert@linux-m68k.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®