Commit 467d93a7 authored by Jesper Juhl's avatar Jesper Juhl Committed by Benjamin Herrenschmidt

powerpc/cell: Use vzalloc rather than vmalloc and memset in spu_alloc_lscsa_std

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: default avatarJesper Juhl <jj@chaosbits.net>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent cd34206e
...@@ -36,10 +36,9 @@ static int spu_alloc_lscsa_std(struct spu_state *csa) ...@@ -36,10 +36,9 @@ static int spu_alloc_lscsa_std(struct spu_state *csa)
struct spu_lscsa *lscsa; struct spu_lscsa *lscsa;
unsigned char *p; unsigned char *p;
lscsa = vmalloc(sizeof(struct spu_lscsa)); lscsa = vzalloc(sizeof(struct spu_lscsa));
if (!lscsa) if (!lscsa)
return -ENOMEM; return -ENOMEM;
memset(lscsa, 0, sizeof(struct spu_lscsa));
csa->lscsa = lscsa; csa->lscsa = lscsa;
/* Set LS pages reserved to allow for user-space mapping. */ /* Set LS pages reserved to allow for user-space mapping. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment