mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <ahmad@a3f.at>
Subject: [PATCH] asm-generic: define IOMEM for assembly as well
Date: Mon,  9 Jan 2023 18:58:28 +0100	[thread overview]
Message-ID: <20230109175828.2017699-1-ahmad@a3f.at> (raw)

In interest of type safety, we should start using IOMEM() for register
MMIO base addresses that we keep in headers for PBL. Some of these
addresses are used from assembly code as well, so define IOMEM() for
that case.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 include/asm-generic/io.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index e41b4df40366..51f65ceb0a2e 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -442,7 +442,11 @@ static inline void *phys_to_virt(unsigned long phys)
 #endif
 
 #ifndef IOMEM
+#ifndef __ASSEMBLY__
 #define IOMEM(addr)	((void __force __iomem *)(addr))
+#else
+#define IOMEM(addr)	addr
+#endif
 #endif
 
 #define __io_virt(x) ((void __force *)(x))
-- 
2.38.1




             reply	other threads:[~2023-01-09 18:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09 17:58 Ahmad Fatoum [this message]
2023-01-10 14:38 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230109175828.2017699-1-ahmad@a3f.at \
    --to=ahmad@a3f.at \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox