[U-Boot] [PATCH] cmd_fdt.c: Use %p when printing pointers

Tom Rini trini at ti.com
Tue Oct 30 19:10:55 CET 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/30/12 05:44, Jerry Van Baren wrote:
> On 10/30/2012 05:59 AM, Wolfgang Denk wrote:
>> Dear Tom Rini,
[snip]
>> 2) Fix the root cause: given that we have valid situations where 
>> we may want to dereference a pointer pointing to address 0x0000,
>>  I wonder if it would not actually be better (i. e. more
>> correct) to get rid of the
>> 
>> 495 static char *pointer(const char *fmt, char *buf, char *end, 
>> void *ptr, 496                 int field_width, int precision, 
>> int flags) 497 { 498         if (!ptr) 499
>> return string(buf, end, "(null)", field_width, precision, 500 
>> flags);
>> 
>> special handling in "lib/vsprintf.c"
>> 
>> Would anybody shed any tears if we drop this?
> 
> I like that a lot better, gets my vote.  I would suggest replacing 
> the code with a comment that the (lack of) code intentionally does 
> not print "(null)" or someone may put it back in in the future. 
> :-/

Yes, a comment as a reminder is a good idea.  Please make it so.  And
as Joe notes (he pointed this out on IRC before I posted) we'll never
do this in the cmd_fdt.c code as it's always inside of a tree
somewhere.  Thanks!

- -- 
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQkBguAAoJENk4IS6UOR1WiKcP/RSFDevD6jDW8cV6TH1VbE0u
v+2ZMClL/DVcwTq+EasUyFStCJJgBZRjgpTva0S5/VPevC/Q7TAQSuOSQjhizTlO
6LlUNY3Qmrznd/70WO1uXGkZ9YxNqHwfbmjH3V67Ge+E6xM9QtIqsj4rI+TvEWub
NiFlynwi/DQRzO1RuCzuoey+nIPO8Vmy2L8HbT09s24B85IfLGkCPpf40wsZY9p8
pPf5qTBjaKuzxRax02msVEllpCC0l1AiDzdjiOjrNDkk+ULaHehzB/8kT/q3Bg7k
Q8j2msa/gDSCfqGfl4ravQ+5ekpwbW22ywhfL6DmFzw8tlPYlzLJs7x34GyFx6Me
/5RSAqpiq+qw9qc5NQKPNEgd9FyPC6QH6q9DG0Ns0NoMwnWbLe590bBuDNitsmwH
tfdBJspVGJnY0Lcf8nGl6xKw12Q2H4uOqofaI3MrtUIW2bUB3RHB421wZAWwuTez
EcuvF1CqcBcbf17wOksftg+51N5e4ng9L35mMCAv8pLuheEvhgRKLcvZZVHhXGX6
QqG7DIBR+lVAflFQU5ctNVOESknuzPOt4UveAZnuXyKPH5KH5k+kN5HpKghtC4aF
j/AWcqZaNXsFwuObgRbAk2O3eSnWzLODQL61C2u9gmEjbv9PIZ3c30UsX3g3QY8v
CxnWPsbwsFDoo/OmSCvj
=vTzN
-----END PGP SIGNATURE-----


More information about the U-Boot mailing list