Files
Jani NikulaandGreg Kroah-Hartman e990211bd0 string: add mem_is_zero() helper to check if memory area is all zeros
[ Upstream commit 3942bb4972 ]

Almost two thirds of the memchr_inv() usages check if the memory area is
all zeros, with no interest in where in the buffer the first non-zero
byte is located. Checking for !memchr_inv(s, 0, n) is also not very
intuitive or discoverable. Add an explicit mem_is_zero() helper for this
use case.

Reviewed-by: Kees Cook <kees@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240814100035.3100852-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Stable-dep-of: 3e6ccd790e ("gpio: cdev: check if uAPI v2 config attributes are correctly zeroed")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2026-06-01 17:39:42 +02:00
..
2026-03-04 07:19:30 -05:00
2026-03-25 11:03:01 +01:00
2025-09-11 17:19:15 +02:00
2024-12-14 19:53:51 +01:00
2024-10-17 15:21:32 +02:00
2024-12-14 19:54:37 +01:00
2026-01-11 15:19:01 +01:00
2025-07-06 10:58:04 +02:00
2026-01-11 15:18:35 +01:00
2025-06-04 14:40:25 +02:00
2026-06-01 17:39:24 +02:00
2025-08-15 12:04:54 +02:00
2026-01-11 15:18:48 +01:00
2025-02-01 18:30:05 +01:00
2026-01-11 15:19:13 +01:00
2024-10-17 15:21:12 +02:00