Page MenuHomeFreeBSD

linuxkpi xarray: Correct expression in assertion.
ClosedPublic

Authored by jhb on Feb 7 2022, 9:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 18, 6:43 AM
Unknown Object (File)
Oct 11 2024, 10:25 AM
Unknown Object (File)
Oct 5 2024, 10:07 AM
Unknown Object (File)
Sep 29 2024, 10:23 PM
Unknown Object (File)
Sep 7 2024, 6:53 AM
Unknown Object (File)
Sep 5 2024, 5:23 PM
Unknown Object (File)
Sep 2 2024, 2:58 AM
Unknown Object (File)
Aug 27 2024, 11:08 PM

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Feb 7 2022, 9:35 PM

LGTM based on the discussion in D34145

sys/compat/linuxkpi/common/src/linux_xarray.c
106

I kept the '!= 0' only because that is the preferred FreeBSD style. Note that one could rewrite this assertion as:

if ((xa->flags & XA_FLAGS_ALLOC1) != 0)
    MPASS(mask > 1);

Not sure if that would be more readable?

sys/compat/linuxkpi/common/src/linux_xarray.c
106

We also want to assert mask > 0 for xa->flags & XA_FLAGS_ALLOC1 == 0 though do we not?

This revision is now accepted and ready to land.Feb 7 2022, 10:37 PM
jhb marked an inline comment as done.Feb 11 2022, 9:46 PM
jhb added inline comments.
sys/compat/linuxkpi/common/src/linux_xarray.c
106

Hmmm, I had misread as it as being tautological (>= 0).

This revision was automatically updated to reflect the committed changes.
jhb marked an inline comment as done.