[PATCH v2 0/3] string.h: Use ARRAY_SIZE() for memtostr*()/strtomem*()
From: Kees Cook
Date: Thu Feb 06 2025 - 16:40:29 EST
Work around a Clang <15 bug by switching to ARRAY_SIZE() (with the
added benefit of explicitly checking for char array arguments) in
memtostr*/strtomem*().
v2:
- change __must_be_byte_array to __must_be_byte_array() (david)
- add missed Suggested-by (kent)
- clarify move log (miguel)
- clarify cover letter Clang version (andy)
v1: https://lore.kernel.org/lkml/20250206175216.work.225-kees@xxxxxxxxxx/
-Kees
Kees Cook (3):
compiler.h: Move C string helpers into C-only kernel section
compiler.h: Introduce __must_be_byte_array()
string.h: Use ARRAY_SIZE() for memtostr*()/strtomem*()
include/linux/compiler.h | 32 +++++++++++++++++++-------------
include/linux/string.h | 12 ++++++++----
2 files changed, 27 insertions(+), 17 deletions(-)
--
2.34.1