[U-Boot] [PATCH 1/3 V2] EHCI: Exynos: Add fdt support

Simon Glass sjg at chromium.org
Thu Dec 6 19:07:18 CET 2012


Hi Marek,

On Thu, Dec 6, 2012 at 10:02 AM, Marek Vasut <marex at denx.de> wrote:
> Dear Simon Glass,
>
> [...]
>
>> > [...]
>> >
>> > error output should be really puts() or printf() ...
>>
>> Ick that bloats the code badly for an uncommon case. Would really
>> prefer to avoid this.
>
> What do you mean? Are you saying this debug() is correct and this is triggered
> often? How come?

I mean that debug() in a driver does not generate any code unless
DEBUG is defined in that module. The way I do it is when I have a
problem in a module I define DEBUG there, which makes all the messages
work. But then in the normal case (when not debugging) the code size
is not bloated by messages.

So I much prefer debug() to printf() for uncommon messages in drivers, etc.

>
>> > You can also use errno.h instead of -1.
>>
>> True, it might help debugging, although many times it is hard to map
>> the error onto a suitable number designed for Linux. This 'return -1'
>> is pretty common in U-Boot (generic error).
>
> I know, but it'd be nice if this changed. Just a suggestion.

Yes agreed. I recently had a driver which could fail in about 12
different places (different stages of hardware init), so I just
created an enum for 12 errors. It wouldn't have been sensible in that
case to try and fail to map those onto the errno errors, but in many
cases (with fewer error conditions) it would be useful.

Regards,
Simon

>
> Best regards,
> Marek Vasut


More information about the U-Boot mailing list