* [PATCH] powerpc/kernel: Remove gcc 4 workaround from include/asm/io.h
@ 2018-11-25 21:14 Darren Stevens
2018-11-26 6:55 ` Christophe LEROY
0 siblings, 1 reply; 2+ messages in thread
From: Darren Stevens @ 2018-11-25 21:14 UTC (permalink / raw)
To: linuxppc-dev
There are verions of DEF_MMIO_IN_X and DEF_MMIO_OUT_X in asm/io.h
that contain a workaround for a limitation in gcc <=4.0, but the
minimum supported version of gcc is now 4.6, so these can be safely
removed.
Signed-off-by: Darren Stevens <darren@stevens-zone.net>
---
diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
index e0331e7..4433477 100644
--- a/arch/powerpc/include/asm/io.h
+++ b/arch/powerpc/include/asm/io.h
@@ -108,25 +108,6 @@
#define IO_SET_SYNC_FLAG()
#endif
-/* gcc 4.0 and older doesn't have 'Z' constraint */
-#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ == 0)
-#define DEF_MMIO_IN_X(name, size, insn) \
-static inline u##size name(const volatile u##size __iomem *addr) \
-{ \
- u##size ret; \
- __asm__ __volatile__("sync;"#insn" %0,0,%1;twi 0,%0,0;isync" \
- : "=r" (ret) : "r" (addr), "m" (*addr) : "memory"); \
- return ret; \
-}
-
-#define DEF_MMIO_OUT_X(name, size, insn) \
-static inline void name(volatile u##size __iomem *addr, u##size val) \
-{ \
- __asm__ __volatile__("sync;"#insn" %1,0,%2" \
- : "=m" (*addr) : "r" (val), "r" (addr) : "memory"); \
- IO_SET_SYNC_FLAG(); \
-}
-#else /* newer gcc */
#define DEF_MMIO_IN_X(name, size, insn) \
static inline u##size name(const volatile u##size __iomem *addr) \
{ \
@@ -143,7 +124,6 @@ static inline void name(volatile u##size __iomem *addr, u##size val) \
: "=Z" (*addr) : "r" (val) : "memory"); \
IO_SET_SYNC_FLAG(); \
}
-#endif
#define DEF_MMIO_IN_D(name, size, insn) \
static inline u##size name(const volatile u##size __iomem *addr) \
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] powerpc/kernel: Remove gcc 4 workaround from include/asm/io.h
2018-11-25 21:14 [PATCH] powerpc/kernel: Remove gcc 4 workaround from include/asm/io.h Darren Stevens
@ 2018-11-26 6:55 ` Christophe LEROY
0 siblings, 0 replies; 2+ messages in thread
From: Christophe LEROY @ 2018-11-26 6:55 UTC (permalink / raw)
To: Darren Stevens, linuxppc-dev
Le 25/11/2018 à 22:14, Darren Stevens a écrit :
> There are verions of DEF_MMIO_IN_X and DEF_MMIO_OUT_X in asm/io.h
> that contain a workaround for a limitation in gcc <=4.0, but the
> minimum supported version of gcc is now 4.6, so these can be safely
> removed.
This code is already gone, see
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.20-rc4&id=a0e102914aa3f619a5bc68a0d33e17d1788cdf4c
Christophe
>
> Signed-off-by: Darren Stevens <darren@stevens-zone.net>
>
> ---
>
> diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
> index e0331e7..4433477 100644
> --- a/arch/powerpc/include/asm/io.h
> +++ b/arch/powerpc/include/asm/io.h
> @@ -108,25 +108,6 @@
> #define IO_SET_SYNC_FLAG()
> #endif
>
> -/* gcc 4.0 and older doesn't have 'Z' constraint */
> -#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ == 0)
> -#define DEF_MMIO_IN_X(name, size, insn) \
> -static inline u##size name(const volatile u##size __iomem *addr) \
> -{ \
> - u##size ret; \
> - __asm__ __volatile__("sync;"#insn" %0,0,%1;twi 0,%0,0;isync" \
> - : "=r" (ret) : "r" (addr), "m" (*addr) : "memory"); \
> - return ret; \
> -}
> -
> -#define DEF_MMIO_OUT_X(name, size, insn) \
> -static inline void name(volatile u##size __iomem *addr, u##size val) \
> -{ \
> - __asm__ __volatile__("sync;"#insn" %1,0,%2" \
> - : "=m" (*addr) : "r" (val), "r" (addr) : "memory"); \
> - IO_SET_SYNC_FLAG(); \
> -}
> -#else /* newer gcc */
> #define DEF_MMIO_IN_X(name, size, insn) \
> static inline u##size name(const volatile u##size __iomem *addr) \
> { \
> @@ -143,7 +124,6 @@ static inline void name(volatile u##size __iomem *addr, u##size val) \
> : "=Z" (*addr) : "r" (val) : "memory"); \
> IO_SET_SYNC_FLAG(); \
> }
> -#endif
>
> #define DEF_MMIO_IN_D(name, size, insn) \
> static inline u##size name(const volatile u##size __iomem *addr) \
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-26 6:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-25 21:14 [PATCH] powerpc/kernel: Remove gcc 4 workaround from include/asm/io.h Darren Stevens
2018-11-26 6:55 ` Christophe LEROY
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).