From patchwork Fri Oct 17 02:38:32 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Kerr X-Patchwork-Id: 4793 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 9417FDDF16 for ; Fri, 17 Oct 2008 13:38:53 +1100 (EST) X-Original-To: cbe-oss-dev@ozlabs.org Delivered-To: cbe-oss-dev@ozlabs.org Received: by ozlabs.org (Postfix, from userid 1023) id 2418FDDDF9; Fri, 17 Oct 2008 13:38:41 +1100 (EST) MIME-Version: 1.0 Message-Id: <1224211112.343689.181542604048.1.gpush@pingu> To: From: Jeremy Kerr Date: Fri, 17 Oct 2008 13:38:32 +1100 Subject: [Cbe-oss-dev] [PATCH] powerpc/spufs: use kmalloc rather than kzalloc for switch log buffer X-BeenThere: cbe-oss-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Discussion about Open Source Software for the Cell Broadband Engine List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org No need to zero the entire buffer, just the head and tail indices. Signed-off-by: Jeremy Kerr --- arch/powerpc/platforms/cell/spufs/file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;