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)
Sat, May 17, 5:18 AM
Unknown Object (File)
Wed, May 7, 6:23 PM
Unknown Object (File)
Thu, May 1, 8:44 PM
Unknown Object (File)
Mon, Apr 28, 6:57 AM
Unknown Object (File)
Apr 20 2025, 8:04 AM
Unknown Object (File)
Feb 5 2025, 5:00 PM
Unknown Object (File)
Jan 30 2025, 7:41 PM
Unknown Object (File)
Jan 25 2025, 4:12 AM

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.