* [U-Boot] [PATCH v3] arm: printf() is not available in some SPL configurations
@ 2011-11-22 8:26 Christian Riesch
2011-11-22 8:49 ` Andreas Bießmann
0 siblings, 1 reply; 4+ messages in thread
From: Christian Riesch @ 2011-11-22 8:26 UTC (permalink / raw)
To: u-boot
This patch avoids build breakage for SPLs that do not support printf.
Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Tom Rini <trini@ti.com>
Acked-by: Tom Rini <trini@ti.com>
---
Changes for v3:
- Removed extra white space
- Separated patch from patchset [1]
[1] http://lists.denx.de/pipermail/u-boot/2011-November/110635.html
arch/arm/lib/eabi_compat.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/arm/lib/eabi_compat.c b/arch/arm/lib/eabi_compat.c
index eb3e26d..e1b87be 100644
--- a/arch/arm/lib/eabi_compat.c
+++ b/arch/arm/lib/eabi_compat.c
@@ -13,7 +13,9 @@
int raise (int signum)
{
+#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
printf("raise: Signal # %d caught\n", signum);
+#endif
return 0;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH v3] arm: printf() is not available in some SPL configurations
2011-11-22 8:26 [U-Boot] [PATCH v3] arm: printf() is not available in some SPL configurations Christian Riesch
@ 2011-11-22 8:49 ` Andreas Bießmann
2011-11-22 9:08 ` Christian Riesch
2011-11-22 20:20 ` Scott Wood
0 siblings, 2 replies; 4+ messages in thread
From: Andreas Bießmann @ 2011-11-22 8:49 UTC (permalink / raw)
To: u-boot
Dear Christian,
sorry I haven't followed the discussion so far. I have a little pointer too.
Am 22.11.2011 09:26, schrieb Christian Riesch:
> This patch avoids build breakage for SPLs that do not support printf.
>
> Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
> Cc: Wolfgang Denk <wd@denx.de>
> Cc: Tom Rini <trini@ti.com>
> Acked-by: Tom Rini <trini@ti.com>
> ---
> Changes for v3:
> - Removed extra white space
> - Separated patch from patchset [1]
>
> [1] http://lists.denx.de/pipermail/u-boot/2011-November/110635.html
>
> arch/arm/lib/eabi_compat.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/lib/eabi_compat.c b/arch/arm/lib/eabi_compat.c
> index eb3e26d..e1b87be 100644
> --- a/arch/arm/lib/eabi_compat.c
> +++ b/arch/arm/lib/eabi_compat.c
> @@ -13,7 +13,9 @@
>
> int raise (int signum)
> {
> +#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
> printf("raise: Signal # %d caught\n", signum);
> +#endif
Well, you can do it that way but I guess there are several places where
printf() will be needed by some drivers in SPL. Therefore I think it is
better to provide printf() for SPL than to ifdef out all the printf's.
So how about providing an empty
#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
#define printf(x)
#endif
somewhere in the SPL code?
best regards
Andreas Bie?mann
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH v3] arm: printf() is not available in some SPL configurations
2011-11-22 8:49 ` Andreas Bießmann
@ 2011-11-22 9:08 ` Christian Riesch
2011-11-22 20:20 ` Scott Wood
1 sibling, 0 replies; 4+ messages in thread
From: Christian Riesch @ 2011-11-22 9:08 UTC (permalink / raw)
To: u-boot
Hi Andreas,
Thank you for your comments!
On Tue, Nov 22, 2011 at 9:49 AM, Andreas Bie?mann
<andreas.devel@googlemail.com> wrote:
> Dear Christian,
>
> sorry I haven't followed the discussion so far. I have a little pointer too.
>
> Am 22.11.2011 09:26, schrieb Christian Riesch:
>> This patch avoids build breakage for SPLs that do not support printf.
>>
>> Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
>> Cc: Wolfgang Denk <wd@denx.de>
>> Cc: Tom Rini <trini@ti.com>
>> Acked-by: Tom Rini <trini@ti.com>
>> ---
>> Changes for v3:
>> - Removed extra white space
>> - Separated patch from patchset [1]
>>
>> [1] http://lists.denx.de/pipermail/u-boot/2011-November/110635.html
>>
>> ?arch/arm/lib/eabi_compat.c | ? ?2 ++
>> ?1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/lib/eabi_compat.c b/arch/arm/lib/eabi_compat.c
>> index eb3e26d..e1b87be 100644
>> --- a/arch/arm/lib/eabi_compat.c
>> +++ b/arch/arm/lib/eabi_compat.c
>> @@ -13,7 +13,9 @@
>>
>> ?int raise (int signum)
>> ?{
>> +#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
>> ? ? ? printf("raise: Signal # %d caught\n", signum);
>> +#endif
>
> Well, you can do it that way but I guess there are several places where
> printf() will be needed by some drivers in SPL. Therefore I think it is
> better to provide printf() for SPL than to ifdef out all the printf's.
>
> So how about providing an empty
>
> #if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
> #define printf(x)
> #endif
>
> somewhere in the SPL code?
If others agree I will do something like this. But I don't like this
approach. I can imagine that this could be a real PITA when you are
debugging an SPL, see a printf in the code, expect an output on
console, but this output never appears because printf has been
replaced globally in some obscure header file.
Regards, Christian
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH v3] arm: printf() is not available in some SPL configurations
2011-11-22 8:49 ` Andreas Bießmann
2011-11-22 9:08 ` Christian Riesch
@ 2011-11-22 20:20 ` Scott Wood
1 sibling, 0 replies; 4+ messages in thread
From: Scott Wood @ 2011-11-22 20:20 UTC (permalink / raw)
To: u-boot
On 11/22/2011 02:49 AM, Andreas Bie?mann wrote:
> Well, you can do it that way but I guess there are several places where
> printf() will be needed by some drivers in SPL. Therefore I think it is
> better to provide printf() for SPL than to ifdef out all the printf's.
>
> So how about providing an empty
>
> #if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
> #define printf(x)
> #endif
>
> somewhere in the SPL code?
Use an inline function instead so the arguments are consumed and it
doesn't cause unused-variable warnings.
-Scott
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-11-22 20:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-22 8:26 [U-Boot] [PATCH v3] arm: printf() is not available in some SPL configurations Christian Riesch
2011-11-22 8:49 ` Andreas Bießmann
2011-11-22 9:08 ` Christian Riesch
2011-11-22 20:20 ` Scott Wood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox