archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/ioremap: remove volatile keyword in iounmap function
@ 2021-02-22  5:01 Zhiyuan Dai
  0 siblings, 0 replies; only message in thread
From: Zhiyuan Dai @ 2021-02-22  5:01 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, Zhiyuan Dai

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));

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-22  5:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-22  5:01 [PATCH] mm/ioremap: remove volatile keyword in iounmap function Zhiyuan Dai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).