Commit 669d51f8 authored by Ricardo Ribalda's avatar Ricardo Ribalda Committed by Hans Verkuil

media: allegro: nal-hevc: Replace array[1] with array[N]

Structures that have a single element array as the last field can be
mistaken as a "flex array".

We could replace all the single element arrays in the structure with
single element fields, but this driver prefers to follow the ITU-T H.265
specification, which defines it as an array.

If we introduce a new define N_HRD_PARAMS, we make clear our
intentions.

This fixes this cocci warning:
drivers/media/platform/allegro-dvt/nal-hevc.h:102:14-22: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays)
Signed-off-by: default avatarRicardo Ribalda <ribalda@chromium.org>
Reviewed-by: default avatarMichael Tretter <m.tretter@pengutronix.de>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: fix typo in subject and commit log]
parent 6a4e6e34
......@@ -96,10 +96,11 @@ struct nal_hevc_vps {
unsigned int extension_data_flag;
};
#define N_HRD_PARAMS 1
struct nal_hevc_sub_layer_hrd_parameters {
unsigned int bit_rate_value_minus1[1];
unsigned int cpb_size_value_minus1[1];
unsigned int cbr_flag[1];
unsigned int bit_rate_value_minus1[N_HRD_PARAMS];
unsigned int cpb_size_value_minus1[N_HRD_PARAMS];
unsigned int cbr_flag[N_HRD_PARAMS];
};
struct nal_hevc_hrd_parameters {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment