Page MenuHomeFreeBSD

linuxkpi xarray: Correct expression in assertion.
ClosedPublic

Authored by jhb on Feb 7 2022, 9:35 PM.
Tags
None
Referenced Files
F153308753: D34197.diff
Mon, Apr 20, 9:36 AM
Unknown Object (File)
Thu, Apr 16, 2:23 AM
Unknown Object (File)
Wed, Apr 15, 7:53 AM
Unknown Object (File)
Tue, Apr 14, 9:07 PM
Unknown Object (File)
Fri, Apr 10, 5:35 AM
Unknown Object (File)
Fri, Mar 27, 10:51 AM
Unknown Object (File)
Fri, Mar 27, 1:54 AM
Unknown Object (File)
Mon, Mar 23, 3:28 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.