Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2261783rwb; Thu, 17 Nov 2022 08:28:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf7WydLmwTgM/LbsX1ePOYYGe2A9/KncBNmhuIXAxrGCRjXe7HQbXcIy8aBgE+4O8+B1jvNk X-Received: by 2002:a17:90b:2552:b0:212:f8d0:a075 with SMTP id nw18-20020a17090b255200b00212f8d0a075mr3487659pjb.92.1668702531389; Thu, 17 Nov 2022 08:28:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668702531; cv=none; d=google.com; s=arc-20160816; b=tZstxRYLt7qEfNT8xvxhBHcjyiWgslPCIVDa6KLE2d9xzqstjCeVmrsBRH8+wHkaoF 97/Ts1QnN1AKc0/dQ2wYs1XB/1k2iuOwb/5wZ2otbFyxWCdK4AEhONIX0OwiDxGK/HzT xWjz+q79NQBk69HIR1r3y4AMUZXJKFiuD/QYjjqY9qYqA2oDuIWYhdW3fqlBcBLJqc4m Xm1dz+NdwchpJ95DeUAWnJnzpaXCgJqbQWhIpZUdAQaSnd4T7TqK5zWMTjBkuuUrosV1 Z748cQ5ejqRJfW2kRmx+KAv4ii91qKbCPoqdXaac7xjNpNJLqOjvqj0C7bEOF2C7Dy5X tKNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qmh6n/xHrPxB2rHh4lA9pVA1qhkTqRvFJD+LRee5oMM=; b=tK7PXxr6dNbSJNvel1Ham2PhKdPhCC6VOkpfTV72G3KEw9BLwbf7QAOwkj+DlHNKHt 88CZDsZrKqWVA8amcyJeB92m+T7PZXRa5OGMVzODvh7rN8Oup2Y9eJ7vqU66XpCOsl2y hp1y0ECnYhV+FG26e3U/eMEA4VmIHzw3Ht4cmP9821YRqwv+dp6UKqxEey5f5zIcjL3d 6P4ke3Ri309EDPnXuag+Dlsl0xck3gPKWeKQXzqfwCbwwtdUpmie9yY3Y7BXY/J9DPDo s92zPSQIg6JV9gEDnnUsmSPkBUTQc/+XYtrD7HIXGf1T4SOVcljNiBXwmiwCtkWtiM8t 4ZQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=Swk4StMf; 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 p3-20020a170902e74300b00188a7401d89si1489088plf.481.2022.11.17.08.28.38; Thu, 17 Nov 2022 08:28:51 -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=Swk4StMf; 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 S240083AbiKQQBA (ORCPT + 92 others); Thu, 17 Nov 2022 11:01:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239989AbiKQQAp (ORCPT ); Thu, 17 Nov 2022 11:00:45 -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 0DA1538A8 for ; Thu, 17 Nov 2022 08:00:43 -0800 (PST) Received: from ideasonboard.com (unknown [103.251.226.79]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CC745929; Thu, 17 Nov 2022 17:00:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1668700842; bh=1DYpqsXvXsGG5IOvxeeijtQCtN/gvWpP1KZhKnLeIbw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Swk4StMfC87C4+EHNtHps8Zsm2j+XMV36WOhsHH2IDlV0p4FtZWLFnZh30co8Uk3+ TqZolGoofnEbvlq7GVz/B1koaxITxDxKocWiklCxhMTXfbWerF19KP1SL44gEeGDOM 669rva9SqVKPAJetExlV5w9KTLO6YrdgwGxUHNzI= From: Umang Jain To: Florian Fainelli , Broadcom internal kernel review list , Ray Jui , Dan Carpenter , Greg Kroah-Hartman , Hans Verkuil , Dave Stevenson , Mauro Carvalho Chehab , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Cc: kieran.bingham@ideasonboard.com, Umang Jain Subject: [PATCH 3/3] vc04_services: bcm2835-camera: Use bool values for mmal_fmt.remove_padding Date: Thu, 17 Nov 2022 21:30:15 +0530 Message-Id: <20221117160015.344528-4-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221117160015.344528-1-umang.jain@ideasonboard.com> References: <20221117160015.344528-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 struct 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. 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