diff mbox series

mm/ioremap: remove volatile keyword in iounmap function

Message ID 1613970095-22577-1-git-send-email-daizhiyuan@phytium.com.cn (mailing list archive)
State New, archived
Headers show
Series mm/ioremap: remove volatile keyword in iounmap function | expand

Commit Message

Zhiyuan Dai Feb. 22, 2021, 5:01 a.m. UTC
Like volatile, the kernel primitives which make concurrent
access to data safe (spinlocks, mutexes, memory barriers,
etc.) are designed to prevent unwanted optimization.

If they are being used properly, there will be no need to
use volatile as well.  If volatile is still necessary,
there is almost certainly a bug in the code somewhere.
In properly-written kernel code, volatile can only serve
to slow things down.

see: Documentation/process/volatile-considered-harmful.rst

Signed-off-by: Zhiyuan Dai <daizhiyuan@phytium.com.cn>
---
 mm/ioremap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/mm/ioremap.c b/mm/ioremap.c
index 5fa1ab4..c49dd41 100644
--- a/mm/ioremap.c
+++ b/mm/ioremap.c
@@ -281,7 +281,7 @@  void __iomem *ioremap_prot(phys_addr_t addr, size_t size, unsigned long prot)
 }
 EXPORT_SYMBOL(ioremap_prot);
 
-void iounmap(volatile void __iomem *addr)
+void iounmap(void __iomem *addr)
 {
 	vunmap((void *)((unsigned long)addr & PAGE_MASK));
 }