Re: [PATCH V3] Support 'r' format for printing raw bytes with fdtget

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Thu, Dec 09, 2021 at 07:06:52AM +0100, Rafał Miłecki wrote:
> On 09.12.2021 06:52, David Gibson wrote:
> > > diff --git a/tests/run_tests.sh b/tests/run_tests.sh
> > > index d100d5a..11068e1 100755
> > > --- a/tests/run_tests.sh
> > > +++ b/tests/run_tests.sh
> > > @@ -855,6 +855,8 @@ fdtget_tests () {
> > >       run_fdtget_test 8000 -tx $dtb /cpus/PowerPC,970@1 d-cache-size
> > >       run_fdtget_test "61 62 63 0" -tbx $dtb /randomnode tricky1
> > >       run_fdtget_test "a b c d de ea ad be ef" -tbx $dtb /randomnode blob
> > > +    run_fdtget_test "MyBoardName\0MyBoardFamilyName\0" -tr $dtb / compatible
> > > +    run_fdtget_test "\x0a\x0b\x0c\x0d\xde\xea\xad\xbe\xef" -tr $dtb /randomnode blob
> > 
> > I think using \ escapes in strings will be shell dependent behaviour.
> > Have you tested this in shells other than bash?
> 
> It isn't back dependent but printf dependent. See fdtget-runtest.sh :
> printf '%b\n' "$expect" > $EXPECT
> 
> It seems even busybox's printf supports %b:
> # printf "%b" "\x0a\x0b\x0c\x0d\xde\xea\xad\xbe\xef" | hexdump -C
> 00000000  0a 0b 0c 0d de ea ad be  ef                       |.........|
> 00000009

Ah, sorry, I'd forgotten that fdtget-runtest.sh invoked printf.  In
that case, it should be fine.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux