[Toybox] [PATCH] devmem: Fix 8 byte wide writes

Michael Shavit mshavit at google.com
Thu Aug 31 20:54:28 PDT 2023


On Fri, Sep 1, 2023 at 5:24 AM Rob Landley <rob at landley.net> wrote:
>
> On 8/31/23 13:38, Michael Shavit wrote:
> > On Thu, Aug 31, 2023 at 8:26 PM Michael Shavit <mshavit at google.com> wrote:
> >>
> >> On Thu, Aug 31, 2023 at 6:57 PM Rob Landley <rob at landley.net> wrote:
> >> >
> >> >    // DATA? Report out of range values as errors rather than truncating.
> >> > -  if (writing) data = atolx_range(toys.optargs[2], 0, (1ULL<<(8*bytes))-1);
> >> > +  if (writing && (data = atollu(toys.optargs[2]))>(~0LL)>>(64-8*bytes))
> >>
> >> Shouldn't it be (~0ULL)? I think (~0LL) would make this an arithmetic
> >> shift instead of a logical shift.
> >
> > The `devmem 0x000000008b300000  4 0x1FFFFFFFF` testcase doesn't detect
> > and print an error because of this issue. But your change with  (~0LL)
> > changed to (~0ULL) does pass all the test cases previously mentioned.
>
> I'm trying to cut and paste your test cases into the git commit message and
> don't know how to escape the "lines starting with # will be ignored" bit. :P
>
> Commit ad36c8765d8a
>
> Rob

Awesome, thanks for the quick merge :) .


More information about the Toybox mailing list