[2/2] staging: vc04_services: mmal-common: Do not use bool in structures

Message ID 20221117125953.88441-3-umang.jain@ideasonboard.com
State New
Headers
Series vc04_services: vchiq-mmal: Drop bool usage |

Commit Message

Umang Jain Nov. 17, 2022, 12:59 p.m. UTC
  Do not use bool in structures, it already gets flagged by checkpatch:

"Avoid using bool structure members because of possible alignment issues"

Hence, modify struct mmal_fmt.remove_padding to use u32. No change in
assignments as 0/1 are already being used with mmal_fmt.remove_padding.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
 drivers/staging/vc04_services/vchiq-mmal/mmal-common.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Greg KH Nov. 17, 2022, 1:13 p.m. UTC | #1
On Thu, Nov 17, 2022 at 06:29:53PM +0530, Umang Jain wrote:
> Do not use bool in structures, it already gets flagged by checkpatch:
> 
> "Avoid using bool structure members because of possible alignment issues"
> 
> Hence, modify struct mmal_fmt.remove_padding to use u32. No change in
> assignments as 0/1 are already being used with mmal_fmt.remove_padding.
> 
> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
>  drivers/staging/vc04_services/vchiq-mmal/mmal-common.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-common.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-common.h
> index b33129403a30..fd02440f41b2 100644
> --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-common.h
> +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-common.h
> @@ -32,9 +32,9 @@ struct mmal_fmt {
>  	int depth;
>  	u32 mmal_component;  /* MMAL component index to be used to encode */
>  	u32 ybbp;            /* depth of first Y plane for planar formats */
> -	bool remove_padding;   /* Does the GPU have to remove padding,
> -				* or can we do hide padding via bytesperline.
> -				*/
> +	u32 remove_padding;  /* Does the GPU have to remove padding,
> +			      * or can we do hide padding via bytesperline.
> +			      */

checkpatch is wrong here, bool is correct to use and is just fine.

thanks,

greg k-h
  
Dan Carpenter Nov. 17, 2022, 1:48 p.m. UTC | #2
On Thu, Nov 17, 2022 at 06:29:53PM +0530, Umang Jain wrote:
> Do not use bool in structures, it already gets flagged by checkpatch:
> 
> "Avoid using bool structure members because of possible alignment issues"
> 

This checkpatch warning was removed almost 4 years ago.

regards,
dan carpenter
  

Patch

diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-common.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-common.h
index b33129403a30..fd02440f41b2 100644
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-common.h
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-common.h
@@ -32,9 +32,9 @@  struct mmal_fmt {
 	int depth;
 	u32 mmal_component;  /* MMAL component index to be used to encode */
 	u32 ybbp;            /* depth of first Y plane for planar formats */
-	bool remove_padding;   /* Does the GPU have to remove padding,
-				* or can we do hide padding via bytesperline.
-				*/
+	u32 remove_padding;  /* Does the GPU have to remove padding,
+			      * or can we do hide padding via bytesperline.
+			      */
 };
 
 /* buffer for one video frame */