Page MenuHomeFreeBSD

linuxkpi xarray: Correct expression in assertion.
ClosedPublic

Authored by jhb on Feb 7 2022, 9:35 PM.
Tags
None
Referenced Files
F119296677: D34197.id.diff
Sat, Jun 7, 8:50 AM
Unknown Object (File)
Fri, Jun 6, 12:15 AM
Unknown Object (File)
Sat, May 17, 5:18 AM
Unknown Object (File)
May 7 2025, 6:23 PM
Unknown Object (File)
May 1 2025, 8:44 PM
Unknown Object (File)
Apr 28 2025, 6:57 AM
Unknown Object (File)
Apr 20 2025, 8:04 AM
Unknown Object (File)
Feb 5 2025, 5:00 PM

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 44328
Build 41216: arc lint + arc unit

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.