Skip to contentSkip to conversation

ARM: zynq: fix "'IO_SPACE_LIMIT' redefined" warning

RFC Superseded Antony Pavlov 3 participants 5 messages Jan 9, 2019 – Jan 10, 2019

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

RFC 1/1 ARM: zynq: fix "'IO_SPACE_LIMIT' redefined" warning

The patch fixes the following compiler's warning:

In file included from include/common.h:33:0,

                 from arch/arm/mach-zynq/zynq.c:18:

arch/arm/include/asm/io.h:4:0: warning: "IO_SPACE_LIMIT" redefined
#define IO_SPACE_LIMIT 0

In file included from
arch/arm/mach-zynq/zynq.c:17:0:
include/asm-generic/io.h:92:0: note: this is the location of the previous definition
#define IO_SPACE_LIMIT 0xffff

Cc Steffen Trumtrar <[email protected]>
---
 arch/arm/mach-zynq/zynq.c | 1 -
 1 file changed, 1 deletion(-)
arch/arm/mach-zynq/zynq.c +0 -1
index a0a8d0d249..dd8f12c16a 100644
@@ -14,7 +14,6 @@
  */
 
 #include <asm/system.h>
-#include <asm-generic/io.h>
 #include <common.h>
 #include <init.h>
 #include <restart.h>
Signature · 7 lines
2.20.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

Hi Anthony.

Quoted 23 lines · Antony Pavlov

The patch fixes the following compiler's warning:

In file included from include/common.h:33:0,

                 from arch/arm/mach-zynq/zynq.c:18:

arch/arm/include/asm/io.h:4:0: warning: "IO_SPACE_LIMIT" redefined
#define IO_SPACE_LIMIT 0

In file included from
arch/arm/mach-zynq/zynq.c:17:0:
include/asm-generic/io.h:92:0: note: this is the location of the previous definition
#define IO_SPACE_LIMIT 0xffff

Cc Steffen Trumtrar <[email protected]>
---
 arch/arm/mach-zynq/zynq.c | 1 -
 1 file changed, 1 deletion(-)
arch/arm/mach-zynq/zynq.c +0 -0
index a0a8d0d249..dd8f12c16a 100644

arch/arm/mach-zynq/zynq.c line 19

Quoted 7 lines
arch/arm/mach-zynq/zynq.c +0 -1
@@ -14,7 +14,6 @@
  */
 
 #include <asm/system.h>
-#include <asm-generic/io.h>
 #include <common.h>
 #include <init.h>
 #include <restart.h>

This patch rely on other headers to pull in <asm/io.h>.

As zynq.c uses a lot of functions from <asm/io.h> then using an explicit include would be better. Just my opinion, you could argue this is bikeshedding.

Sam

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#2 lore raw
In reply to Antony Pavlov
Quoted 23 lines · Antony Pavlov

The patch fixes the following compiler's warning:

In file included from include/common.h:33:0,

                 from arch/arm/mach-zynq/zynq.c:18:

arch/arm/include/asm/io.h:4:0: warning: "IO_SPACE_LIMIT" redefined
#define IO_SPACE_LIMIT 0

In file included from
arch/arm/mach-zynq/zynq.c:17:0:
include/asm-generic/io.h:92:0: note: this is the location of the previous definition
#define IO_SPACE_LIMIT 0xffff

Cc Steffen Trumtrar <[email protected]>
---
 arch/arm/mach-zynq/zynq.c | 1 -
 1 file changed, 1 deletion(-)
arch/arm/mach-zynq/zynq.c +0 -0
index a0a8d0d249..dd8f12c16a 100644

arch/arm/mach-zynq/zynq.c line 17

Quoted 4 lines
arch/arm/mach-zynq/zynq.c +0 -1
@@ -14,7 +14,6 @@
  */
 
 #include <asm/system.h>
-#include <asm-generic/io.h>

asm-generic/io.h shouldn't be included directly, but only from asm/io.h if it decides to do so. io.h includes asm/io.h, so this is the one that should be included instead.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw
Quoted 26 lines · On Thu, 10 Jan 2019 09:38:25 +0100 Sascha Hauer <[email protected]> wrote:
Quoted 25 lines · Antony Pavlov

The patch fixes the following compiler's warning:

In file included from include/common.h:33:0,

                 from arch/arm/mach-zynq/zynq.c:18:

arch/arm/include/asm/io.h:4:0: warning: "IO_SPACE_LIMIT" redefined
#define IO_SPACE_LIMIT 0

In file included from
arch/arm/mach-zynq/zynq.c:17:0:
include/asm-generic/io.h:92:0: note: this is the location of the previous definition
#define IO_SPACE_LIMIT 0xffff

Cc Steffen Trumtrar <[email protected]>
---
 arch/arm/mach-zynq/zynq.c | 1 -
 1 file changed, 1 deletion(-)
arch/arm/mach-zynq/zynq.c +0 -0
index a0a8d0d249..dd8f12c16a 100644
@@ -14,7 +14,6 @@
  */
 
Quoted 6 lines

arch/arm/mach-zynq/zynq.c line 17

Quoted 2 lines
arch/arm/mach-zynq/zynq.c +0 -1
 #include <asm/system.h>
-#include <asm-generic/io.h>

asm-generic/io.h shouldn't be included directly, but only from asm/io.h if it decides to do so. io.h includes asm/io.h, so this is the one that should be included instead.

common.h includes asm/io.h, please see full patch context:

arch/arm/mach-zynq/zynq.c +0 -1
@@ -14,7 +14,6 @@
  */
 
 #include <asm/system.h>
-#include <asm-generic/io.h>
 #include <common.h>
 #include <init.h>
 #include <restart.h>

The question is, should we just drop this "#include <asm-generic/io.h>" or change "#include <asm-generic/io.h>" into "#include <io.h>".

Signature · 7 lines
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw
Quoted 50 lines · Antony Pavlov
Quoted 26 lines · On Thu, 10 Jan 2019 09:38:25 +0100 Sascha Hauer <[email protected]> wrote:
Quoted 25 lines · Antony Pavlov

The patch fixes the following compiler's warning:

In file included from include/common.h:33:0,

                 from arch/arm/mach-zynq/zynq.c:18:

arch/arm/include/asm/io.h:4:0: warning: "IO_SPACE_LIMIT" redefined
#define IO_SPACE_LIMIT 0

In file included from
arch/arm/mach-zynq/zynq.c:17:0:
include/asm-generic/io.h:92:0: note: this is the location of the previous definition
#define IO_SPACE_LIMIT 0xffff

Cc Steffen Trumtrar <[email protected]>
---
 arch/arm/mach-zynq/zynq.c | 1 -
 1 file changed, 1 deletion(-)
arch/arm/mach-zynq/zynq.c +0 -0
index a0a8d0d249..dd8f12c16a 100644
@@ -14,7 +14,6 @@
  */
 
Quoted 6 lines

arch/arm/mach-zynq/zynq.c line 17

Quoted 2 lines
arch/arm/mach-zynq/zynq.c +0 -1
 #include <asm/system.h>
-#include <asm-generic/io.h>

asm-generic/io.h shouldn't be included directly, but only from asm/io.h if it decides to do so. io.h includes asm/io.h, so this is the one that should be included instead.

common.h includes asm/io.h, please see full patch context:

arch/arm/mach-zynq/zynq.c +0 -1
@@ -14,7 +14,6 @@
  */
 
 #include <asm/system.h>
-#include <asm-generic/io.h>
 #include <common.h>
 #include <init.h>
 #include <restart.h>
Quoted 2 lines

The question is, should we just drop this "#include <asm-generic/io.h>" or change "#include <asm-generic/io.h>" into "#include <io.h>".

Since this file really uses readl and friends I'd say let's change it to "#include <io.h>" rather than removing the inclusion.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox