提交 b3c8aef0 编写于 作者: E Ernesto Ramos 提交者: Greg Kroah-Hartman

staging:ti dspbridge: remove unnecessary volatile variables

Remove unnecessary volatile variables; use accessor
functions __raw_readl/__raw_writel instead when applicable.
Signed-off-by: NErnesto Ramos <ernesto@ti.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 74ea8ff9
...@@ -404,7 +404,7 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, ...@@ -404,7 +404,7 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt,
pr_err("%s: Illegal SM base\n", __func__); pr_err("%s: Illegal SM base\n", __func__);
status = -EPERM; status = -EPERM;
} else } else
*((volatile u32 *)dw_sync_addr) = 0xffffffff; __raw_writel(0xffffffff, dw_sync_addr);
if (DSP_SUCCEEDED(status)) { if (DSP_SUCCEEDED(status)) {
resources = dev_context->resources; resources = dev_context->resources;
...@@ -584,7 +584,7 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, ...@@ -584,7 +584,7 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt,
dev_dbg(bridge, "Waiting for Sync @ 0x%x\n", dw_sync_addr); dev_dbg(bridge, "Waiting for Sync @ 0x%x\n", dw_sync_addr);
dev_dbg(bridge, "DSP c_int00 Address = 0x%x\n", dsp_addr); dev_dbg(bridge, "DSP c_int00 Address = 0x%x\n", dsp_addr);
if (dsp_debug) if (dsp_debug)
while (*((volatile u16 *)dw_sync_addr)) while (__raw_readw(dw_sync_addr))
;; ;;
/* Wait for DSP to clear word in shared memory */ /* Wait for DSP to clear word in shared memory */
...@@ -602,7 +602,7 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, ...@@ -602,7 +602,7 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt,
/* Write the synchronization bit to indicate the /* Write the synchronization bit to indicate the
* completion of OPP table update to DSP * completion of OPP table update to DSP
*/ */
*((volatile u32 *)dw_sync_addr) = 0XCAFECAFE; __raw_writel(0XCAFECAFE, dw_sync_addr);
/* update board state */ /* update board state */
dev_context->dw_brd_state = BRD_RUNNING; dev_context->dw_brd_state = BRD_RUNNING;
...@@ -1852,7 +1852,7 @@ bool wait_for_start(struct bridge_dev_context *dev_context, u32 dw_sync_addr) ...@@ -1852,7 +1852,7 @@ bool wait_for_start(struct bridge_dev_context *dev_context, u32 dw_sync_addr)
u16 timeout = TIHELEN_ACKTIMEOUT; u16 timeout = TIHELEN_ACKTIMEOUT;
/* Wait for response from board */ /* Wait for response from board */
while (*((volatile u16 *)dw_sync_addr) && --timeout) while (__raw_readw(dw_sync_addr) && --timeout)
udelay(10); udelay(10);
/* If timed out: return false */ /* If timed out: return false */
......
...@@ -86,8 +86,8 @@ static u8 priv_h2a(u8 value) ...@@ -86,8 +86,8 @@ static u8 priv_h2a(u8 value)
static void priv_tramp_sym_gen_name(u32 value, char *dst) static void priv_tramp_sym_gen_name(u32 value, char *dst)
{ {
u32 i; u32 i;
volatile char *prefix = TRAMP_SYM_PREFIX; char *prefix = TRAMP_SYM_PREFIX;
volatile char *dst_local = dst; char *dst_local = dst;
u8 tmp; u8 tmp;
/* Clear out the destination, including the ending NULL */ /* Clear out the destination, including the ending NULL */
......
...@@ -1008,6 +1008,7 @@ void *cmm_xlator_alloc_buf(struct cmm_xlatorobject *xlator, void *va_buf, ...@@ -1008,6 +1008,7 @@ void *cmm_xlator_alloc_buf(struct cmm_xlatorobject *xlator, void *va_buf,
{ {
struct cmm_xlator *xlator_obj = (struct cmm_xlator *)xlator; struct cmm_xlator *xlator_obj = (struct cmm_xlator *)xlator;
void *pbuf = NULL; void *pbuf = NULL;
void *tmp_va_buff;
struct cmm_attrs attrs; struct cmm_attrs attrs;
DBC_REQUIRE(refs > 0); DBC_REQUIRE(refs > 0);
...@@ -1019,16 +1020,16 @@ void *cmm_xlator_alloc_buf(struct cmm_xlatorobject *xlator, void *va_buf, ...@@ -1019,16 +1020,16 @@ void *cmm_xlator_alloc_buf(struct cmm_xlatorobject *xlator, void *va_buf,
if (xlator_obj) { if (xlator_obj) {
attrs.ul_seg_id = xlator_obj->ul_seg_id; attrs.ul_seg_id = xlator_obj->ul_seg_id;
*(volatile u32 *)va_buf = 0; __raw_writel(0, va_buf);
/* Alloc SM */ /* Alloc SM */
pbuf = pbuf =
cmm_calloc_buf(xlator_obj->hcmm_mgr, pa_size, &attrs, NULL); cmm_calloc_buf(xlator_obj->hcmm_mgr, pa_size, &attrs, NULL);
if (pbuf) { if (pbuf) {
/* convert to translator(node/strm) process Virtual /* convert to translator(node/strm) process Virtual
* address */ * address */
*(volatile u32 **)va_buf = tmp_va_buff = cmm_xlator_translate(xlator,
(u32 *) cmm_xlator_translate(xlator,
pbuf, CMM_PA2VA); pbuf, CMM_PA2VA);
__raw_writel((u32)tmp_va_buff, va_buf);
} }
} }
return pbuf; return pbuf;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册