Skip to contentSkip to conversation

ppc4xx: Fix include sequence in 4xx_pcie.c

PATCH New Stefan Roese 2 participants 4 messages Jul 10, 2008 – Jul 11, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc4xx: Fix include sequence in 4xx_pcie.c

This patch now moves common.h to the top of the inlcude list. This is needed for boards with CONFIG_PHYS_64BIT set (e.g. katmai), so that the phys_size_t/phys_addr_t are defined to the correct size in this driver.

---
 cpu/ppc4xx/4xx_pcie.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
cpu/ppc4xx/4xx_pcie.c +3 -3
index d50a538..9803fcc 100644
@@ -25,11 +25,11 @@
 #define DEBUG
 #endif
 
-#include <asm/processor.h>
-#include <asm-ppc/io.h>
-#include <ppc4xx.h>
 #include <common.h>
 #include <pci.h>
+#include <ppc4xx.h>
+#include <asm/processor.h>
+#include <asm-ppc/io.h>
 
 #if (defined(CONFIG_440SPE) || defined(CONFIG_405EX) ||	\
     defined(CONFIG_460EX) || defined(CONFIG_460GT)) && \
Signature · 1 line
1.5.6.2
#1 lore raw

PATCH 1/1 ppc4xx: Fix include sequence in 4xx_pcie.c

Quoted 9 lines · In message <[email protected]> you wrote:

This patch now moves common.h to the top of the inlcude list. This is needed for boards with CONFIG_PHYS_64BIT set (e.g. katmai), so that the phys_size_t/phys_addr_t are defined to the correct size in this driver.

---
 cpu/ppc4xx/4xx_pcie.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Hm. I think we have a serious problem when the correctness of the code depends on the include order. It seems that include/asm-ppc/types.h depends on CONFIG_PHYS_64BIT, so include/asm-ppc/types.h must make sure this variable is set correctly, i. e. we should include common.h there.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You don't need a weatherman to know which way the wind blows.
                                                          - Bob Dylan
#2 lore raw

PATCH 1/1 ppc4xx: Fix include sequence in 4xx_pcie.c

Quoted 11 lines · Wolfgang Denk
Quoted 9 lines · In message <[email protected]> you wrote:

This patch now moves common.h to the top of the inlcude list. This is needed for boards with CONFIG_PHYS_64BIT set (e.g. katmai), so that the phys_size_t/phys_addr_t are defined to the correct size in this driver.

---
 cpu/ppc4xx/4xx_pcie.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
Quoted 5 lines

Hm. I think we have a serious problem when the correctness of the code depends on the include order. It seems that include/asm-ppc/types.h depends on CONFIG_PHYS_64BIT, so include/asm-ppc/types.h must make sure this variable is set correctly, i. e. we should include common.h there.

Yes, I though too that this problem might affect other files too. But unfortunately including common.h from within asm/types.h does not work since common.h includes (and needs) types.h itself.

I have no elegant solution to handle this in a more generic way right now. Perhaps somebody else has? Ideas welcome. :)

Thanks.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#3 lore raw

PATCH 1/1 ppc4xx: Fix include sequence in 4xx_pcie.c

Hi Wolfgang,

Quoted 6 lines · Stefan Roese
Quoted 5 lines

Hm. I think we have a serious problem when the correctness of the code depends on the include order. It seems that include/asm-ppc/types.h depends on CONFIG_PHYS_64BIT, so include/asm-ppc/types.h must make sure this variable is set correctly, i. e. we should include common.h there.

Quoted 6 lines

Yes, I though too that this problem might affect other files too. But unfortunately including common.h from within asm/types.h does not work since common.h includes (and needs) types.h itself.

I have no elegant solution to handle this in a more generic way right now. Perhaps somebody else has? Ideas welcome. :)

Since nobody has come up with a better idea, I suggest we push the current fix for now. Same reason as the USB shutdown patch that you pulled even though it is not perfect.

Should I put it in my repo and send a pull request?

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================