Signed-off-by: Sakari Ailus <sakari.ai...@linux.intel.com>
---
 drivers/media/platform/vsp1/vsp1_video.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/vsp1/vsp1_video.c 
b/drivers/media/platform/vsp1/vsp1_video.c
index f741582..026d6462 100644
--- a/drivers/media/platform/vsp1/vsp1_video.c
+++ b/drivers/media/platform/vsp1/vsp1_video.c
@@ -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)
-- 
2.1.0.231.g7484e3b

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to