diff options
| author | Kees Cook <[email protected]> | 2025-02-05 21:45:26 +0000 |
|---|---|---|
| committer | Kees Cook <[email protected]> | 2025-02-07 02:48:04 +0000 |
| commit | 6270f4deba3fbd77d1717fb8634f1fc612ff69e2 (patch) | |
| tree | c3528aa75278618d1a516781b72d73ace8bda199 /arch/powerpc/lib/code-patching.c | |
| parent | compiler.h: Introduce __must_be_byte_array() (diff) | |
| download | kernel-6270f4deba3fbd77d1717fb8634f1fc612ff69e2.tar.gz kernel-6270f4deba3fbd77d1717fb8634f1fc612ff69e2.zip | |
string.h: Use ARRAY_SIZE() for memtostr*()/strtomem*()
The destination argument of memtostr*() and strtomem*() must be a
fixed-size char array at compile time, so there is no need to use
__builtin_object_size() (which is useful for when an argument is
either a pointer or unknown). Instead use ARRAY_SIZE(), which has the
benefit of working around a bug in Clang (fixed[1] in 15+) that got
__builtin_object_size() wrong sometimes.
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Suggested-by: Kent Overstreet <[email protected]>
Link: https://github.com/llvm/llvm-project/commit/d8e0a6d5e9dd2311641f9a8a5d2bf90829951ddc [1]
Tested-by: Suren Baghdasaryan <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Diffstat (limited to 'arch/powerpc/lib/code-patching.c')
0 files changed, 0 insertions, 0 deletions
