@@ -311,7 +311,7 @@ static int vsp1_pipeline_validate_branch(struct vsp1_pipeline *pipe,
struct vsp1_rwpf *output)
{
struct vsp1_entity *entity;
- unsigned int entities = 0;
+ DECLARE_MEDIA_ENTITY_ENUM(entities);
struct media_pad *pad;
bool bru_found = false;
@@ -351,11 +351,10 @@ static int vsp1_pipeline_validate_branch(struct vsp1_pipeline *pipe,
break;
/* Ensure the branch has no loop. */
- if (entities & (1 << media_entity_id(&entity->subdev.entity)))
+ if (media_entity_enum_test_and_set(entities,
+ &entity->subdev.entity))
return -EPIPE;
- entities |= 1 << media_entity_id(&entity->subdev.entity);
-
/* UDS can't be chained. */
if (entity->type == VSP1_ENTITY_UDS) {
if (pipe->uds)
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/platform/vsp1/vsp1_video.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)