[U-Boot] [PATCH 1/2] Include common.h in qsort.c to fix build warning

exports.h no longer includes common.h, which contains assert(). qsort.c needs to be updated. This fixes this warning:
qsort.c: In function 'qsort': qsort.c:30:3: warning: implicit declaration of function 'assert' [-Wimplicit-function-declaration]
Signed-off-by: Simon Glass sjg@chromium.org --- lib/qsort.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/lib/qsort.c b/lib/qsort.c index 86c392c..5709884 100644 --- a/lib/qsort.c +++ b/lib/qsort.c @@ -16,6 +16,7 @@ * bcc and gcc. */
#include <linux/types.h> +#include <common.h> #include <exports.h>
void qsort(void *base,

It is fine to use __maybe_unused instead of #ifdef, but we also need one for print_eth() since not all boards have Ethernet. This fixes this warning:
cmd_bdinfo.c:39:13: warning: 'print_eth' defined but not used [-Wunused-function]
Signed-off-by: Simon Glass sjg@chromium.org --- common/cmd_bdinfo.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 73c03a8..67cb0da 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -36,6 +36,7 @@ static void print_num(const char *name, ulong value) printf("%-12s= 0x%08lX\n", name, value); }
+__maybe_unused static void print_eth(int idx) { char name[10], *val;

Dear Simon Glass,
In message 1323214637-5543-2-git-send-email-sjg@chromium.org you wrote:
It is fine to use __maybe_unused instead of #ifdef, but we also need one for print_eth() since not all boards have Ethernet. This fixes this warning:
cmd_bdinfo.c:39:13: warning: 'print_eth' defined but not used [-Wunused-function]
Signed-off-by: Simon Glass sjg@chromium.org
common/cmd_bdinfo.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

On Dec 6, 2011, at 5:37 PM, Simon Glass wrote:
exports.h no longer includes common.h, which contains assert(). qsort.c needs to be updated. This fixes this warning:
qsort.c: In function 'qsort': qsort.c:30:3: warning: implicit declaration of function 'assert' [-Wimplicit-function-declaration]
Signed-off-by: Simon Glass sjg@chromium.org
lib/qsort.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
Acked-by: Kumar Gala galak@kernel.crashing.org
---
w/o this we actually have compile failure with the tree:
In file included from qsort.c:19:0: /local/home/galak/git/u-boot/include/exports.h:19:27: error: expected declaration specifiers or '...' before 'va_list' qsort.c: In function 'qsort': qsort.c:30:3: warning: implicit declaration of function 'assert'
- k

Hi Kumar,
On Tue, Dec 6, 2011 at 7:36 PM, Kumar Gala galak@kernel.crashing.org wrote:
On Dec 6, 2011, at 5:37 PM, Simon Glass wrote:
exports.h no longer includes common.h, which contains assert(). qsort.c needs to be updated. This fixes this warning:
qsort.c: In function 'qsort': qsort.c:30:3: warning: implicit declaration of function 'assert' [-Wimplicit-function-declaration]
Signed-off-by: Simon Glass sjg@chromium.org
lib/qsort.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
Acked-by: Kumar Gala galak@kernel.crashing.org
w/o this we actually have compile failure with the tree:
In file included from qsort.c:19:0: /local/home/galak/git/u-boot/include/exports.h:19:27: error: expected declaration specifiers or '...' before 'va_list' qsort.c: In function 'qsort': qsort.c:30:3: warning: implicit declaration of function 'assert'
Yes I was trying to be polite :-)
Regards, Simon
- k

Hello Simon,
Simon Glass wrote:
exports.h no longer includes common.h, which contains assert(). qsort.c needs to be updated. This fixes this warning:
qsort.c: In function 'qsort': qsort.c:30:3: warning: implicit declaration of function 'assert' [-Wimplicit-function-declaration]
Signed-off-by: Simon Glass sjg@chromium.org
Tested on the cam_enc_4xx board:
Tested-by: Heiko Schocher hs@denx.de
bye, Heiko

Dear Simon Glass,
In message 1323214637-5543-1-git-send-email-sjg@chromium.org you wrote:
exports.h no longer includes common.h, which contains assert(). qsort.c needs to be updated. This fixes this warning:
qsort.c: In function 'qsort': qsort.c:30:3: warning: implicit declaration of function 'assert' [-Wimplicit-function-declaration]
Signed-off-by: Simon Glass sjg@chromium.org
lib/qsort.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
participants (4)
-
Heiko Schocher
-
Kumar Gala
-
Simon Glass
-
Wolfgang Denk