From patchwork Thu Aug 27 12:18:55 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 44250 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7RCJEBv016103 for ; Thu, 27 Aug 2009 12:19:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751706AbZH0MTM (ORCPT ); Thu, 27 Aug 2009 08:19:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752135AbZH0MTM (ORCPT ); Thu, 27 Aug 2009 08:19:12 -0400 Received: from smtp.nokia.com ([192.100.122.233]:17389 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751706AbZH0MTL (ORCPT ); Thu, 27 Aug 2009 08:19:11 -0400 Received: from esebh105.NOE.Nokia.com (esebh105.ntc.nokia.com [172.21.138.211]) by mgw-mx06.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n7RCIXR9016599 for ; Thu, 27 Aug 2009 15:18:58 +0300 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 27 Aug 2009 15:19:08 +0300 Received: from mgw-da01.ext.nokia.com ([147.243.128.24]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Thu, 27 Aug 2009 15:19:06 +0300 Received: from dilbert.research.nokia.com (esdhcp034223.research.nokia.com [172.21.34.223]) by mgw-da01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n7RCIxfk003280 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Thu, 27 Aug 2009 15:19:01 +0300 Received: from andy by dilbert.research.nokia.com with local (Exim 4.69) (envelope-from ) id 1MgdwT-0000Uj-RW; Thu, 27 Aug 2009 15:19:01 +0300 From: Andy Shevchenko To: linux-omap@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH 2/8] dspbridge: Drop useless memory allocation Date: Thu, 27 Aug 2009 15:18:55 +0300 Message-Id: <1251375541-1866-3-git-send-email-andy.shevchenko@gmail.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1251375541-1866-2-git-send-email-andy.shevchenko@gmail.com> References: <1251375541-1866-1-git-send-email-andy.shevchenko@gmail.com> <1251375541-1866-2-git-send-email-andy.shevchenko@gmail.com> X-OriginalArrivalTime: 27 Aug 2009 12:19:07.0200 (UTC) FILETIME=[92F57400:01CA2710] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Andy Shevchenko strcmp() should do the job without additional memory allocation and strncpy()/strcmp() calls. Additionally fix spelling. Signed-off-by: Andy Shevchenko Acked-by: Fernando Guzman Lugo --- drivers/dsp/bridge/rmgr/node.c | 15 ++++----------- 1 files changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/dsp/bridge/rmgr/node.c b/drivers/dsp/bridge/rmgr/node.c index d3f0e34..e213b22 100644 --- a/drivers/dsp/bridge/rmgr/node.c +++ b/drivers/dsp/bridge/rmgr/node.c @@ -404,7 +404,6 @@ DSP_STATUS NODE_Allocate(struct PROC_OBJECT *hProcessor, DSP_STATUS status = DSP_SOK; struct CMM_OBJECT *hCmmMgr = NULL; /* Shared memory manager hndl */ u32 procId; - char *label; u32 pulValue; u32 dynextBase; u32 offSet = 0; @@ -691,18 +690,16 @@ func_cont2: } } - /* Comapare value read from Node Properties and check if it is same as + /* Compare value read from Node Properties and check if it is same as * STACKSEGLABEL, if yes read the Address of STACKSEGLABEL, calculate * GPP Address, Read the value in that address and override the * uStackSeg value in task args */ if (DSP_SUCCEEDED(status) && (char *)pNode->dcdProps.objData.nodeObj.ndbProps.uStackSegName != NULL) { - label = MEM_Calloc(sizeof(STACKSEGLABEL)+1, MEM_PAGED); - strncpy(label, STACKSEGLABEL, sizeof(STACKSEGLABEL)+1); - - if (strcmp((char *)pNode->dcdProps.objData.nodeObj. - ndbProps.uStackSegName, label) == 0) { + if (strcmp((char *) + pNode->dcdProps.objData.nodeObj.ndbProps.uStackSegName, + STACKSEGLABEL) == 0) { status = hNodeMgr->nldrFxns.pfnGetFxnAddr(pNode-> hNldrNode, "DYNEXT_BEG", &dynextBase); if (DSP_FAILED(status)) { @@ -744,10 +741,6 @@ func_cont2: ulStackSegVal; } - - if (label) - MEM_Free(label); - }