Page MenuHomeFreeBSD

linuxkpi: Add `mem_is_zero()`
ClosedPublic

Authored by dumbbell on Apr 16 2026, 9:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 18, 2:18 AM
Unknown Object (File)
Mon, May 18, 2:10 AM
Unknown Object (File)
Sun, May 17, 7:10 PM
Unknown Object (File)
Sun, May 17, 7:05 PM
Unknown Object (File)
Sun, May 17, 4:25 AM
Unknown Object (File)
Sat, May 16, 4:28 PM
Unknown Object (File)
Thu, May 14, 5:45 AM
Unknown Object (File)
Thu, May 14, 5:45 AM
Subscribers

Details

Reviewers
bz
Group Reviewers
linuxkpi
Commits
rGab77c26d3643: linuxkpi: Add `mem_is_zero()`
Summary

The DRM generic code and the i915 DRM driver started to replace the use of memchr_inv() by a mem_is_zero() in Linux 6.12. We reuse the previous use of memchr_inv() to implement mem_is_zero().

This is part of the update of DRM drivers to Linux 6.12.

Sponsored by: The FreeBSD Foundation

Diff Detail

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

Event Timeline

bz requested changes to this revision.Apr 20 2026, 10:17 PM
bz added a subscriber: bz.
bz added inline comments.
sys/compat/linuxkpi/common/include/linux/string.h
206

This could be written as
return (!memchr_inv(start, 0, length));
but as per style probably should be
return (memchr_inv(start, 0, length) == NULL);

This revision now requires changes to proceed.Apr 20 2026, 10:17 PM

Address comment from @bz

Sorry, that’s me who dislike putting calls or complex statements directly in the return :-) I should have followed the adopted style.

This revision is now accepted and ready to land.Wed, Apr 22, 1:39 PM
This revision was automatically updated to reflect the committed changes.