All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Nick Piggin <npiggin@suse.de>, Andrew Morton <akpm@osdl.org>,
	Linux Memory Management List <linux-mm@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [patch] mm: introduce remap_vmalloc_range (pls. drop previous patchset)
Date: Fri, 21 Apr 2006 11:02:06 +0200	[thread overview]
Message-ID: <20060421090206.GT21660@wotan.suse.de> (raw)
In-Reply-To: <84144f020604210157s406a08a7yd3c43d9ef2939ce@mail.gmail.com>

On Fri, Apr 21, 2006 at 11:57:32AM +0300, Pekka Enberg wrote:
> Hi Nick,
> 
> On 4/21/06, Nick Piggin <npiggin@suse.de> wrote:
> > +       addr = (void *)((unsigned long)addr + (pgoff << PAGE_SHIFT));
> 
> As Andrew said, you can get rid of the casting 

So he did...

---
Index: linux-2.6/mm/vmalloc.c
===================================================================
--- linux-2.6.orig/mm/vmalloc.c
+++ linux-2.6/mm/vmalloc.c
@@ -725,7 +725,7 @@ int remap_vmalloc_range(struct vm_area_s
 		goto out_einval_locked;
 	read_unlock(&vmlist_lock);
 
-	addr = (void *)((unsigned long)addr + (pgoff << PAGE_SHIFT));
+	addr += pgoff << PAGE_SHIFT;
 	do {
 		struct page *page = vmalloc_to_page(addr);
 		ret = vm_insert_page(vma, uaddr, page);
@@ -733,7 +733,7 @@ int remap_vmalloc_range(struct vm_area_s
 			return ret;
 
 		uaddr += PAGE_SIZE;
-		addr = (void *)((unsigned long)addr+PAGE_SIZE);
+		addr += PAGE_SIZE;
 		usize -= PAGE_SIZE;
 	} while (usize > 0);
 

WARNING: multiple messages have this Message-ID (diff)
From: Nick Piggin <npiggin@suse.de>
To: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Nick Piggin <npiggin@suse.de>, Andrew Morton <akpm@osdl.org>,
	Linux Memory Management List <linux-mm@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [patch] mm: introduce remap_vmalloc_range (pls. drop previous patchset)
Date: Fri, 21 Apr 2006 11:02:06 +0200	[thread overview]
Message-ID: <20060421090206.GT21660@wotan.suse.de> (raw)
In-Reply-To: <84144f020604210157s406a08a7yd3c43d9ef2939ce@mail.gmail.com>

On Fri, Apr 21, 2006 at 11:57:32AM +0300, Pekka Enberg wrote:
> Hi Nick,
> 
> On 4/21/06, Nick Piggin <npiggin@suse.de> wrote:
> > +       addr = (void *)((unsigned long)addr + (pgoff << PAGE_SHIFT));
> 
> As Andrew said, you can get rid of the casting 

So he did...

---
Index: linux-2.6/mm/vmalloc.c
===================================================================
--- linux-2.6.orig/mm/vmalloc.c
+++ linux-2.6/mm/vmalloc.c
@@ -725,7 +725,7 @@ int remap_vmalloc_range(struct vm_area_s
 		goto out_einval_locked;
 	read_unlock(&vmlist_lock);
 
-	addr = (void *)((unsigned long)addr + (pgoff << PAGE_SHIFT));
+	addr += pgoff << PAGE_SHIFT;
 	do {
 		struct page *page = vmalloc_to_page(addr);
 		ret = vm_insert_page(vma, uaddr, page);
@@ -733,7 +733,7 @@ int remap_vmalloc_range(struct vm_area_s
 			return ret;
 
 		uaddr += PAGE_SIZE;
-		addr = (void *)((unsigned long)addr+PAGE_SIZE);
+		addr += PAGE_SIZE;
 		usize -= PAGE_SIZE;
 	} while (usize > 0);
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2006-04-21  9:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-21  8:45 [patch] mm: introduce remap_vmalloc_range (pls. drop previous patchset) Nick Piggin
2006-04-21  8:45 ` Nick Piggin
2006-04-21  8:57 ` Pekka Enberg
2006-04-21  8:57   ` Pekka Enberg
2006-04-21  9:02   ` Nick Piggin [this message]
2006-04-21  9:02     ` Nick Piggin

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=20060421090206.GT21660@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@cs.helsinki.fi \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.