]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bpf: Replace offsetof() with struct_size()
authorThorsten Blum <thorsten.blum@linux.dev>
Mon, 28 Apr 2025 21:06:39 +0000 (23:06 +0200)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 1 May 2025 17:37:35 +0000 (10:37 -0700)
commit7b05f43155cb128aa06a226afdbc3daa8d75b358
tree132eab156ff0bef5fd54e6ef6a4c8c570c69d079
parent358b1c0f56ebb6996fcec7dcdcf6bae5dcbc8b6c
bpf: Replace offsetof() with struct_size()

Compared to offsetof(), struct_size() provides additional compile-time
checks for structs with flexible arrays (e.g., __must_be_array()).

No functional changes intended.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250428210638.30219-2-thorsten.blum@linux.dev
kernel/bpf/syscall.c