Skip to contentSkip to conversation

Fix breakage after removing common.h from export.h

PATCH New Stefano Babic 2 participants 9 messages Dec 9, 2011 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix breakage after removing common.h from export.h

commit 0910d0bcb85acdf09b9dfd8ded452367b540a4ad
Mike Partington <[email protected]>
Date: Wed Oct 27 10:31:09 2010 +0000

Standalone Apps: Standalone apps should need only exports.h.

Modify exports.h to remove its dependencies on other files, thus enabling standalone apps to require only exports.h from the U-Boot source tree. This appears to be the intent based on the following
note: http://lists.denx.de/pipermail/u-boot/2010-January/067174.html

breaks all boards - the fact is that common.h is not included anymore by exports.h, and this breaks the build of several file.

CC Wolfgang Denk <[email protected]>
CC Albert Aribaud <[email protected]>
---
 include/_exports.h |    6 ------
 include/common.h   |   16 +---------------
 lib/qsort.c        |    2 ++
 3 files changed, 3 insertions(+), 21 deletions(-)
include/_exports.h +0 -6
index 349a3c5..5efcad6 100644
@@ -24,9 +24,3 @@ EXPORT_FUNC(simple_strtol)
 EXPORT_FUNC(strcmp)
 EXPORT_FUNC(i2c_write)
 EXPORT_FUNC(i2c_read)
-EXPORT_FUNC(spi_init)
-EXPORT_FUNC(spi_setup_slave)
-EXPORT_FUNC(spi_free_slave)
-EXPORT_FUNC(spi_claim_bus)
-EXPORT_FUNC(spi_release_bus)
-EXPORT_FUNC(spi_xfer)
include/common.h +1 -15
index 05a658c..e265bd4 100644
@@ -35,6 +35,7 @@ typedef volatile unsigned short vu_short;
 typedef volatile unsigned char	vu_char;
 
 #include <config.h>
+#include <assert.h>
 #include <asm-offsets.h>
 #include <linux/bitops.h>
 #include <linux/types.h>
@@ -136,21 +137,6 @@ typedef volatile unsigned char	vu_char;
 #define debug(fmt, args...)			\
 	debug_cond(_DEBUG, fmt, ##args)
 
-/*
- * An assertion is run-time check done in debug mode only. If DEBUG is not
- * defined then it is skipped. If DEBUG is defined and the assertion fails,
- * then it calls panic*( which may or may not reset/halt U-Boot (see
- * CONFIG_PANIC_HANG), It is hoped that all failing assertions are found
- * before release, and after release it is hoped that they don't matter. But
- * in any case these failing assertions cannot be fixed with a reset (which
- * may just do the same assertion again).
- */
-void __assert_fail(const char *assertion, const char *file, unsigned line,
-		   const char *function);
-#define assert(x) \
-	({ if (!(x) && _DEBUG) \
-		__assert_fail(#x, __FILE__, __LINE__, __func__); })
-
 #define error(fmt, args...) do {					\
 		printf("ERROR: " fmt "\nat %s:%d/%s()\n",		\
 			##args, __FILE__, __LINE__, __func__);		\
lib/qsort.c +2 -0
index 86c392c..5291c8d 100644
@@ -16,6 +16,8 @@
  * bcc and gcc. */
 
 #include <linux/types.h>
+#include <stdarg.h>
+#include <assert.h>
 #include <exports.h>
 
 void qsort(void  *base,
Signature · 1 line
1.7.5.4
#1 lore raw

PATCH 1/1 Fix breakage after removing common.h from export.h

Quoted 11 lines · Stefano Babic

commit 0910d0bcb85acdf09b9dfd8ded452367b540a4ad
Mike Partington <[email protected]>
Date: Wed Oct 27 10:31:09 2010 +0000

Standalone Apps: Standalone apps should need only exports.h.

Modify exports.h to remove its dependencies on other files, thus enabling standalone apps to require only exports.h from the U-Boot source tree. This appears to be the intent based on the following
note: http://lists.denx.de/pipermail/u-boot/2010-January/067174.html

Quoted 7 lines

breaks all boards - the fact is that common.h is not included anymore by exports.h, and this breaks the build of several file.

CC Wolfgang Denk <[email protected]>
CC Albert Aribaud <[email protected]>

---

Sorry, patch is incomplete - please ignore it, I will send V2.

Stefano

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-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#2 lore raw

PATCH v2 1/1 Fix breakage after removing common.h from export.h

In reply to Stefano Babic

commit 0910d0bcb85acdf09b9dfd8ded452367b540a4ad
Mike Partington <[email protected]>
Date: Wed Oct 27 10:31:09 2010 +0000

Standalone Apps: Standalone apps should need only exports.h.

Modify exports.h to remove its dependencies on other files, thus enabling standalone apps to require only exports.h from the U-Boot source tree. This appears to be the intent based on the following
note: http://lists.denx.de/pipermail/u-boot/2010-January/067174.html

breaks all boards - the fact is that common.h is not included anymore by exports.h, and this breaks the build of several file.

CC Wolfgang Denk <[email protected]>
CC Albert Aribaud <[email protected]>

---

Changes since V1: V1 broken, ignore it

 include/_exports.h |    6 -----
 include/assert.h   |   54 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 include/common.h   |   16 +--------------
 lib/qsort.c        |    2 +
 4 files changed, 57 insertions(+), 21 deletions(-)
 create mode 100644 include/assert.h
include/_exports.h +0 -6
index 349a3c5..5efcad6 100644
@@ -24,9 +24,3 @@ EXPORT_FUNC(simple_strtol)
 EXPORT_FUNC(strcmp)
 EXPORT_FUNC(i2c_write)
 EXPORT_FUNC(i2c_read)
-EXPORT_FUNC(spi_init)
-EXPORT_FUNC(spi_setup_slave)
-EXPORT_FUNC(spi_free_slave)
-EXPORT_FUNC(spi_claim_bus)
-EXPORT_FUNC(spi_release_bus)
-EXPORT_FUNC(spi_xfer)
include/assert.h new file +54 -0

54 lines not on this page · raw message

include/common.h +1 -15
index 05a658c..e265bd4 100644
@@ -35,6 +35,7 @@ typedef volatile unsigned short vu_short;
 typedef volatile unsigned char	vu_char;
 
 #include <config.h>
+#include <assert.h>
 #include <asm-offsets.h>
 #include <linux/bitops.h>
 #include <linux/types.h>
@@ -136,21 +137,6 @@ typedef volatile unsigned char	vu_char;
 #define debug(fmt, args...)			\
 	debug_cond(_DEBUG, fmt, ##args)
 
-/*
- * An assertion is run-time check done in debug mode only. If DEBUG is not
- * defined then it is skipped. If DEBUG is defined and the assertion fails,
- * then it calls panic*( which may or may not reset/halt U-Boot (see
- * CONFIG_PANIC_HANG), It is hoped that all failing assertions are found
- * before release, and after release it is hoped that they don't matter. But
- * in any case these failing assertions cannot be fixed with a reset (which
- * may just do the same assertion again).
- */
-void __assert_fail(const char *assertion, const char *file, unsigned line,
-		   const char *function);
-#define assert(x) \
-	({ if (!(x) && _DEBUG) \
-		__assert_fail(#x, __FILE__, __LINE__, __func__); })
-
 #define error(fmt, args...) do {					\
 		printf("ERROR: " fmt "\nat %s:%d/%s()\n",		\
 			##args, __FILE__, __LINE__, __func__);		\
lib/qsort.c +2 -0
index 86c392c..5291c8d 100644
@@ -16,6 +16,8 @@
  * bcc and gcc. */
 
 #include <linux/types.h>
+#include <stdarg.h>
+#include <assert.h>
 #include <exports.h>
 
 void qsort(void  *base,
Signature · 1 line
1.7.5.4
#3 lore raw

PATCH v2 1/1 Fix breakage after removing common.h from export.h

Dear Stefano Babic,

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

Mike Partington <[email protected]>
Date: Wed Oct 27 10:31:09 2010 +0000

Standalone Apps: Standalone apps should need only exports.h.

Quoted 7 lines

Modify exports.h to remove its dependencies on other files, thus enabling standalone apps to require only exports.h from the U-Boot source tree. This appears to be the intent based on the following
note: http://lists.denx.de/pipermail/u-boot/2010-January/067174.html

breaks all boards - the fact is that common.h is not included anymore by exports.h, and this breaks the build of several file.

Can we fix this build breakage? For example by removing the code that depends oin the now unexported SPI interface?

Best regards,

Wolfgang Denk

Signature · 6 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
One essential to success is that you desire be an all-obsessing  one,
your thoughts and aims be co-ordinated, and your energy be concentra-
ted and applied without letup.
#4 lore raw

PATCH 1/1 Fix breakage after removing common.h from export.h

In reply to Stefano Babic

Dear Stefano Babic,

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

commit 0910d0bcb85acdf09b9dfd8ded452367b540a4ad
Mike Partington <[email protected]>
Date: Wed Oct 27 10:31:09 2010 +0000

Standalone Apps: Standalone apps should need only exports.h.

Quoted 7 lines

Modify exports.h to remove its dependencies on other files, thus enabling standalone apps to require only exports.h from the U-Boot source tree. This appears to be the intent based on the following
note: http://lists.denx.de/pipermail/u-boot/2010-January/067174.html

breaks all boards - the fact is that common.h is not included anymore by exports.h, and this breaks the build of several file.

Do we accept such a patch?

include/common.h typedef volatile unsigned short vu_short; · line 41

Quoted 10 lines
include/common.h +1 -0
@@ -35,6 +35,7 @@ typedef volatile unsigned short vu_short;
 typedef volatile unsigned char	vu_char;
 
 #include <config.h>
+#include <assert.h>
 #include <asm-offsets.h>
 #include <linux/bitops.h>
 #include <linux/types.h>

This appears to be an unrelated change, that should be submitted separately. Also, we should then remove the "#include <assert.h>" from files that have this and also include common.h (that would be at least common/hwconfig.c).

Best regards,

Wolfgang Denk

Signature · 4 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
Don't have a battle of wits with an unarmed opponent.
#5 lore raw

PATCH 1/1 Fix breakage after removing common.h from export.h

Quoted 14 lines · Wolfgang Denk

Dear Stefano Babic,

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

commit 0910d0bcb85acdf09b9dfd8ded452367b540a4ad
Mike Partington <[email protected]>
Date: Wed Oct 27 10:31:09 2010 +0000

Standalone Apps: Standalone apps should need only exports.h.

Modify exports.h to remove its dependencies on other files, thus enabling standalone apps to require only exports.h from the U-Boot source tree. This appears to be the intent based on the following
note: http://lists.denx.de/pipermail/u-boot/2010-January/067174.html

Quoted 4 lines
Quoted 2 lines

breaks all boards - the fact is that common.h is not included anymore by exports.h, and this breaks the build of several file.

Do we accept such a patch?

Yes - it is already in mainline

Quoted 7 lines
Quoted 7 lines
include/common.h +0 -0
@@ -35,6 +35,7 @@ typedef volatile unsigned short vu_short;
 typedef volatile unsigned char	vu_char;
 
Quoted 8 lines

include/common.h typedef volatile unsigned short vu_short; · line 41

Quoted 5 lines
include/common.h +1 -0
 #include <config.h>
+#include <assert.h>
 #include <asm-offsets.h>
 #include <linux/bitops.h>
 #include <linux/types.h>

This appears to be an unrelated change, that should be submitted separately.

This seems to be, it is not - or not strictly. The problem rises with lib/qsort.c, that could be used (am I right ?) by standalone program and can import only export.h

Quoted 3 lines

Also, we should then remove the "#include <assert.h>"
from files that have this and also include common.h (that would be at least common/hwconfig.c).

There is not yet an assert.h, I have introduced with this patch. This avoid to include common.h in qsort.c, if qsort can be used in standalone programs and importing common.h is not allowed. Of course, if I am wrong, qsort can include directly common.h.

Best regards,
Stefano Babic

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-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#6 lore raw

PATCH 1/1 Fix breakage after removing common.h from export.h

Dear Stefano Babic,

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 5 lines
Quoted 3 lines

breaks all boards - the fact is that common.h is not included anymore by exports.h, and this breaks the build of several file.

Do we accept such a patch?

Yes - it is already in mainline

breaks all boards? I did not observe this yet.

Which boards are broken?

Quoted 3 lines

This seems to be, it is not - or not strictly. The problem rises with lib/qsort.c, that could be used (am I right ?) by standalone program and can import only export.h

No. qsort() is not exported to standalone applications.

Quoted 5 lines
Quoted 3 lines

Also, we should then remove the "#include <assert.h>"
from files that have this and also include common.h (that would be at least common/hwconfig.c).

There is not yet an assert.h, I have introduced with this patch. This

-> find * -name '*.[ch]' | xargs egrep '#include.*assert.h' common/hwconfig.c:#include <assert.h> fs/yaffs2/ydirectenv.h:#include "assert.h" tools/getline.c:#include <assert.h> tools/mingw_support.c:#include <assert.h>

Quoted 3 lines

avoid to include common.h in qsort.c, if qsort can be used in standalone programs and importing common.h is not allowed. Of course, if I am wrong, qsort can include directly common.h.

Best regards,

Wolfgang Denk

Signature · 7 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
Die meisten Menschen pflegen im Kindesalter vom Zeigen auf Gegenst?n-
de (Mausbewegung) und "ga" sagen  (Mausklick)  abzukommen,  zugunsten
eines  m?chtigeren  und langwierig zu erlernenden Tools (Sprache).
                             -- Achim Linder in de.comp.os.linux.misc
#7 lore raw

PATCH 1/1 Fix breakage after removing common.h from export.h

Quoted 7 lines · Wolfgang Denk

Dear Stefano Babic,

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

breaks all boards - the fact is that common.h is not included anymore by exports.h, and this breaks the build of several file.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Do we accept such a patch?

Yes - it is already in mainline

breaks all boards? I did not observe this yet.

Which boards are broken?

Sorry - after bisecting my tree I get the patch as resposiblo for the brakage, and I have seen the patch was already mainlined - but I was bisecting a tree based on u-boot-arm, not u-boot. Mainline ist still correct ;-)

Albert, do you have seen the same issue on your tree ? I get it the problem after rebasing today on the current u-boot-arm/master.

Best regards,
Stefano Babic

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-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#8 lore raw

PATCH 1/1 Fix breakage after removing common.h from export.h

On 09/12/2011 13:59, Stefano Babic wrote:

Albert, I tested with Wolfgang and we see that u-boot mainline has merged already the fixes for the issues I find after rebasing on u-boot-arm:

42c4a23a55fbcccaabe9e3e76b00138185209a74 Include common.h in qsort.c to fix build warning
f915c9316cf1dd16a5ec4da02447656f200660f0 Revert "mii: miiphy register address width change"

Can you rebase you tree on the current u-boot ? Afterwards I will rebase my tree on u-boot-arm.

Thanks,
Stefano

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-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================