From: Kieran Bingham <kieran.bingham@ideasonboard.com>
To: Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Dan Carpenter <error27@gmail.com>,
Dave Stevenson <dave.stevenson@raspberrypi.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
Ray Jui <rjui@broadcom.com>,
Umang Jain <umang.jain@ideasonboard.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
linux-rpi-kernel@lists.infradead.org,
linux-staging@lists.linux.dev
Cc: Umang Jain <umang.jain@ideasonboard.com>
Subject: Re: [PATCH v2 2/3] vc04_services: mmal-vchiq: Use bool for vchiq_mmal_component.in_use
Date: Fri, 18 Nov 2022 10:30:17 +0000 [thread overview]
Message-ID: <166876741790.50677.17305359640652054680@Monstersaurus> (raw)
In-Reply-To: <20221118084244.199909-3-umang.jain@ideasonboard.com>
Quoting Umang Jain (2022-11-18 08:42:43)
> 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.
This only talks about 7967656ffbfa as I can interpret it. A sentence
here describing what we're going to do about it in /this/ patch would be
clearer as a second paragraph:
"""
Convert the remaining bit-field storage for 'in-use' to a bool and use
it accordingly.
"""
But that's trivial and not worth a v3 specifically. (unless anyone
applying this wants to add it).
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
>
> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
> drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 6 +++---
> drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h | 2 +-
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> index 4abb6178cb9f..294b184d4a49 100644
> --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> @@ -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 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance,
> 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);
>
> diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> index 6d984cf5a83a..09f030919d4e 100644
> --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> @@ -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 */
> --
> 2.38.1
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-11-18 10:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-18 8:42 [PATCH v2 0/3] staging: vc04_services: Promote bool usage Umang Jain
2022-11-18 8:42 ` [PATCH v2 1/3] Revert "staging: mmal-vchiq: Avoid use of bool in structures" Umang Jain
2022-11-18 10:21 ` Kieran Bingham
2022-11-18 17:20 ` Dave Stevenson
2022-11-18 8:42 ` [PATCH v2 2/3] vc04_services: mmal-vchiq: Use bool for vchiq_mmal_component.in_use Umang Jain
2022-11-18 10:30 ` Kieran Bingham [this message]
2022-11-18 17:22 ` Dave Stevenson
2022-11-18 8:42 ` [PATCH v2 3/3] vc04_services: bcm2835-camera: Use bool values for mmal_fmt.remove_padding Umang Jain
2022-11-18 10:50 ` Kieran Bingham
2022-11-18 17:23 ` Dave Stevenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=166876741790.50677.17305359640652054680@Monstersaurus \
--to=kieran.bingham@ideasonboard.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=dave.stevenson@raspberrypi.com \
--cc=error27@gmail.com \
--cc=f.fainelli@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hverkuil-cisco@xs4all.nl \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab+samsung@kernel.org \
--cc=rjui@broadcom.com \
--cc=umang.jain@ideasonboard.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox