Date: Wed, 22 Apr 2026 18:10:21 +0000 From: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron <dumbbell@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: ab77c26d3643 - main - linuxkpi: Add `mem_is_zero()` Message-ID: <69e90f0d.443ba.6e788d9@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=ab77c26d3643b88b29d3526d60b939d1cca402f9 commit ab77c26d3643b88b29d3526d60b939d1cca402f9 Author: Jean-Sébastien Pédron <dumbbell@FreeBSD.org> AuthorDate: 2026-04-12 10:16:55 +0000 Commit: Jean-Sébastien Pédron <dumbbell@FreeBSD.org> CommitDate: 2026-04-22 18:09:54 +0000 linuxkpi: Add `mem_is_zero()` 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()`. Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56442 --- sys/compat/linuxkpi/common/include/linux/string.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/string.h b/sys/compat/linuxkpi/common/include/linux/string.h index 0b858e7af623..8ca20df27792 100644 --- a/sys/compat/linuxkpi/common/include/linux/string.h +++ b/sys/compat/linuxkpi/common/include/linux/string.h @@ -198,6 +198,12 @@ memchr_inv(const void *start, int c, size_t length) return (NULL); } +static inline bool +mem_is_zero(const void *start, size_t length) +{ + return (memchr_inv(start, 0, length) == NULL); +} + static inline size_t str_has_prefix(const char *str, const char *prefix) {home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69e90f0d.443ba.6e788d9>
