Page MenuHomeFreeBSD

linuxkpi: Add `mem_is_zero()`
ClosedPublic

Authored by dumbbell on Apr 16 2026, 9:00 PM.
Tags
None
Referenced Files
F168005001: D56442.id.diff
Tue, Aug 25, 9:13 PM
F167975149: D56442.id176132.diff
Tue, Aug 25, 5:23 PM
F167942835: D56442.id175706.diff
Tue, Aug 25, 1:24 PM
F167938243: D56442.id176059.diff
Tue, Aug 25, 12:50 PM
Unknown Object (File)
Tue, Aug 25, 1:44 AM
Unknown Object (File)
Sun, Aug 23, 12:03 PM
Unknown Object (File)
Sun, Aug 23, 4:04 AM
Unknown Object (File)
Sun, Aug 23, 1:05 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.Apr 22 2026, 1:39 PM
This revision was automatically updated to reflect the committed changes.