[lkml]   [2021]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] mm/ioremap: remove volatile keyword in iounmap function
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 <>
mm/ioremap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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)

-void iounmap(volatile void __iomem *addr)
+void iounmap(void __iomem *addr)
vunmap((void *)((unsigned long)addr & PAGE_MASK));
 \ /
  Last update: 2021-02-22 06:03    [W:0.027 / U:1.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site