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)
Tue, Apr 9, 11:08 PM
Unknown Object (File)
Nov 20 2023, 11:06 PM
Unknown Object (File)
Nov 15 2023, 2:11 PM
Unknown Object (File)
Nov 7 2023, 10:49 PM
Unknown Object (File)
Oct 7 2023, 10:25 PM
Unknown Object (File)
Oct 6 2023, 9:28 PM
Unknown Object (File)
Apr 6 2023, 6:56 AM
Unknown Object (File)
Mar 5 2023, 5:29 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.