diff options
author | Mauro Carvalho Chehab | 2015-10-01 18:07:53 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab | 2015-10-01 18:10:05 -0300 |
commit | ef69ee1bc2c10fd1c5b389258d8156f3c38bdb33 (patch) | |
tree | a5c80cbea5086ebfee9f72b1905e13f44da6192a /include/media | |
parent | ca739eb086155007d7264be7ccc07f894d5a7bbe (diff) |
[media] media-entity.c: get rid of var length arrays
Fix those sparse warnings:
drivers/media/media-entity.c:238:17: warning: Variable length array is used.
drivers/media/media-entity.c:239:17: warning: Variable length array is used.
That allows sparse and other code check tools to verify if the
function is using more stack than allowed.
It also solves a bad Kernel pratice of using var length arrays
at the stack.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/media-entity.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/media/media-entity.h b/include/media/media-entity.h index 0c003d817493..197f93799753 100644 --- a/include/media/media-entity.h +++ b/include/media/media-entity.h @@ -116,6 +116,13 @@ static inline u32 media_entity_subtype(struct media_entity *entity) #define MEDIA_ENTITY_ENUM_MAX_DEPTH 16 #define MEDIA_ENTITY_ENUM_MAX_ID 64 +/* + * The number of pads can't be bigger than the number of entities, + * as the worse-case scenario is to have one entity linked up to + * MEDIA_ENTITY_ENUM_MAX_ID - 1 entities. + */ +#define MEDIA_ENTITY_MAX_PADS (MEDIA_ENTITY_ENUM_MAX_ID - 1) + struct media_entity_graph { struct { struct media_entity *entity; |