* [U-Boot] [PATCH] Fix breakage after removing common.h from export.h
@ 2011-12-09 10:23 Stefano Babic
2011-12-09 10:27 ` Stefano Babic
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Stefano Babic @ 2011-12-09 10:23 UTC (permalink / raw)
To: u-boot
commit 0910d0bcb85acdf09b9dfd8ded452367b540a4ad
Mike Partington <mparting@lexmark.com>
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.
Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Wolfgang Denk <wd@denx.de>
CC: Albert Aribaud <albert.u.boot@aribaud.net>
---
include/_exports.h | 6 ------
include/common.h | 16 +---------------
lib/qsort.c | 2 ++
3 files changed, 3 insertions(+), 21 deletions(-)
diff --git a/include/_exports.h b/include/_exports.h
index 349a3c5..5efcad6 100644
--- a/include/_exports.h
+++ b/include/_exports.h
@@ -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)
diff --git a/include/common.h b/include/common.h
index 05a658c..e265bd4 100644
--- a/include/common.h
+++ b/include/common.h
@@ -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__); \
diff --git a/lib/qsort.c b/lib/qsort.c
index 86c392c..5291c8d 100644
--- a/lib/qsort.c
+++ b/lib/qsort.c
@@ -16,6 +16,8 @@
* bcc and gcc. */
#include <linux/types.h>
+#include <stdarg.h>
+#include <assert.h>
#include <exports.h>
void qsort(void *base,
--
1.7.5.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH] Fix breakage after removing common.h from export.h
2011-12-09 10:23 [U-Boot] [PATCH] Fix breakage after removing common.h from export.h Stefano Babic
@ 2011-12-09 10:27 ` Stefano Babic
2011-12-09 10:33 ` [U-Boot] [PATCH V2] " Stefano Babic
2011-12-09 11:29 ` [U-Boot] [PATCH] " Wolfgang Denk
2 siblings, 0 replies; 9+ messages in thread
From: Stefano Babic @ 2011-12-09 10:27 UTC (permalink / raw)
To: u-boot
On 09/12/2011 11:23, Stefano Babic wrote:
> commit 0910d0bcb85acdf09b9dfd8ded452367b540a4ad
> Mike Partington <mparting@lexmark.com>
> 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.
>
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> CC: Wolfgang Denk <wd@denx.de>
> CC: Albert Aribaud <albert.u.boot@aribaud.net>
> ---
Sorry, patch is incomplete - please ignore it, I will send V2.
Stefano
--
=====================================================================
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
=====================================================================
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH V2] Fix breakage after removing common.h from export.h
2011-12-09 10:23 [U-Boot] [PATCH] Fix breakage after removing common.h from export.h Stefano Babic
2011-12-09 10:27 ` Stefano Babic
@ 2011-12-09 10:33 ` Stefano Babic
2011-12-09 11:30 ` Wolfgang Denk
2011-12-09 11:29 ` [U-Boot] [PATCH] " Wolfgang Denk
2 siblings, 1 reply; 9+ messages in thread
From: Stefano Babic @ 2011-12-09 10:33 UTC (permalink / raw)
To: u-boot
commit 0910d0bcb85acdf09b9dfd8ded452367b540a4ad
Mike Partington <mparting@lexmark.com>
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.
Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Wolfgang Denk <wd@denx.de>
CC: Albert Aribaud <albert.u.boot@aribaud.net>
---
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
diff --git a/include/_exports.h b/include/_exports.h
index 349a3c5..5efcad6 100644
--- a/include/_exports.h
+++ b/include/_exports.h
@@ -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)
diff --git a/include/assert.h b/include/assert.h
new file mode 100644
index 0000000..3f1160b
--- /dev/null
+++ b/include/assert.h
@@ -0,0 +1,54 @@
+/*
+ * (C) Copyright 2011
+ * Stefano Babic, DENX Software Engineering, sbabic at denx.de.
+ *
+ * (C) Copyright 2000-2009
+ * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __ASSERT_H
+#define __ASERT_H
+
+#ifndef _DEBUG
+#ifdef DEBUG
+#define _DEBUG 1
+#else
+#define _DEBUG 0
+#endif
+#endif
+
+/*
+ * 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__); })
+
+
+#endif
diff --git a/include/common.h b/include/common.h
index 05a658c..e265bd4 100644
--- a/include/common.h
+++ b/include/common.h
@@ -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__); \
diff --git a/lib/qsort.c b/lib/qsort.c
index 86c392c..5291c8d 100644
--- a/lib/qsort.c
+++ b/lib/qsort.c
@@ -16,6 +16,8 @@
* bcc and gcc. */
#include <linux/types.h>
+#include <stdarg.h>
+#include <assert.h>
#include <exports.h>
void qsort(void *base,
--
1.7.5.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH] Fix breakage after removing common.h from export.h
2011-12-09 10:23 [U-Boot] [PATCH] Fix breakage after removing common.h from export.h Stefano Babic
2011-12-09 10:27 ` Stefano Babic
2011-12-09 10:33 ` [U-Boot] [PATCH V2] " Stefano Babic
@ 2011-12-09 11:29 ` Wolfgang Denk
2011-12-09 12:34 ` Stefano Babic
2 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Denk @ 2011-12-09 11:29 UTC (permalink / raw)
To: u-boot
Dear Stefano Babic,
In message <1323426220-30366-1-git-send-email-sbabic@denx.de> you wrote:
> commit 0910d0bcb85acdf09b9dfd8ded452367b540a4ad
> Mike Partington <mparting@lexmark.com>
> 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.
Do we accept such a patch?
> --- a/include/common.h
> +++ b/include/common.h
> @@ -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
--
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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH V2] Fix breakage after removing common.h from export.h
2011-12-09 10:33 ` [U-Boot] [PATCH V2] " Stefano Babic
@ 2011-12-09 11:30 ` Wolfgang Denk
0 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2011-12-09 11:30 UTC (permalink / raw)
To: u-boot
Dear Stefano Babic,
In message <1323426790-1477-1-git-send-email-sbabic@denx.de> you wrote:
>
> Mike Partington <mparting@lexmark.com>
> 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.
Can we fix this build breakage? For example by removing the code that
depends oin the now unexported SPI interface?
Best regards,
Wolfgang Denk
--
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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH] Fix breakage after removing common.h from export.h
2011-12-09 11:29 ` [U-Boot] [PATCH] " Wolfgang Denk
@ 2011-12-09 12:34 ` Stefano Babic
2011-12-09 12:41 ` Wolfgang Denk
0 siblings, 1 reply; 9+ messages in thread
From: Stefano Babic @ 2011-12-09 12:34 UTC (permalink / raw)
To: u-boot
On 09/12/2011 12:29, Wolfgang Denk wrote:
> Dear Stefano Babic,
>
> In message <1323426220-30366-1-git-send-email-sbabic@denx.de> you wrote:
>> commit 0910d0bcb85acdf09b9dfd8ded452367b540a4ad
>> Mike Partington <mparting@lexmark.com>
>> 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.
>
> Do we accept such a patch?
Yes - it is already in mainline
>
>
>> --- a/include/common.h
>> +++ b/include/common.h
>> @@ -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.
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
> 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
--
=====================================================================
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
=====================================================================
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH] Fix breakage after removing common.h from export.h
2011-12-09 12:34 ` Stefano Babic
@ 2011-12-09 12:41 ` Wolfgang Denk
2011-12-09 12:59 ` Stefano Babic
0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Denk @ 2011-12-09 12:41 UTC (permalink / raw)
To: u-boot
Dear Stefano Babic,
In message <4EE2006C.8070505@denx.de> you wrote:
>
> >> 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?
> 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.
> > 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>
> 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
--
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH] Fix breakage after removing common.h from export.h
2011-12-09 12:41 ` Wolfgang Denk
@ 2011-12-09 12:59 ` Stefano Babic
2011-12-09 13:38 ` Stefano Babic
0 siblings, 1 reply; 9+ messages in thread
From: Stefano Babic @ 2011-12-09 12:59 UTC (permalink / raw)
To: u-boot
On 09/12/2011 13:41, Wolfgang Denk wrote:
> Dear Stefano Babic,
>
> In message <4EE2006C.8070505@denx.de> you wrote:
>>
>>>> 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?
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
--
=====================================================================
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
=====================================================================
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH] Fix breakage after removing common.h from export.h
2011-12-09 12:59 ` Stefano Babic
@ 2011-12-09 13:38 ` Stefano Babic
0 siblings, 0 replies; 9+ messages in thread
From: Stefano Babic @ 2011-12-09 13:38 UTC (permalink / raw)
To: u-boot
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
--
=====================================================================
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
=====================================================================
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2011-12-09 13:38 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-09 10:23 [U-Boot] [PATCH] Fix breakage after removing common.h from export.h Stefano Babic
2011-12-09 10:27 ` Stefano Babic
2011-12-09 10:33 ` [U-Boot] [PATCH V2] " Stefano Babic
2011-12-09 11:30 ` Wolfgang Denk
2011-12-09 11:29 ` [U-Boot] [PATCH] " Wolfgang Denk
2011-12-09 12:34 ` Stefano Babic
2011-12-09 12:41 ` Wolfgang Denk
2011-12-09 12:59 ` Stefano Babic
2011-12-09 13:38 ` Stefano Babic
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox