public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] reduce casting in sysenter.c
Date: Mon, 23 Aug 2004 10:47:54 -0700	[thread overview]
Message-ID: <1093283274.3153.958.camel@nighthawk> (raw)

[-- Attachment #1: Type: text/plain, Size: 448 bytes --]

Ran across this because it's another place where an unsigned long is
passed directly to __pa().  Making the "page" variable a void* seems a
bit more natural than an unsigned long and reduces the net number of
casts by 1.  Without it, we probably need another (void *) cast in the
__pa() call. 

For more explanation as to why this was probably done originally, see
this post:
http://marc.theaimsgroup.com/?l=linux-mm&m=109155379124628&w=2

-- Dave

[-- Attachment #2: sysenter-types.patch --]
[-- Type: text/x-patch, Size: 980 bytes --]



---

 memhotplug-dave/arch/i386/kernel/sysenter.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -puN arch/i386/kernel/sysenter.c~sysenter-types arch/i386/kernel/sysenter.c
--- memhotplug/arch/i386/kernel/sysenter.c~sysenter-types	2004-08-23 10:38:24.000000000 -0700
+++ memhotplug-dave/arch/i386/kernel/sysenter.c	2004-08-23 10:38:24.000000000 -0700
@@ -43,18 +43,18 @@ extern const char vsyscall_sysenter_star
 
 static int __init sysenter_setup(void)
 {
-	unsigned long page = get_zeroed_page(GFP_ATOMIC);
+	void *page = (void *)get_zeroed_page(GFP_ATOMIC);
 
 	__set_fixmap(FIX_VSYSCALL, __pa(page), PAGE_READONLY_EXEC);
 
 	if (!boot_cpu_has(X86_FEATURE_SEP)) {
-		memcpy((void *) page,
+		memcpy(page,
 		       &vsyscall_int80_start,
 		       &vsyscall_int80_end - &vsyscall_int80_start);
 		return 0;
 	}
 
-	memcpy((void *) page,
+	memcpy(page,
 	       &vsyscall_sysenter_start,
 	       &vsyscall_sysenter_end - &vsyscall_sysenter_start);
 
_

                 reply	other threads:[~2004-08-23 17:49 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=1093283274.3153.958.camel@nighthawk \
    --to=haveblue@us.ibm.com \
    --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