]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bpf: Replace offsetof() with struct_size()
authorThorsten Blum <thorsten.blum@linux.dev>
Sat, 3 May 2025 15:15:13 +0000 (17:15 +0200)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 5 May 2025 21:21:46 +0000 (14:21 -0700)
commit41948afcf503b5667637a0b3ab279a061f559bec
treec75d4f70db7e96ce3955d76a2b29cf07916cb077
parent41d4ce6df3f4945341ec509a840cc002a413b6cc
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/20250503151513.343931-2-thorsten.blum@linux.dev
kernel/bpf/btf.c