[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y3dD6Lg2L7CgkDFe@kadam>
Date: Fri, 18 Nov 2022 11:35:52 +0300
From: Dan Carpenter <error27@...il.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: Umang Jain <umang.jain@...asonboard.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Kieran Bingham <kieran.bingham@...asonboard.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>,
Dave Stevenson <dave.stevenson@...pberrypi.com>,
Florian Fainelli <f.fainelli@...il.com>,
Hans Verkuil <hverkuil-cisco@...all.nl>,
Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
Ray Jui <rjui@...adcom.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-rpi-kernel@...ts.infradead.org, linux-staging@...ts.linux.dev
Subject: Re: [PATCH 1/3] Revert "staging: mmal-vchiq: Avoid use of bool in
structures"
On Fri, Nov 18, 2022 at 01:12:32AM +0100, Andrew Lunn wrote:
>
> Does :1 really initialise the variable?
Obviously not.
> In "u32 enabled:1" it means
> this is a 1 bit wide bit field. It seems odd that bool is somehow
> special and :1 means something else.
If you have a bunch of consecutive bool a:1; bool b:1; then GCC will
squeeze them into the same byte. But if you have bool a; bool b; then
they each take a byte with GCC. I have specified GCC because the size
of bool types are a bit vague in the C standard.
regards,
dan carpenter
Powered by blists - more mailing lists