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)
Sun, Aug 16, 5:19 AM
Unknown Object (File)
Fri, Aug 14, 12:55 AM
Unknown Object (File)
Thu, Aug 13, 3:26 AM
Unknown Object (File)
Thu, Aug 13, 3:01 AM
Unknown Object (File)
Tue, Aug 11, 11:28 PM
Unknown Object (File)
Mon, Aug 10, 2:21 PM
Unknown Object (File)
Mon, Aug 10, 9:39 AM
Unknown Object (File)
Sun, Aug 9, 3:48 PM
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.Apr 22 2026, 1:39 PM
This revision was automatically updated to reflect the committed changes.