From: "J.A. Magallon" <jamagallon@able.es>
To: "Linux-Kernel, " <linux-kernel@vger.kernel.org>
Subject: [PATCH] Use const* parameters in mm.h
Date: Thu, 23 Mar 2006 22:12:41 +0100 [thread overview]
Message-ID: <20060323221241.719662a8@werewolf.auna.net> (raw)
In-Reply-To: <20060323220711.28fcb82f@werewolf.auna.net>
[-- Attachment #1: Type: text/plain, Size: 3836 bytes --]
On Thu, 23 Mar 2006 22:07:11 +0100, "J.A. Magallon" <jamagallon@able.es> wrote:
> On Thu, 23 Mar 2006 01:40:46 -0800, Andrew Morton <akpm@osdl.org> wrote:
>
> >
> > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.16/2.6.16-mm1/
> >
>
As they are inline, this gives the compiler wide space for optmizations.
--- linux-2.6.15-rc5-mm2.orig/include/linux/mm.h 2005-12-12 09:10:34.000000000 -0800
+++ linux-2.6.15-rc5-mm2/include/linux/mm.h 2005-12-14 14:39:50.000000000 -0800
@@ -464,7 +464,7 @@ void put_page(struct page *page);
#define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1)
#define ZONETABLE_MASK ((1UL << ZONETABLE_SHIFT) - 1)
-static inline unsigned long page_zonenum(struct page *page)
+static inline unsigned long page_zonenum(const struct page *page)
{
return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK;
}
@@ -472,20 +472,20 @@ static inline unsigned long page_zonenum
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 >> ZONETABLE_PGSHIFT) &
ZONETABLE_MASK];
}
-static inline unsigned long page_to_nid(struct page *page)
+static inline unsigned long page_to_nid(const struct page *page)
{
if (FLAGS_HAS_NODE)
return (page->flags >> NODES_PGSHIFT) & NODES_MASK;
else
return page_zone(page)->zone_pgdat->node_id;
}
-static inline unsigned long page_to_section(struct page *page)
+static inline unsigned long page_to_section(const struct page *page)
{
return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK;
}
@@ -519,7 +519,7 @@ static inline void set_page_links(struct
extern struct page *mem_map;
#endif
-static __always_inline void *lowmem_page_address(struct page *page)
+static __always_inline void *lowmem_page_address(const struct page *page)
{
return __va(page_to_pfn(page) << PAGE_SHIFT);
}
@@ -561,7 +561,7 @@ void page_address_init(void);
#define PAGE_MAPPING_ANON 1
extern struct address_space swapper_space;
-static inline struct address_space *page_mapping(struct page *page)
+static inline struct address_space *page_mapping(const struct page *page)
{
struct address_space *mapping = page->mapping;
@@ -572,7 +572,7 @@ static inline struct address_space *page
return mapping;
}
-static inline int PageAnon(struct page *page)
+static inline int PageAnon(const struct page *page)
{
return ((unsigned long)page->mapping & PAGE_MAPPING_ANON) != 0;
}
@@ -581,7 +581,7 @@ static inline int PageAnon(struct page *
* 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(page);
@@ -598,7 +598,7 @@ static inline void reset_page_mapcount(s
atomic_set(&(page)->_mapcount, -1);
}
-static inline int page_mapcount(struct page *page)
+static inline int page_mapcount(const struct page *page)
{
return atomic_read(&(page)->_mapcount) + 1;
}
@@ -606,7 +606,7 @@ static inline int page_mapcount(struct p
/*
* 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 atomic_read(&(page)->_mapcount) >= 0;
}
--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandriva Linux release 2006.1 (Cooker) for i586
Linux 2.6.15-jam20 (gcc 4.0.3 (4.0.3-1mdk for Mandriva Linux release 2006.1))
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 191 bytes --]
next prev parent reply other threads:[~2006-03-23 21:12 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-23 9:40 2.6.16-mm1 Andrew Morton
[not found] ` <6bffcb0e0603230631r5e6cc3d3p@mail.gmail.com>
2006-03-23 14:49 ` 2.6.16-mm1 Russell King
2006-03-23 16:11 ` 2.6.16-mm1 Michal Piotrowski
2006-03-24 11:28 ` 2.6.16-mm1 Roman Zippel
2006-03-24 19:59 ` 2.6.16-mm1 Russell King
2006-03-28 9:18 ` 2.6.16-mm1 Roman Zippel
2006-03-23 17:58 ` 2.6.16-mm1 Dave Jones
2006-03-23 21:37 ` 2.6.16-mm1 Andrew Morton
2006-03-24 12:09 ` [PATCH] use select for GART_IOMMU to enable AGP Roman Zippel
2006-03-24 12:13 ` Andi Kleen
2006-03-24 12:45 ` Roman Zippel
2006-03-24 12:51 ` Andi Kleen
2006-03-24 13:49 ` Roman Zippel
2006-03-23 21:07 ` 2.6.16-mm1 J.A. Magallon
2006-03-23 21:11 ` [PATCH] Make __get_cpu_var use raw_smp_processor_id() J.A. Magallon
2006-03-23 22:35 ` David S. Miller
2006-03-23 21:12 ` J.A. Magallon [this message]
2006-03-24 21:35 ` [PATCH] Use const* parameters in mm.h Andrew Morton
2006-03-23 21:13 ` [PATCH] Lower e100 latency J.A. Magallon
2006-03-23 22:33 ` Jeff Garzik
2006-03-27 20:30 ` J.A. Magallon
2006-03-27 20:57 ` Jesse Brandeburg
2006-03-23 21:15 ` [PATCH] Dont build altivec raid on x86 J.A. Magallon
2006-03-23 21:22 ` Brian Gerst
2006-03-27 20:28 ` J.A. Magallon
2006-03-23 22:51 ` 2.6.16-mm1 Rafael J. Wysocki
2006-03-23 23:42 ` 2.6.16-mm1: CONFIG_HOTPLUG_CPU compile error Adrian Bunk
2006-03-23 23:53 ` Ashok Raj
2006-03-23 23:55 ` [RFC: -mm patch] remove drm_{alloc,free}_pages Adrian Bunk
2006-03-23 23:57 ` [-mm patch] drivers/video/intelfb/intelfbhw.c: make struct plls static Adrian Bunk
2006-03-24 0:00 ` [-mm patch] make drivers/char/ipmi/ipmi_msghandler.c:ipmi_find_bmc_guid() static Adrian Bunk
2006-03-24 0:02 ` [-mm patch] drivers/char/ipmi/ipmi_si_intf.c: make a struct static Adrian Bunk
[not found] ` <200603232317.50245.Rafal.Wysocki@fuw.edu.pl>
2006-03-24 0:04 ` 2.6.16-mm1 Andrew Morton
2006-03-24 0:17 ` 2.6.16-mm1 john stultz
2006-03-24 0:38 ` 2.6.16-mm1 Rafael J. Wysocki
2006-03-24 0:49 ` 2.6.16-mm1 john stultz
2006-03-24 1:04 ` 2.6.16-mm1 Rafael J. Wysocki
2006-03-24 1:12 ` 2.6.16-mm1 john stultz
2006-03-24 1:23 ` 2.6.16-mm1 Rafael J. Wysocki
2006-03-24 1:28 ` 2.6.16-mm1 Andrew Morton
2006-03-24 3:47 ` 2.6.16-mm1 Andi Kleen
2006-03-24 2:17 ` 2.6.16-mm1 Brandon Low
2006-03-24 2:24 ` 2.6.16-mm1 Andrew Morton
2006-03-24 2:45 ` 2.6.16-mm1 Brandon Low
2006-03-24 2:58 ` 2.6.16-mm1 Andrew Morton
2006-03-24 3:21 ` 2.6.16-mm1 Brandon Low
2006-03-24 11:39 ` 2.6.16-mm1 Andrew Morton
2006-03-24 12:58 ` 2.6.16-mm1 Brandon Low
2006-03-24 18:33 ` 2.6.16-mm1 Andrew Morton
2006-03-24 18:37 ` 2.6.16-mm1 Jens Axboe
2006-03-24 19:15 ` 2.6.16-mm1 Brandon Low
2006-03-27 10:58 ` 2.6.16-mm1 Jens Axboe
2006-03-27 16:24 ` 2.6.16-mm1 OGAWA Hirofumi
2006-03-27 17:15 ` 2.6.16-mm1 Jens Axboe
2006-03-24 11:56 ` 2.6.16-mm1 grub oddness Mike Galbraith
2006-03-24 18:25 ` Andrew Morton
2006-03-25 4:55 ` Mike Galbraith
2006-03-25 4:53 ` Andrew Morton
2006-03-25 5:14 ` Mike Galbraith
2006-03-25 12:44 ` Mike Galbraith
2006-03-26 9:10 ` Mike Galbraith
2006-03-26 16:01 ` Mike Galbraith
2006-03-26 16:47 ` Mike Galbraith
2006-03-26 12:25 ` [-mm patch] fix nfs PROC_FS=n compile error Adrian Bunk
2006-03-26 12:25 ` [-mm patch] BLK_DEV_IO_TRACE Kconfig fixes Adrian Bunk
2006-03-26 12:27 ` Jens Axboe
2006-03-26 12:33 ` Adrian Bunk
2006-03-26 12:37 ` Jens Axboe
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=20060323221241.719662a8@werewolf.auna.net \
--to=jamagallon@able.es \
--cc=linux-kernel@vger.kernel.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
Powered by JetHome