public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Umang Jain <umang.jain@ideasonboard.com>
Cc: Kieran Bingham <kieran.bingham@ideasonboard.com>,
	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>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
	Ray Jui <rjui@broadcom.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	linux-rpi-kernel@lists.infradead.org,
	linux-staging@lists.linux.dev
Subject: Re: [PATCH 1/3] Revert "staging: mmal-vchiq: Avoid use of bool in structures"
Date: Thu, 17 Nov 2022 19:02:10 +0100	[thread overview]
Message-ID: <Y3Z3Is8u4wGZfKU5@kroah.com> (raw)
In-Reply-To: <c718624a-bb6f-5474-5cc3-4319b1fdb282@ideasonboard.com>

On Thu, Nov 17, 2022 at 11:25:48PM +0530, Umang Jain wrote:
> Hi Kieran,
> 
> On 11/17/22 9:39 PM, Kieran Bingham wrote:
> > Quoting Umang Jain (2022-11-17 16:00:13)
> > > This reverts commit 640e77466e69d9c28de227bc76881f5501f532ca.
> > > 
> > > 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>
> > > ---
> > >   .../staging/vc04_services/vchiq-mmal/mmal-vchiq.c    | 12 ++++++------
> > >   .../staging/vc04_services/vchiq-mmal/mmal-vchiq.h    |  4 ++--
> > >   2 files changed, 8 insertions(+), 8 deletions(-)
> > > 
> > > diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> > > index cb921c94996a..4abb6178cb9f 100644
> > > --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> > > +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> > > @@ -863,9 +863,9 @@ static int port_info_get(struct vchiq_mmal_instance *instance,
> > >                  goto release_msg;
> > >          if (rmsg->u.port_info_get_reply.port.is_enabled == 0)
> > > -               port->enabled = 0;
> > > +               port->enabled = false;
> > >          else
> > > -               port->enabled = 1;
> > > +               port->enabled = true;
> > >          /* copy the values out of the message */
> > >          port->handle = rmsg->u.port_info_get_reply.port_handle;
> > > @@ -1304,7 +1304,7 @@ static int port_disable(struct vchiq_mmal_instance *instance,
> > >          if (!port->enabled)
> > >                  return 0;
> > > -       port->enabled = 0;
> > > +       port->enabled = false;
> > >          ret = port_action_port(instance, port,
> > >                                 MMAL_MSG_PORT_ACTION_TYPE_DISABLE);
> > > @@ -1359,7 +1359,7 @@ static int port_enable(struct vchiq_mmal_instance *instance,
> > >          if (ret)
> > >                  goto done;
> > > -       port->enabled = 1;
> > > +       port->enabled = true;
> > >          if (port->buffer_cb) {
> > >                  /* send buffer headers to videocore */
> > > @@ -1531,7 +1531,7 @@ int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance,
> > >                          pr_err("failed disconnecting src port\n");
> > >                          goto release_unlock;
> > >                  }
> > > -               src->connected->enabled = 0;
> > > +               src->connected->enabled = false;
> > >                  src->connected = NULL;
> > >          }
> > > @@ -1799,7 +1799,7 @@ int vchiq_mmal_component_disable(struct vchiq_mmal_instance *instance,
> > >          ret = disable_component(instance, component);
> > >          if (ret == 0)
> > > -               component->enabled = 0;
> > > +               component->enabled = 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 6006e29232b3..70eda6cac1c6 100644
> > > --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> > > +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> > > @@ -48,7 +48,7 @@ typedef void (*vchiq_mmal_buffer_cb)(
> > >                  int status, struct mmal_buffer *buffer);
> > >   struct vchiq_mmal_port {
> > > -       u32 enabled:1;
> > > +       bool enabled:1;
> > Is this a direct revert with 'git revert' ?
> 
> 
> No. It had conflicts plus I added the ':1' initialization to keep the logic
> same (in case 'enabled' gets used directly). Similar pattern come up with:
>     ($) git grep 'bool' -- '*.[h]' | grep '\:1'
> 
> So it shouldn't be an issue.

Please don't do that "bool foo:1" makes no sense.  Drop the ":1"
please.

thanks,

greg k-h

  reply	other threads:[~2022-11-17 18:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17 16:00 [PATCH 0/3] vc04_services: Promote bool usage Umang Jain
2022-11-17 16:00 ` [PATCH 1/3] Revert "staging: mmal-vchiq: Avoid use of bool in structures" Umang Jain
2022-11-17 16:09   ` Kieran Bingham
2022-11-17 17:55     ` Umang Jain
2022-11-17 18:02       ` Greg Kroah-Hartman [this message]
2022-11-17 18:22         ` Umang Jain
2022-11-18  0:12           ` Andrew Lunn
2022-11-18  3:58             ` Umang Jain
2022-11-18  8:35             ` Dan Carpenter
2022-11-17 16:00 ` [PATCH 2/3] vc04_services: mmal-vchiq: Use bool for vchiq_mmal_component.in_use Umang Jain
2022-11-18  0:23   ` Andrew Lunn
2022-11-18  9:01     ` Dan Carpenter
2022-11-17 16:00 ` [PATCH 3/3] vc04_services: bcm2835-camera: Use bool values for mmal_fmt.remove_padding Umang Jain
2022-11-17 18:11 ` [PATCH 0/3] vc04_services: Promote bool usage Stefan Wahren
2022-11-18  8:47   ` Dan Carpenter
2022-11-18 17:25   ` 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=Y3Z3Is8u4wGZfKU5@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=error27@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=kieran.bingham@ideasonboard.com \
    --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