]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ASoC: cs-amp-lib: Replace offsetof() with struct_size()
authorThorsten Blum <thorsten.blum@linux.dev>
Mon, 14 Apr 2025 11:45:28 +0000 (13:45 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 14 Apr 2025 15:08:04 +0000 (16:08 +0100)
commit46e7ea05bf5d9fe4d05e173c824ae173c956cb5f
tree3cc27dcea304fd8acacbecce06f06423bd56a88c
parent2b4ce994afca0690ab79b7860045e6883e8706db
ASoC: cs-amp-lib: Replace offsetof() with struct_size()

Use struct_size() to calculate the number of bytes to allocate and used
by 'cirrus_amp_efi_data'. Compared to offsetof(), struct_size() provides
additional compile-time checks (e.g., __must_be_array()).

Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250414114528.355204-2-thorsten.blum@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cs-amp-lib-test.c
sound/soc/codecs/cs-amp-lib.c