mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Benjamin LaHaise <bcrl@kvack.org>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] __mod_page_state - pass unsigned long instead of unsigned
Date: Wed, 1 Jun 2005 10:59:14 -0400	[thread overview]
Message-ID: <20050601145914.GA25250@kvack.org> (raw)

By making the offset argument of __mod_page_state an unsigned long instead 
of unsigned, we can avoid forcing the compiler to sign extend a usually 
constant argument.  This saves 1 instruction on x86-64.

		-ben

Signed-off-by: Benjamin LaHaise <benjamin.c.lahaise@intel.com>
diff -purN v2.6.12-rc5/include/linux/page-flags.h test-rc5/include/linux/page-flags.h
--- v2.6.12-rc5/include/linux/page-flags.h	2005-05-30 13:29:33.000000000 -0400
+++ test-rc5/include/linux/page-flags.h	2005-06-01 10:45:53.000000000 -0400
@@ -137,7 +137,7 @@ struct page_state {
 extern void get_page_state(struct page_state *ret);
 extern void get_full_page_state(struct page_state *ret);
 extern unsigned long __read_page_state(unsigned offset);
-extern void __mod_page_state(unsigned offset, unsigned long delta);
+extern void __mod_page_state(unsigned long offset, unsigned long delta);
 
 #define read_page_state(member) \
 	__read_page_state(offsetof(struct page_state, member))
diff -purN v2.6.12-rc5/mm/page_alloc.c test-rc5/mm/page_alloc.c
--- v2.6.12-rc5/mm/page_alloc.c	2005-05-30 13:29:34.000000000 -0400
+++ test-rc5/mm/page_alloc.c	2005-06-01 10:46:25.000000000 -0400
@@ -1128,7 +1128,7 @@ unsigned long __read_page_state(unsigned
 	return ret;
 }
 
-void __mod_page_state(unsigned offset, unsigned long delta)
+void __mod_page_state(unsigned long offset, unsigned long delta)
 {
 	unsigned long flags;
 	void* ptr;

                 reply	other threads:[~2005-06-01 14:57 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=20050601145914.GA25250@kvack.org \
    --to=bcrl@kvack.org \
    --cc=akpm@osdl.org \
    --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

all inboxes | Powered by JetHome®