Patchwork powerpc/spufs: use kmalloc rather than kzalloc for switch log buffer

login
register
mail settings
Submitter Jeremy Kerr
Date Oct. 17, 2008, 2:38 a.m.
Message ID <1224211112.343689.181542604048.1.gpush@pingu>
Download mbox | patch
Permalink /patch/4793/
State Accepted
Headers show

Comments

Jeremy Kerr - Oct. 17, 2008, 2:38 a.m.
No need to zero the entire buffer, just the head and tail indices.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

---
 arch/powerpc/platforms/cell/spufs/file.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index b6f7b91..b73c369 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -2442,7 +2442,7 @@  static int spufs_switch_log_open(struct inode *inode, struct file *file)
 		goto out;
 	}
 
-	ctx->switch_log = kzalloc(sizeof(struct switch_log) +
+	ctx->switch_log = kmalloc(sizeof(struct switch_log) +
 		SWITCH_LOG_BUFSIZE * sizeof(struct switch_log_entry),
 		GFP_KERNEL);
 
@@ -2451,6 +2451,7 @@  static int spufs_switch_log_open(struct inode *inode, struct file *file)
 		goto out;
 	}
 
+	ctx->switch_log->head = ctx->switch_log->tail = 0;
 	init_waitqueue_head(&ctx->switch_log->wait);
 	rc = 0;