All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] ARM: asm/io.h: kill off confusing #ifdef __mem_pci block
@ 2019-09-10  8:51 Rasmus Villemoes
  2019-09-10  8:51 ` [U-Boot] [PATCH 2/2] ARM: asm/io.h: remove redundant #if !defined(readb) block Rasmus Villemoes
  2019-10-12 20:23 ` [U-Boot] [PATCH 1/2] ARM: asm/io.h: kill off confusing #ifdef __mem_pci block Tom Rini
  0 siblings, 2 replies; 4+ messages in thread
From: Rasmus Villemoes @ 2019-09-10  8:51 UTC (permalink / raw
  To: u-boot

No ARM board seems to define __mem_pci - and if it did, one would get tons of

  ./arch/arm/include/asm/io.h:307:0: warning: "readl" redefined

warnings, because readl and friends are unconditionally defined
earlier in io.h. Moreover, the redefinitions lack the memory barriers
that the first definitions have. So I'm guessing this is practically
dead code.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
---
 arch/arm/include/asm/io.h | 41 ---------------------------------------
 1 file changed, 41 deletions(-)

diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index e6d27b69f9..78b183d42f 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -315,46 +315,6 @@ extern void _memset_io(unsigned long, int, size_t);
 
 extern void __readwrite_bug(const char *fn);
 
-/*
- * If this architecture has PCI memory IO, then define the read/write
- * macros.  These should only be used with the cookie passed from
- * ioremap.
- */
-#ifdef __mem_pci
-
-#define readb(c) ({ unsigned int __v = __raw_readb(__mem_pci(c)); __v; })
-#define readw(c) ({ unsigned int __v = le16_to_cpu(__raw_readw(__mem_pci(c))); __v; })
-#define readl(c) ({ unsigned int __v = le32_to_cpu(__raw_readl(__mem_pci(c))); __v; })
-
-#define writeb(v,c)		__raw_writeb(v,__mem_pci(c))
-#define writew(v,c)		__raw_writew(cpu_to_le16(v),__mem_pci(c))
-#define writel(v,c)		__raw_writel(cpu_to_le32(v),__mem_pci(c))
-
-#define memset_io(c,v,l)		_memset_io(__mem_pci(c),(v),(l))
-#define memcpy_fromio(a,c,l)		_memcpy_fromio((a),__mem_pci(c),(l))
-#define memcpy_toio(c,a,l)		_memcpy_toio(__mem_pci(c),(a),(l))
-
-#define eth_io_copy_and_sum(s,c,l,b) \
-				eth_copy_and_sum((s),__mem_pci(c),(l),(b))
-
-static inline int
-check_signature(unsigned long io_addr, const unsigned char *signature,
-		int length)
-{
-	int retval = 0;
-	do {
-		if (readb(io_addr) != *signature)
-			goto out;
-		io_addr++;
-		signature++;
-		length--;
-	} while (length);
-	retval = 1;
-out:
-	return retval;
-}
-
-#else
 #define memset_io(a, b, c)		memset((void *)(a), (b), (c))
 #define memcpy_fromio(a, b, c)		memcpy((a), (void *)(b), (c))
 #define memcpy_toio(a, b, c)		memcpy((void *)(a), (b), (c))
@@ -373,7 +333,6 @@ out:
 #define check_signature(io,sig,len)	(0)
 
 #endif
-#endif	/* __mem_pci */
 
 /*
  * If this architecture has ISA IO, then define the isa_read/isa_write
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH 2/2] ARM: asm/io.h: remove redundant #if !defined(readb) block
  2019-09-10  8:51 [U-Boot] [PATCH 1/2] ARM: asm/io.h: kill off confusing #ifdef __mem_pci block Rasmus Villemoes
@ 2019-09-10  8:51 ` Rasmus Villemoes
  2019-10-12 20:23   ` Tom Rini
  2019-10-12 20:23 ` [U-Boot] [PATCH 1/2] ARM: asm/io.h: kill off confusing #ifdef __mem_pci block Tom Rini
  1 sibling, 1 reply; 4+ messages in thread
From: Rasmus Villemoes @ 2019-09-10  8:51 UTC (permalink / raw
  To: u-boot

readb is unconditionally defined earlier in io.h, so there's no point
checking whether it's undefined.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
---
 arch/arm/include/asm/io.h | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index 78b183d42f..723f3cf497 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -319,21 +319,6 @@ extern void __readwrite_bug(const char *fn);
 #define memcpy_fromio(a, b, c)		memcpy((a), (void *)(b), (c))
 #define memcpy_toio(a, b, c)		memcpy((void *)(a), (b), (c))
 
-#if !defined(readb)
-
-#define readb(addr)			(__readwrite_bug("readb"),0)
-#define readw(addr)			(__readwrite_bug("readw"),0)
-#define readl(addr)			(__readwrite_bug("readl"),0)
-#define writeb(v,addr)			__readwrite_bug("writeb")
-#define writew(v,addr)			__readwrite_bug("writew")
-#define writel(v,addr)			__readwrite_bug("writel")
-
-#define eth_io_copy_and_sum(a,b,c,d)	__readwrite_bug("eth_io_copy_and_sum")
-
-#define check_signature(io,sig,len)	(0)
-
-#endif
-
 /*
  * If this architecture has ISA IO, then define the isa_read/isa_write
  * macros.
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH 1/2] ARM: asm/io.h: kill off confusing #ifdef __mem_pci block
  2019-09-10  8:51 [U-Boot] [PATCH 1/2] ARM: asm/io.h: kill off confusing #ifdef __mem_pci block Rasmus Villemoes
  2019-09-10  8:51 ` [U-Boot] [PATCH 2/2] ARM: asm/io.h: remove redundant #if !defined(readb) block Rasmus Villemoes
@ 2019-10-12 20:23 ` Tom Rini
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Rini @ 2019-10-12 20:23 UTC (permalink / raw
  To: u-boot

On Tue, Sep 10, 2019 at 08:51:53AM +0000, Rasmus Villemoes wrote:

> No ARM board seems to define __mem_pci - and if it did, one would get tons of
> 
>   ./arch/arm/include/asm/io.h:307:0: warning: "readl" redefined
> 
> warnings, because readl and friends are unconditionally defined
> earlier in io.h. Moreover, the redefinitions lack the memory barriers
> that the first definitions have. So I'm guessing this is practically
> dead code.
> 
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191012/a9d36c0c/attachment.sig>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH 2/2] ARM: asm/io.h: remove redundant #if !defined(readb) block
  2019-09-10  8:51 ` [U-Boot] [PATCH 2/2] ARM: asm/io.h: remove redundant #if !defined(readb) block Rasmus Villemoes
@ 2019-10-12 20:23   ` Tom Rini
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2019-10-12 20:23 UTC (permalink / raw
  To: u-boot

On Tue, Sep 10, 2019 at 08:51:54AM +0000, Rasmus Villemoes wrote:

> readb is unconditionally defined earlier in io.h, so there's no point
> checking whether it's undefined.
> 
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191012/96483672/attachment.sig>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-10-12 20:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-10  8:51 [U-Boot] [PATCH 1/2] ARM: asm/io.h: kill off confusing #ifdef __mem_pci block Rasmus Villemoes
2019-09-10  8:51 ` [U-Boot] [PATCH 2/2] ARM: asm/io.h: remove redundant #if !defined(readb) block Rasmus Villemoes
2019-10-12 20:23   ` Tom Rini
2019-10-12 20:23 ` [U-Boot] [PATCH 1/2] ARM: asm/io.h: kill off confusing #ifdef __mem_pci block Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.