From patchwork Mon Jun 21 22:07:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ramos Falcon, Ernesto" X-Patchwork-Id: 107265 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5LM4E1H030330 for ; Mon, 21 Jun 2010 22:04:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754004Ab0FUWEN (ORCPT ); Mon, 21 Jun 2010 18:04:13 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:43108 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752409Ab0FUWEM (ORCPT ); Mon, 21 Jun 2010 18:04:12 -0400 Received: from dlep33.itg.ti.com ([157.170.170.112]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id o5LM493J013106 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 21 Jun 2010 17:04:09 -0500 Received: from emcc1.sasken-mty.naucm.ext.ti.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id o5LM48Tl011043; Mon, 21 Jun 2010 17:04:08 -0500 (CDT) Received: from localhost.localdomain (x0076199-desktop.sasken-mty.naucm.ext.ti.com [10.87.230.107]) by emcc1.sasken-mty.naucm.ext.ti.com (8.13.8+Sun/8.13.8) with ESMTP id o5LM43d7027313; Mon, 21 Jun 2010 17:04:08 -0500 (CDT) From: Ernesto Ramos To: linux-omap@vger.kernel.org Cc: felipe.contreras@nokia.com, ameya.palande@nokia.com, hiroshi.doyu@nokia.com, Ernesto Ramos Subject: [PATCH 4/5] DSPBRIDGE: Remove unnecessary volatile variables Date: Mon, 21 Jun 2010 17:07:13 -0500 Message-Id: <1277158034-21843-4-git-send-email-ernesto@ti.com> X-Mailer: git-send-email 1.5.4.5 In-Reply-To: <1277158034-21843-3-git-send-email-ernesto@ti.com> References: <1277158034-21843-1-git-send-email-ernesto@ti.com> <1277158034-21843-2-git-send-email-ernesto@ti.com> <1277158034-21843-3-git-send-email-ernesto@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 21 Jun 2010 22:04:14 +0000 (UTC) diff --git a/drivers/dsp/bridge/core/tiomap3430.c b/drivers/dsp/bridge/core/tiomap3430.c index 35c6678..8b9892f 100644 --- a/drivers/dsp/bridge/core/tiomap3430.c +++ b/drivers/dsp/bridge/core/tiomap3430.c @@ -417,7 +417,7 @@ static int bridge_brd_start(struct bridge_dev_context *hDevContext, pr_err("%s: Illegal SM base\n", __func__); status = -EPERM; } else - *((volatile u32 *)dw_sync_addr) = 0xffffffff; + __raw_writel(0xffffffff, dw_sync_addr); if (DSP_SUCCEEDED(status)) { resources = dev_context->resources; @@ -603,7 +603,7 @@ static int bridge_brd_start(struct bridge_dev_context *hDevContext, dev_dbg(bridge, "Waiting for Sync @ 0x%x\n", dw_sync_addr); dev_dbg(bridge, "DSP c_int00 Address = 0x%x\n", dwDSPAddr); if (dsp_debug) - while (*((volatile u16 *)dw_sync_addr)) + while (__raw_readw(dw_sync_addr)) ;; /* Wait for DSP to clear word in shared memory */ @@ -621,7 +621,7 @@ static int bridge_brd_start(struct bridge_dev_context *hDevContext, /* Write the synchronization bit to indicate the * completion of OPP table update to DSP */ - *((volatile u32 *)dw_sync_addr) = 0XCAFECAFE; + __raw_writel(0XCAFECAFE, dw_sync_addr); /* update board state */ dev_context->dw_brd_state = BRD_RUNNING; @@ -1875,7 +1875,7 @@ bool wait_for_start(struct bridge_dev_context *dev_context, u32 dw_sync_addr) u16 timeout = TIHELEN_ACKTIMEOUT; /* Wait for response from board */ - while (*((volatile u16 *)dw_sync_addr) && --timeout) + while (__raw_readw(dw_sync_addr) && --timeout) udelay(10); /* If timed out: return FALSE */ diff --git a/drivers/dsp/bridge/dynload/tramp.c b/drivers/dsp/bridge/dynload/tramp.c index 7b593fc..8d2d526 100644 --- a/drivers/dsp/bridge/dynload/tramp.c +++ b/drivers/dsp/bridge/dynload/tramp.c @@ -86,8 +86,8 @@ static u8 priv_h2a(u8 value) static void priv_tramp_sym_gen_name(u32 value, char *dst) { u32 i; - volatile char *prefix = TRAMP_SYM_PREFIX; - volatile char *dst_local = dst; + char *prefix = TRAMP_SYM_PREFIX; + char *dst_local = dst; u8 tmp; /* Clear out the destination, including the ending NULL */ diff --git a/drivers/dsp/bridge/pmgr/cmm.c b/drivers/dsp/bridge/pmgr/cmm.c index 1134193..aa69b5e 100644 --- a/drivers/dsp/bridge/pmgr/cmm.c +++ b/drivers/dsp/bridge/pmgr/cmm.c @@ -1009,6 +1009,7 @@ void *cmm_xlator_alloc_buf(struct cmm_xlatorobject *xlator, void *pVaBuf, { struct cmm_xlator *xlator_obj = (struct cmm_xlator *)xlator; void *pbuf = NULL; + void *tmp_va_buff; struct cmm_attrs attrs; DBC_REQUIRE(refs > 0); @@ -1020,16 +1021,16 @@ void *cmm_xlator_alloc_buf(struct cmm_xlatorobject *xlator, void *pVaBuf, if (xlator_obj) { attrs.ul_seg_id = xlator_obj->ul_seg_id; - *(volatile u32 *)pVaBuf = 0; + __raw_writel(0, pVaBuf); /* Alloc SM */ pbuf = cmm_calloc_buf(xlator_obj->hcmm_mgr, uPaSize, &attrs, NULL); if (pbuf) { /* convert to translator(node/strm) process Virtual * address */ - *(volatile u32 **)pVaBuf = - (u32 *) cmm_xlator_translate(xlator, + tmp_va_buff = cmm_xlator_translate(xlator, pbuf, CMM_PA2VA); + __raw_writel((u32)tmp_va_buff, pVaBuf); } } return pbuf;