From patchwork Thu Nov 17 16:00:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 21755 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp481424wrr; Thu, 17 Nov 2022 08:04:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf5R+gs9vBJ31hvC7nLLaT+5nGGNtyi1NuNGUd5NYM10axlqgpnjFenK2uKgdYgB9goeAnvK X-Received: by 2002:a63:ed4b:0:b0:477:786:b22b with SMTP id m11-20020a63ed4b000000b004770786b22bmr2454679pgk.195.1668701075975; Thu, 17 Nov 2022 08:04:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668701075; cv=none; d=google.com; s=arc-20160816; b=UOQWVQrOkEri/waUgh41WugB4k96v6GZ1gvbPriJuGQ183f5VRZFyKZWo1wvj7uuEZ 3RfJC2ZtdITUU/0hxHxT9k4RYKoX3WlqN8tgb8zQ5UvIroGvdg8RDPwUpmHx5kJfVFeF r/vM7NlJ0xaV+v1JKoIJ9XaeCdzuZmjOKXPpCx4+Q/AH8OJ3w07ePSKmBIfDxFpdI/v0 rXdtUu1eCgO05116KFTIErkKN+ZKzS0n/Xym14TvCNzCge3JEmr4vuMq40KOTnvsyPLo vUXS19cM9kX3OIaYUT3np+hFGiL2Tx2G5hwptwWuhD+JFToXcT07sUdVk+yT5vy6Rw9r fsXQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jb1-20020a170903258100b00186b280a430si1198390plb.242.2022.11.17.08.03.54; Thu, 17 Nov 2022 08:04:35 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749759899008395658?= X-GMAIL-MSGID: =?utf-8?q?1749759899008395658?= 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;