DORMANTno replies

[PATCH] mm/ioremap: remove volatile keyword in iounmap function

From: Zhiyuan Dai <hidden>
Date: 2021-02-22 05:03:13
Also in: lkml
Subsystem: memory management, memory management - misc, the rest · Maintainers: Andrew Morton, David Hildenbrand, Linus Torvalds

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 <redacted>
---
 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)
 }
 EXPORT_SYMBOL(ioremap_prot);
 
-void iounmap(volatile void __iomem *addr)
+void iounmap(void __iomem *addr)
 {
 	vunmap((void *)((unsigned long)addr & PAGE_MASK));
 }
-- 
1.8.3.1

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help