Re: [PATCH 01/15] m68k: move *_relaxed macros into io_no.h and io_mm.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Angelo,

On 18/04/18 06:53, Angelo Dureghello wrote:
thanks for this great job.

:-)


On patch 10, PIC is PCI, right ?

Yes, typo on my part. I even managed to get it wrong twice!
I'll fix that.


In case you hae some time,  am interested in understanding how those
guards

#define xxx xxx

works.

In this particular case it is to allow local architecture code to
have its own version of a function or macro and for the common
kernel code to define it if it is not otherwise defined.

Consider this example, in our local arch code we want an optimized
"readb" function. If we just had:

  static inline u8 readb(void __iomem *addr)
  { ... }

and the common code (such as include/asm-generic/io.h) had the
common readb in a similar fashion:

  static inline u8 readb(void __iomem *addr)
  { ... }

On compilation you are going to get readb multiply defined.
If instead the common code had:

  #ifndef read
  #define readb readb
  static inline u8 readb(void __iomem *addr)
  { ... }
  #endif

Then all we need to do in our local arch code is define "readb".
If we defined it as a macro, then no problem that would just work.
If we want it as a real function (preferable) then we just need to
make sure that "readb" is somehow defined, so the simplest way is
to just define it to be itself:

  #define read readb

Obviously our local arch code has to be included first.


Is it ok to test the patch now in my mcf54415 based board ?

Yes, please do. I expect it should fix the the issues you found,
but lets confirm that is really the case.

I will be issuing a v2 of the series - to fix the problems found by
the autobuilder. But they are minor changes, and I would like to
know that they actually fix your problems first.


Reviewed-by: Angelo Dureghello <angelo@xxxxxxxx>

Thanks for that. I will add that in.

Regards
Greg


On Wed, Apr 11, 2018 at 10:54:14PM +1000, Greg Ungerer wrote:
Move a copy of the definitions of the *_relaxed() macros into io_no.h
and io_mm.h. This precedes a change to the io_no.h file to use
asm-generic/io.h. They will be removed from io_no.h at that point.

Signed-off-by: Greg Ungerer <gerg@xxxxxxxxxxxxxx>
---
 arch/m68k/include/asm/io.h    | 8 --------
 arch/m68k/include/asm/io_mm.h | 8 ++++++++
 arch/m68k/include/asm/io_no.h | 8 ++++++++
 3 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/arch/m68k/include/asm/io.h b/arch/m68k/include/asm/io.h
index 756089c..00b4515 100644
--- a/arch/m68k/include/asm/io.h
+++ b/arch/m68k/include/asm/io.h
@@ -4,11 +4,3 @@
 #else
 #include <asm/io_mm.h>
 #endif
-
-#define readb_relaxed(addr)	readb(addr)
-#define readw_relaxed(addr)	readw(addr)
-#define readl_relaxed(addr)	readl(addr)
-
-#define writeb_relaxed(b, addr)	writeb(b, addr)
-#define writew_relaxed(b, addr)	writew(b, addr)
-#define writel_relaxed(b, addr)	writel(b, addr)
diff --git a/arch/m68k/include/asm/io_mm.h b/arch/m68k/include/asm/io_mm.h
index ed5333e..22e778e 100644
--- a/arch/m68k/include/asm/io_mm.h
+++ b/arch/m68k/include/asm/io_mm.h
@@ -524,4 +524,12 @@ static inline void ioport_unmap(void __iomem *p)
 {
 }
 
+#define readb_relaxed(addr)	readb(addr)
+#define readw_relaxed(addr)	readw(addr)
+#define readl_relaxed(addr)	readl(addr)
+
+#define writeb_relaxed(b, addr)	writeb(b, addr)
+#define writew_relaxed(b, addr)	writew(b, addr)
+#define writel_relaxed(b, addr)	writel(b, addr)
+
 #endif /* _IO_H */
diff --git a/arch/m68k/include/asm/io_no.h b/arch/m68k/include/asm/io_no.h
index 86f45b4..ffe567e 100644
--- a/arch/m68k/include/asm/io_no.h
+++ b/arch/m68k/include/asm/io_no.h
@@ -189,4 +189,12 @@ static inline void ioport_unmap(void __iomem *p)
 
 #endif /* __KERNEL__ */
 
+#define readb_relaxed(addr)	readb(addr)
+#define readw_relaxed(addr)	readw(addr)
+#define readl_relaxed(addr)	readl(addr)
+
+#define writeb_relaxed(b, addr)	writeb(b, addr)
+#define writew_relaxed(b, addr)	writew(b, addr)
+#define writel_relaxed(b, addr)	writel(b, addr)
+
 #endif /* _M68KNOMMU_IO_H */
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux