[U-Boot] [PATCH V3 3/4] ARM: Warn when the machine ID isn't set.

Igor Grinberg grinberg at compulab.co.il
Sun Jul 17 08:53:00 CEST 2011


On 07/15/11 15:44, Stefano Babic wrote:
> On 07/14/2011 09:02 PM, Igor Grinberg wrote:
>
>>> +#ifdef DEBUG
>>> +	if (machid == BI_ARCH_NUMBER_INVALID)
>>> +	        printf("Warning: machid not set.\n");
>>> +#endif
>>> +
>> Is it essential to enclose that check in #ifdef DEBUG?
>> IMHO, it can be useful also with no DEBUG defined,
>> so I'd add it without the #ifdef DEBUG.
>>
>> Also, in the printf line, you are mixing tabs with spaces
>> (sorry for not noticing this in previous versions...).
> ...and if you want to print something only for debug purposes, the best
> way is to substitute printf() with debug() and get rid of #ifdef.
>
> +	if (machid == BI_ARCH_NUMBER_INVALID)
> +	        debug("Warning: machid not set.\n");

That is understood completely and that is not what I'm asking...
I think that this warning should be printed not just for debug purposes...
So, I'd prefer:

+	if (machid == BI_ARCH_NUMBER_INVALID)
+		printf("Warning: machid not set.\n");

with no #ifdefs.
So, I'm asking is it essential to make it only for debug purposes?
Are there any cases when this code will harm if no #define DEBUG is specified?


-- 
Regards,
Igor.



More information about the U-Boot mailing list