From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 06A13C433FE for ; Fri, 18 Nov 2022 10:51:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Message-ID:Date:To:Cc:From:Subject: References:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VIsc/8UhZr+l1biaHIMNPjizbGcv3H/Ux2vkrHbA/tU=; b=CBHCHSo3pOwVZb YqVPiX8V1bOB3s9jyy9fD4VI4Lwm+5dTU8CMPhU84A7qG/wlSwONG2Yx5DQ4u0CR0RQzipFESISXT QYxUqGUpYDcKd2HZteCTIcdLzLlfRVPd+oZzMgpDTLjxzkbAQaor6OaX6iXJ0WOFVND0AH0w+6XrX PTRn5DDDUEVyPmsu6iFIe3KObH3/NRivwCe6bzED/YLL8cIOIIOKveXd8bWm10GqWnE/zMP0Z5WXp k3/0b22RNtWldGd0HQTvQWJndlKvE+Yd1PGHIg20y87AhHpbCWGPly8OozipsNSPO1RCXx/VHlS/y xe+gHoIhR0LPATOd6VvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ovyx4-003U7q-Ji; Fri, 18 Nov 2022 10:50:30 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ovyx1-003U6u-Ct; Fri, 18 Nov 2022 10:50:28 +0000 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= MIME-Version: 1.0 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221118_025027_613084_EB562145 X-CRM114-Status: GOOD ( 13.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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(-) > > 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[] = { > .depth = 12, > .mmal_component = COMP_CAMERA, > .ybbp = 1, > - .remove_padding = 1, > + .remove_padding = true, > }, { > .fourcc = V4L2_PIX_FMT_YUYV, > .mmal = MMAL_ENCODING_YUYV, > .depth = 16, > .mmal_component = COMP_CAMERA, > .ybbp = 2, > - .remove_padding = 0, > + .remove_padding = false, > }, { > .fourcc = V4L2_PIX_FMT_RGB24, > .mmal = MMAL_ENCODING_RGB24, > .depth = 24, > .mmal_component = COMP_CAMERA, > .ybbp = 3, > - .remove_padding = 0, > + .remove_padding = false, > }, { > .fourcc = V4L2_PIX_FMT_JPEG, > .flags = V4L2_FMT_FLAG_COMPRESSED, > @@ -109,7 +109,7 @@ static struct mmal_fmt formats[] = { > .depth = 8, > .mmal_component = COMP_IMAGE_ENCODE, > .ybbp = 0, > - .remove_padding = 0, > + .remove_padding = false, > }, { > .fourcc = V4L2_PIX_FMT_H264, > .flags = V4L2_FMT_FLAG_COMPRESSED, > @@ -117,7 +117,7 @@ static struct mmal_fmt formats[] = { > .depth = 8, > .mmal_component = COMP_VIDEO_ENCODE, > .ybbp = 0, > - .remove_padding = 0, > + .remove_padding = false, > }, { > .fourcc = V4L2_PIX_FMT_MJPEG, > .flags = V4L2_FMT_FLAG_COMPRESSED, > @@ -125,63 +125,63 @@ static struct mmal_fmt formats[] = { > .depth = 8, > .mmal_component = COMP_VIDEO_ENCODE, > .ybbp = 0, > - .remove_padding = 0, > + .remove_padding = false, > }, { > .fourcc = V4L2_PIX_FMT_YVYU, > .mmal = MMAL_ENCODING_YVYU, > .depth = 16, > .mmal_component = COMP_CAMERA, > .ybbp = 2, > - .remove_padding = 0, > + .remove_padding = false, > }, { > .fourcc = V4L2_PIX_FMT_VYUY, > .mmal = MMAL_ENCODING_VYUY, > .depth = 16, > .mmal_component = COMP_CAMERA, > .ybbp = 2, > - .remove_padding = 0, > + .remove_padding = false, > }, { > .fourcc = V4L2_PIX_FMT_UYVY, > .mmal = MMAL_ENCODING_UYVY, > .depth = 16, > .mmal_component = COMP_CAMERA, > .ybbp = 2, > - .remove_padding = 0, > + .remove_padding = false, > }, { > .fourcc = V4L2_PIX_FMT_NV12, > .mmal = MMAL_ENCODING_NV12, > .depth = 12, > .mmal_component = COMP_CAMERA, > .ybbp = 1, > - .remove_padding = 1, > + .remove_padding = true, > }, { > .fourcc = V4L2_PIX_FMT_BGR24, > .mmal = MMAL_ENCODING_BGR24, > .depth = 24, > .mmal_component = COMP_CAMERA, > .ybbp = 3, > - .remove_padding = 0, > + .remove_padding = false, > }, { > .fourcc = V4L2_PIX_FMT_YVU420, > .mmal = MMAL_ENCODING_YV12, > .depth = 12, > .mmal_component = COMP_CAMERA, > .ybbp = 1, > - .remove_padding = 1, > + .remove_padding = true, > }, { > .fourcc = V4L2_PIX_FMT_NV21, > .mmal = MMAL_ENCODING_NV21, > .depth = 12, > .mmal_component = COMP_CAMERA, > .ybbp = 1, > - .remove_padding = 1, > + .remove_padding = true, > }, { > .fourcc = V4L2_PIX_FMT_BGR32, > .mmal = MMAL_ENCODING_BGRA, > .depth = 32, > .mmal_component = COMP_CAMERA, > .ybbp = 4, > - .remove_padding = 0, > + .remove_padding = false, > }, > }; > > @@ -1147,7 +1147,7 @@ static int mmal_setup_components(struct bcm2835_mmal_dev *dev, > struct vchiq_mmal_port *port = NULL, *camera_port = NULL; > struct vchiq_mmal_component *encode_component = NULL; > struct mmal_fmt *mfmt = get_format(f); > - u32 remove_padding; > + bool remove_padding; > > if (!mfmt) > return -EINVAL; > -- > 2.38.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel