media: use struct_size() helper
authorYu Liao <liaoyu15@huawei.com>
Wed, 16 Aug 2023 06:31:43 +0000 (14:31 +0800)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 27 Sep 2023 07:40:01 +0000 (09:40 +0200)
commitba85aea885a195b1b6c802a4ff8edf4e014e54b5
treef59f3ffc38bcc8edad9d92bc2a7923fe04643fa3
parent6c4ef82846066bf70a07026fe56e9f209a9a5953
media: use struct_size() helper

Prefer struct_size() over open-coded versions of idiom:

sizeof(struct-with-flex-array) + sizeof(typeof-flex-array-elements) * count

where count is the max number of items the flexible array is supposed to
contain.

Signed-off-by: Yu Liao <liaoyu15@huawei.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/common/videobuf2/frame_vector.c