linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Darren Stevens <darren@stevens-zone.net>
To: linuxppc-dev@lists.ozlabs.org
Subject: [PATCH] powerpc/kernel: Remove gcc 4 workaround from include/asm/io.h
Date: Sun, 25 Nov 2018 21:14:49 +0000 (GMT)	[thread overview]
Message-ID: <4ceed1989a9.364d3263@auth.smtp.1and1.co.uk> (raw)

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




             reply	other threads:[~2018-11-25 21:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-25 21:14 Darren Stevens [this message]
2018-11-26  6:55 ` [PATCH] powerpc/kernel: Remove gcc 4 workaround from include/asm/io.h Christophe LEROY

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=4ceed1989a9.364d3263@auth.smtp.1and1.co.uk \
    --to=darren@stevens-zone.net \
    --cc=linuxppc-dev@lists.ozlabs.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;
as well as URLs for NNTP newsgroup(s).