vc04_services: mmal-vchiq: Use bool for vchiq_mmal_component.in_use
authorUmang Jain <umang.jain@ideasonboard.com>
Fri, 18 Nov 2022 08:42:43 +0000 (14:12 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Nov 2022 12:20:21 +0000 (13:20 +0100)
In commit 7967656ffbfa ("coding-style: Clarify the expectations around
bool") the check to dis-allow bool structure members was removed from
checkpatch.pl. It promotes bool structure members to store boolean
values. This enhances code readability.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20221118084244.199909-3-umang.jain@ideasonboard.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h

index 4abb6178cb9ff9af1087588a28b74c1880581ecf..294b184d4a495e774b29ddacce17a888828a049f 100644 (file)
@@ -1648,7 +1648,7 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance,
        for (idx = 0; idx < VCHIQ_MMAL_MAX_COMPONENTS; idx++) {
                if (!instance->component[idx].in_use) {
                        component = &instance->component[idx];
-                       component->in_use = 1;
+                       component->in_use = true;
                        break;
                }
        }
@@ -1724,7 +1724,7 @@ release_component:
        destroy_component(instance, component);
 unlock:
        if (component)
-               component->in_use = 0;
+               component->in_use = false;
        mutex_unlock(&instance->vchiq_mutex);
 
        return ret;
@@ -1747,7 +1747,7 @@ int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance,
 
        ret = destroy_component(instance, component);
 
-       component->in_use = 0;
+       component->in_use = false;
 
        mutex_unlock(&instance->vchiq_mutex);
 
index 6d984cf5a83acbd1654caeeaa154bd66aa445e63..09f030919d4e285e7e8d2485a2bef93400e846b4 100644 (file)
@@ -82,7 +82,7 @@ struct vchiq_mmal_port {
 };
 
 struct vchiq_mmal_component {
-       u32 in_use:1;
+       bool in_use;
        bool enabled;
        u32 handle;  /* VideoCore handle for component */
        u32 inputs;  /* Number of input ports */