Re: [PATCH] media: venus: Annotate flex arrays with __counted_by()

From: Dmitry Baryshkov

Date: Mon May 11 2026 - 14:19:14 EST


On Mon, May 11, 2026 at 02:05:38PM +0100, Mohammed EL Kadiri wrote:
> Add __counted_by() annotations to flexible array members:
>
> - hfi_capabilities::data, counted by num_capabilities
> - hfi_profile_level_supported::profile_level, counted by profile_count
> - hfi_resource_ocmem_requirement_info::requirements, counted by num_entries
>
> This improves run-time bounds checking via CONFIG_UBSAN_BOUNDS and
> compile-time object size resolution via __builtin_dynamic_object_size().
>
> Signed-off-by: Mohammed EL Kadiri <med08elkadiri@xxxxxxxxx>
> ---
> drivers/media/platform/qcom/venus/hfi_helper.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>


--
With best wishes
Dmitry