[U-Boot] [PATCH] cmd_fdt.c: fix parse of byte streams and strings
Jerry Van Baren
gerald.vanbaren at ge.com
Fri Sep 11 18:51:37 CEST 2009
Andy Fleming wrote:
>>
>>> Strings are backwards compatible because the hush parser strips the
>>> quotes so all that that part of Ken's patch does is to extend it to
>>> paste together multiple arguments rather than limiting it to exactly
>>> one argument. The following also produces the original string:
>>> fdt set /ethernet at f00 interrupts "this is" "a string"
>>> I'm more concerned with the [] form because that really is a syntax
>>> change. The original syntax with a single quoted argument will no
>>> longer be parsed if I understand the change (I need to apply the
>>> patch and confirm this):
>>> Old:
>>> fdt set /ethernet at f00 interrupts "[33 2 34 2 36 2]"
>>> becomes
>>> fdt set /ethernet at f00 interrupts [ 33 2 34 2 36 2 ]
>>> Note that the *must* be a space between "[" and "33" and between "2"
>>> and "]" because the "[" and "]" now have to be separate arguments.
>>> This is what Andy did with "<" and ">" with no public outcry, so it
>>> is probably OK.
>>> --------------------------------------------------------------
>>> ==== Does anybody have a problem with this syntax change? ====
>>> --------------------------------------------------------------
>>
>> I'm not thrilled with it... I'd think the code could be made to
>> handle the [, ], <, or > being in the same parameter as one of the
>> numbers.
>
> I agree. Also, I don't think the capability of creating string
> parameters without using quotes is necessary, or necessarily a good
> idea. The goal should be to make the values we pass in reflect the
> syntax of the device tree, itself, as that is what the naive observer
> would attempt. If I required spaces around "<" and ">", then shame on
> me! :)
>
> Andy
I need to try
fdt set /ethernet at f00 interrupts <33 2 34 2 36 2>
to confirm my reading of the code, it could be a limitation in my mental
parsing, not the parsing code.
...and shame on me too if that is the case since I accepted your change.
;-/ If true, fixing it shouldn't be difficult.
I really need to make some time to create automated regression tests. :-/
Best regards,
gvb
More information about the U-Boot
mailing list