linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PowerPC/Cell: use vzalloc rather than vmalloc and memset in spu_alloc_lscsa_std
@ 2010-10-30 18:10 Jesper Juhl
  2010-10-30 21:25 ` [Cbe-oss-dev] " Jeremy Kerr
  2010-10-30 21:41 ` Arnd Bergmann
  0 siblings, 2 replies; 3+ messages in thread
From: Jesper Juhl @ 2010-10-30 18:10 UTC (permalink / raw)
  To: linux-kernel; +Cc: cbe-oss-dev, Paul Mackerras, linuxppc-dev, Arnd Bergmann

Hi,

We can get rid of a memset in 
arch/powerpc/platforms/cell/spufs/lscsa_alloc.c::spu_alloc_lscsa_std() by 
using vzalloc() rather than vmalloc()+memset().

Completely untested patch below since I have no hardware nor tools to 
compile this.


Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
 lscsa_alloc.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c b/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
index a101abf..3b894f5 100644
--- a/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
+++ b/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
@@ -36,10 +36,9 @@ static int spu_alloc_lscsa_std(struct spu_state *csa)
 	struct spu_lscsa *lscsa;
 	unsigned char *p;
 
-	lscsa = vmalloc(sizeof(struct spu_lscsa));
+	lscsa = vzalloc(sizeof(struct spu_lscsa));
 	if (!lscsa)
 		return -ENOMEM;
-	memset(lscsa, 0, sizeof(struct spu_lscsa));
 	csa->lscsa = lscsa;
 
 	/* Set LS pages reserved to allow for user-space mapping. */


-- 
Jesper Juhl <jj@chaosbits.net>             http://www.chaosbits.net/
Plain text mails only, please      http://www.expita.com/nomime.html
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Cbe-oss-dev] [PATCH] PowerPC/Cell: use vzalloc rather than vmalloc and memset in spu_alloc_lscsa_std
  2010-10-30 18:10 [PATCH] PowerPC/Cell: use vzalloc rather than vmalloc and memset in spu_alloc_lscsa_std Jesper Juhl
@ 2010-10-30 21:25 ` Jeremy Kerr
  2010-10-30 21:41 ` Arnd Bergmann
  1 sibling, 0 replies; 3+ messages in thread
From: Jeremy Kerr @ 2010-10-30 21:25 UTC (permalink / raw)
  To: cbe-oss-dev
  Cc: Arnd Bergmann, linux-kernel, Jesper Juhl, Paul Mackerras,
	linuxppc-dev

Jesper,

> We can get rid of a memset in
> arch/powerpc/platforms/cell/spufs/lscsa_alloc.c::spu_alloc_lscsa_std() by
> using vzalloc() rather than vmalloc()+memset().

Looks good to me.

Acked-By: Jeremy Kerr <jk@ozlabs.org>

Ben, could you apply this to the powerpc tree?

Cheers,


Jeremy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PowerPC/Cell: use vzalloc rather than vmalloc and memset in spu_alloc_lscsa_std
  2010-10-30 18:10 [PATCH] PowerPC/Cell: use vzalloc rather than vmalloc and memset in spu_alloc_lscsa_std Jesper Juhl
  2010-10-30 21:25 ` [Cbe-oss-dev] " Jeremy Kerr
@ 2010-10-30 21:41 ` Arnd Bergmann
  1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2010-10-30 21:41 UTC (permalink / raw)
  To: Jesper Juhl; +Cc: cbe-oss-dev, linuxppc-dev, Paul Mackerras, linux-kernel

On Saturday 30 October 2010, Jesper Juhl wrote:
> We can get rid of a memset in 
> arch/powerpc/platforms/cell/spufs/lscsa_alloc.c::spu_alloc_lscsa_std() by 
> using vzalloc() rather than vmalloc()+memset().
> 
> Completely untested patch below since I have no hardware nor tools to 
> compile this.
> 
> 
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-10-30 21:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-30 18:10 [PATCH] PowerPC/Cell: use vzalloc rather than vmalloc and memset in spu_alloc_lscsa_std Jesper Juhl
2010-10-30 21:25 ` [Cbe-oss-dev] " Jeremy Kerr
2010-10-30 21:41 ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).