Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging:ti dspbridge: remove unnecessary volatile variables

Remove unnecessary volatile variables; use accessor
functions __raw_readl/__raw_writel instead when applicable.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Ernesto Ramos and committed by
Greg Kroah-Hartman
b3c8aef0 74ea8ff9

+10 -9
+4 -4
drivers/staging/tidspbridge/core/tiomap3430.c
··· 404 404 pr_err("%s: Illegal SM base\n", __func__); 405 405 status = -EPERM; 406 406 } else 407 - *((volatile u32 *)dw_sync_addr) = 0xffffffff; 407 + __raw_writel(0xffffffff, dw_sync_addr); 408 408 409 409 if (DSP_SUCCEEDED(status)) { 410 410 resources = dev_context->resources; ··· 584 584 dev_dbg(bridge, "Waiting for Sync @ 0x%x\n", dw_sync_addr); 585 585 dev_dbg(bridge, "DSP c_int00 Address = 0x%x\n", dsp_addr); 586 586 if (dsp_debug) 587 - while (*((volatile u16 *)dw_sync_addr)) 587 + while (__raw_readw(dw_sync_addr)) 588 588 ;; 589 589 590 590 /* Wait for DSP to clear word in shared memory */ ··· 602 602 /* Write the synchronization bit to indicate the 603 603 * completion of OPP table update to DSP 604 604 */ 605 - *((volatile u32 *)dw_sync_addr) = 0XCAFECAFE; 605 + __raw_writel(0XCAFECAFE, dw_sync_addr); 606 606 607 607 /* update board state */ 608 608 dev_context->dw_brd_state = BRD_RUNNING; ··· 1852 1852 u16 timeout = TIHELEN_ACKTIMEOUT; 1853 1853 1854 1854 /* Wait for response from board */ 1855 - while (*((volatile u16 *)dw_sync_addr) && --timeout) 1855 + while (__raw_readw(dw_sync_addr) && --timeout) 1856 1856 udelay(10); 1857 1857 1858 1858 /* If timed out: return false */
+2 -2
drivers/staging/tidspbridge/dynload/tramp.c
··· 86 86 static void priv_tramp_sym_gen_name(u32 value, char *dst) 87 87 { 88 88 u32 i; 89 - volatile char *prefix = TRAMP_SYM_PREFIX; 90 - volatile char *dst_local = dst; 89 + char *prefix = TRAMP_SYM_PREFIX; 90 + char *dst_local = dst; 91 91 u8 tmp; 92 92 93 93 /* Clear out the destination, including the ending NULL */
+4 -3
drivers/staging/tidspbridge/pmgr/cmm.c
··· 1008 1008 { 1009 1009 struct cmm_xlator *xlator_obj = (struct cmm_xlator *)xlator; 1010 1010 void *pbuf = NULL; 1011 + void *tmp_va_buff; 1011 1012 struct cmm_attrs attrs; 1012 1013 1013 1014 DBC_REQUIRE(refs > 0); ··· 1020 1019 1021 1020 if (xlator_obj) { 1022 1021 attrs.ul_seg_id = xlator_obj->ul_seg_id; 1023 - *(volatile u32 *)va_buf = 0; 1022 + __raw_writel(0, va_buf); 1024 1023 /* Alloc SM */ 1025 1024 pbuf = 1026 1025 cmm_calloc_buf(xlator_obj->hcmm_mgr, pa_size, &attrs, NULL); 1027 1026 if (pbuf) { 1028 1027 /* convert to translator(node/strm) process Virtual 1029 1028 * address */ 1030 - *(volatile u32 **)va_buf = 1031 - (u32 *) cmm_xlator_translate(xlator, 1029 + tmp_va_buff = cmm_xlator_translate(xlator, 1032 1030 pbuf, CMM_PA2VA); 1031 + __raw_writel((u32)tmp_va_buff, va_buf); 1033 1032 } 1034 1033 } 1035 1034 return pbuf;