Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp411633rwb; Fri, 18 Nov 2022 03:22:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf7F21sa9FjhSmft/SfztSNc1zEorVtE91ott0l3G4cxjqgw5knxVUP8W9yjnKal0Sbo7Pfp X-Received: by 2002:a17:906:a157:b0:7a5:7e25:5b11 with SMTP id bu23-20020a170906a15700b007a57e255b11mr5482605ejb.254.1668770547694; Fri, 18 Nov 2022 03:22:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668770547; cv=none; d=google.com; s=arc-20160816; b=fCV3SE2Rta1xvGwpk7ug+VBCmI5vzDoB0CPaAYi+/sgGeZhJraB1MQQmohkjmzMIRx 8PesC37G5b2ioYvGPohtQw28CchvaUl8biBDHX1XAiVSJtrAKowd+WNAoJOpOQxGJMYG 9OTuxgLna9HMkZmcoiqAPeio876+mRbnFmPVprVOV8YKSfFKNREzBmcHbO1/i9YpKYR2 FYX2THxzInrwvC4qtXfLT615QO+OdDNrKYWVnbjVZL2frMHxHTwQYFIIVME7kX7vQ5Xi gijSjtHqKotYsKRaszI38awvWt6gwJb9KYeLyRTzIiNlYVKpaSC8kNaoqYFE7tZh9LAC MPBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=eWvbor0c2aNctZuGWi7s6gaLb6g/CS7vfkbSTVoCTBQ=; b=oCM8PACPMfJAdOaP/63IcMqyJIhsDro8gtas8cS0ul/OB+xquIhEugJuaEGGGNz8Yk dtdA2YkgUFXaiVedOZmyY+vni9HdNjKNgRrZHNHnk+rII/OgSRJ+5AGgX+Ulyc8MuJ94 Nrf8ZExUxkOTd76RuPe/8+AtmKasFWDP5bPZ2ZeMqwKn7btOe5P5iDZrMZk/AjRaxmyW cfvC/eOiC7+2W+sD3ge2j+Z1eE9LYznZQplrEerauv8JhXNtkGbTibq3DdmPcczt3+Xc ZwWJpJB8MouAHa4JQeboau/1tkK4QdUBstvVqf0VeRc4YLzo8SMuBdxjVXL2+5WN6w7s rd7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=Sk7X679F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mp9-20020a1709071b0900b007aea5ae39b1si2812131ejc.443.2022.11.18.03.21.55; Fri, 18 Nov 2022 03:22:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=Sk7X679F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241782AbiKRKuj (ORCPT + 91 others); Fri, 18 Nov 2022 05:50:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241796AbiKRKua (ORCPT ); Fri, 18 Nov 2022 05:50:30 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2443097AA6 for ; Fri, 18 Nov 2022 02:50:27 -0800 (PST) Received: from pendragon.ideasonboard.com (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 954A349C; Fri, 18 Nov 2022 11:50:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1668768625; bh=1CsWy/GmyIFnYxae/LDO/zoah3Qc8VosycoLHVtCM/c=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=Sk7X679FDVTwWZyGdinLcsA3j0tQFr6iwEo9vF/+oBe0+HSTF0hYCFQ6Nl4kyqdZX JXteJnucFzeBrHnB0Na+BWVdhKWB4zU1uqNJr9jwJPmpXWBR3VCTG2mcgdoJ0vcimf 7NgfxkJJcczL8/aZnu0HBeGmBzT1OLI3SRobt5y4= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20221118084244.199909-4-umang.jain@ideasonboard.com> References: <20221118084244.199909-1-umang.jain@ideasonboard.com> <20221118084244.199909-4-umang.jain@ideasonboard.com> Subject: Re: [PATCH v2 3/3] vc04_services: bcm2835-camera: Use bool values for mmal_fmt.remove_padding From: Kieran Bingham Cc: Umang Jain To: Broadcom internal kernel review list , Dan Carpenter , Dave Stevenson , Florian Fainelli , Greg Kroah-Hartman , Hans Verkuil , Mauro Carvalho Chehab , Ray Jui , Umang Jain , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-staging@lists.linux.dev Date: Fri, 18 Nov 2022 10:50:23 +0000 Message-ID: <166876862357.50677.2208743534141685703@Monstersaurus> User-Agent: alot/0.10 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Umang Jain (2022-11-18 08:42:44) > mmal_fmt.remove_padding is defined as a boolean type hence, use boolean > values for it instead of 0/1 integers. This enhances code readability. This could be (optionally) expanded: """ The field 'remove_padding' in 'struct mmal_fmt' is defined as a boolean type. The initialisation of the formats[] array stores integer 0/1 values into this field rather than a more readable bool type. Convert the usages to boolean true/false, and fix up the local storage type in mmal_setup_components() to enhance code readability. """ Reviewed-by: Kieran Bingham > Signed-off-by: Umang Jain > --- > .../bcm2835-camera/bcm2835-camera.c | 30 +++++++++---------- > 1 file changed, 15 insertions(+), 15 deletions(-) >=20 > diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.= c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c > index fd456d1f7061..797ebe2a973a 100644 > --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c > +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c > @@ -87,21 +87,21 @@ static struct mmal_fmt formats[] =3D { > .depth =3D 12, > .mmal_component =3D COMP_CAMERA, > .ybbp =3D 1, > - .remove_padding =3D 1, > + .remove_padding =3D true, > }, { > .fourcc =3D V4L2_PIX_FMT_YUYV, > .mmal =3D MMAL_ENCODING_YUYV, > .depth =3D 16, > .mmal_component =3D COMP_CAMERA, > .ybbp =3D 2, > - .remove_padding =3D 0, > + .remove_padding =3D false, > }, { > .fourcc =3D V4L2_PIX_FMT_RGB24, > .mmal =3D MMAL_ENCODING_RGB24, > .depth =3D 24, > .mmal_component =3D COMP_CAMERA, > .ybbp =3D 3, > - .remove_padding =3D 0, > + .remove_padding =3D false, > }, { > .fourcc =3D V4L2_PIX_FMT_JPEG, > .flags =3D V4L2_FMT_FLAG_COMPRESSED, > @@ -109,7 +109,7 @@ static struct mmal_fmt formats[] =3D { > .depth =3D 8, > .mmal_component =3D COMP_IMAGE_ENCODE, > .ybbp =3D 0, > - .remove_padding =3D 0, > + .remove_padding =3D false, > }, { > .fourcc =3D V4L2_PIX_FMT_H264, > .flags =3D V4L2_FMT_FLAG_COMPRESSED, > @@ -117,7 +117,7 @@ static struct mmal_fmt formats[] =3D { > .depth =3D 8, > .mmal_component =3D COMP_VIDEO_ENCODE, > .ybbp =3D 0, > - .remove_padding =3D 0, > + .remove_padding =3D false, > }, { > .fourcc =3D V4L2_PIX_FMT_MJPEG, > .flags =3D V4L2_FMT_FLAG_COMPRESSED, > @@ -125,63 +125,63 @@ static struct mmal_fmt formats[] =3D { > .depth =3D 8, > .mmal_component =3D COMP_VIDEO_ENCODE, > .ybbp =3D 0, > - .remove_padding =3D 0, > + .remove_padding =3D false, > }, { > .fourcc =3D V4L2_PIX_FMT_YVYU, > .mmal =3D MMAL_ENCODING_YVYU, > .depth =3D 16, > .mmal_component =3D COMP_CAMERA, > .ybbp =3D 2, > - .remove_padding =3D 0, > + .remove_padding =3D false, > }, { > .fourcc =3D V4L2_PIX_FMT_VYUY, > .mmal =3D MMAL_ENCODING_VYUY, > .depth =3D 16, > .mmal_component =3D COMP_CAMERA, > .ybbp =3D 2, > - .remove_padding =3D 0, > + .remove_padding =3D false, > }, { > .fourcc =3D V4L2_PIX_FMT_UYVY, > .mmal =3D MMAL_ENCODING_UYVY, > .depth =3D 16, > .mmal_component =3D COMP_CAMERA, > .ybbp =3D 2, > - .remove_padding =3D 0, > + .remove_padding =3D false, > }, { > .fourcc =3D V4L2_PIX_FMT_NV12, > .mmal =3D MMAL_ENCODING_NV12, > .depth =3D 12, > .mmal_component =3D COMP_CAMERA, > .ybbp =3D 1, > - .remove_padding =3D 1, > + .remove_padding =3D true, > }, { > .fourcc =3D V4L2_PIX_FMT_BGR24, > .mmal =3D MMAL_ENCODING_BGR24, > .depth =3D 24, > .mmal_component =3D COMP_CAMERA, > .ybbp =3D 3, > - .remove_padding =3D 0, > + .remove_padding =3D false, > }, { > .fourcc =3D V4L2_PIX_FMT_YVU420, > .mmal =3D MMAL_ENCODING_YV12, > .depth =3D 12, > .mmal_component =3D COMP_CAMERA, > .ybbp =3D 1, > - .remove_padding =3D 1, > + .remove_padding =3D true, > }, { > .fourcc =3D V4L2_PIX_FMT_NV21, > .mmal =3D MMAL_ENCODING_NV21, > .depth =3D 12, > .mmal_component =3D COMP_CAMERA, > .ybbp =3D 1, > - .remove_padding =3D 1, > + .remove_padding =3D true, > }, { > .fourcc =3D V4L2_PIX_FMT_BGR32, > .mmal =3D MMAL_ENCODING_BGRA, > .depth =3D 32, > .mmal_component =3D COMP_CAMERA, > .ybbp =3D 4, > - .remove_padding =3D 0, > + .remove_padding =3D false, > }, > }; > =20 > @@ -1147,7 +1147,7 @@ static int mmal_setup_components(struct bcm2835_mma= l_dev *dev, > struct vchiq_mmal_port *port =3D NULL, *camera_port =3D NULL; > struct vchiq_mmal_component *encode_component =3D NULL; > struct mmal_fmt *mfmt =3D get_format(f); > - u32 remove_padding; > + bool remove_padding; > =20 > if (!mfmt) > return -EINVAL; > --=20 > 2.38.1 >