From patchwork Thu Nov 17 16:00:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 21754 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp481109wrr; Thu, 17 Nov 2022 08:04:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf6zx42Trw1wDugct+niVAmzkkXAuRIg/gtsWdcW+CToL9OQkiBjVtXcIOF3oN4U0LCIin8c X-Received: by 2002:a63:1514:0:b0:46e:a4ed:467e with SMTP id v20-20020a631514000000b0046ea4ed467emr2652169pgl.319.1668701049848; Thu, 17 Nov 2022 08:04:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668701049; cv=none; d=google.com; s=arc-20160816; b=yu3148qtX90I/i/BSHYGmIiupHK0BTwxJN7CJLBVCX0uFJKZtuwG+HMrGCwfB+XoTp x9ukpj6r3p7bYpGrzudJVNdl3Ml4cwtiMgpY+rMs/yw6vfDpSRuz6bJLKDlZ7o8N13Ym NkGp5fyGDFfi90EKKfBH+OFSJJZ5fISGAjvL0OTEKM1oaFJyIXCdxDv/53W7vNAWB2Se aS00ta8JWYOoyALNjjcqWomRwezWG4b9koS1f1qyP0EEYMQmo0FyF13ZTSlgv840E6GH 3zEIoGtL+e1ivrPwpuk7esDTQuIwxwfqYYSBy4zhv8nI3n+siwINpc68oK8yGnBrf6s0 8oFQ== 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=owP8SA5SXgpZA7D6UvtncSnuoCQ9uC98ziNMvLLdOes=; b=BKZnnXBvTQ3+iQOVna3Bn+0lgi7+Jrgki7dmUoEFdz4VRGOTzF+GtBiEyV+EQUtYUw b7U8gczOaJ/S4hUjHVKueyTTcBg947Nfu52llE8/Ga2JHvtgSz2Lg1Vha96isxcKRHny gbb99Sa5H3uOzzxQ0ECkYYr4NDyNekociZ4GDsHNdvCHDzbtKpQfK2soO+5E9gBUtmO4 nF7wopdDyWX0BVMAU83mBCmdPwPetoGCBNrhkXo/Ce5cai78MlED4EzsIdvDj2jeu+dc i8I359ohbpNfRcsogEzrgySBdABRdmik5XlpuedwQX2wiezJYDMMU4VHhSdV22GwSTmm v75g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=SSTy3Pdl; 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 a38-20020a056a001d2600b0053e8d0c9909si1219805pfx.221.2022.11.17.08.03.29; Thu, 17 Nov 2022 08:04:09 -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=SSTy3Pdl; 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 S239893AbiKQQAj (ORCPT + 99 others); Thu, 17 Nov 2022 11:00:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233179AbiKQQAe (ORCPT ); Thu, 17 Nov 2022 11:00:34 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E47E92D7 for ; Thu, 17 Nov 2022 08:00:33 -0800 (PST) Received: from ideasonboard.com (unknown [103.251.226.79]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C16BA1056; Thu, 17 Nov 2022 17:00:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1668700832; bh=n9ynhpvE53d3DCniGxgFDJ475k0hql5R70rDpcyDJxA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SSTy3PdldKbcq8IWLceXcm5WjdtdV/nOZ5QfeVQQorJiFWqjP8MVE7WyllL+DJNmP wE4UfHnKnB++iPrcSLCj3bDW1G3DtHVqj1iDB/lrM7CC12u14gI6bzk8cb/8O8C2t5 fI/YHGqVNM5uxbcnVxKRxwjjkqoK9t4t0ToCE8yE= 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 1/3] Revert "staging: mmal-vchiq: Avoid use of bool in structures" Date: Thu, 17 Nov 2022 21:30:13 +0530 Message-Id: <20221117160015.344528-2-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?1749759871929493436?= X-GMAIL-MSGID: =?utf-8?q?1749759871929493436?= This reverts commit 640e77466e69d9c28de227bc76881f5501f532ca. In commit 7967656ffbfa ("coding-style: Clarify the expectations around bool") the check to dis-allow bool structure members was removed from checkpatch.pl. It promotes bool structure members to store boolean values. This enhances code readability. Signed-off-by: Umang Jain --- .../staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 12 ++++++------ .../staging/vc04_services/vchiq-mmal/mmal-vchiq.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c index cb921c94996a..4abb6178cb9f 100644 --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c @@ -863,9 +863,9 @@ static int port_info_get(struct vchiq_mmal_instance *instance, goto release_msg; if (rmsg->u.port_info_get_reply.port.is_enabled == 0) - port->enabled = 0; + port->enabled = false; else - port->enabled = 1; + port->enabled = true; /* copy the values out of the message */ port->handle = rmsg->u.port_info_get_reply.port_handle; @@ -1304,7 +1304,7 @@ static int port_disable(struct vchiq_mmal_instance *instance, if (!port->enabled) return 0; - port->enabled = 0; + port->enabled = false; ret = port_action_port(instance, port, MMAL_MSG_PORT_ACTION_TYPE_DISABLE); @@ -1359,7 +1359,7 @@ static int port_enable(struct vchiq_mmal_instance *instance, if (ret) goto done; - port->enabled = 1; + port->enabled = true; if (port->buffer_cb) { /* send buffer headers to videocore */ @@ -1531,7 +1531,7 @@ int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance, pr_err("failed disconnecting src port\n"); goto release_unlock; } - src->connected->enabled = 0; + src->connected->enabled = false; src->connected = NULL; } @@ -1799,7 +1799,7 @@ int vchiq_mmal_component_disable(struct vchiq_mmal_instance *instance, ret = disable_component(instance, component); if (ret == 0) - component->enabled = 0; + component->enabled = false; mutex_unlock(&instance->vchiq_mutex); diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h index 6006e29232b3..70eda6cac1c6 100644 --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h @@ -48,7 +48,7 @@ typedef void (*vchiq_mmal_buffer_cb)( int status, struct mmal_buffer *buffer); struct vchiq_mmal_port { - u32 enabled:1; + bool enabled:1; u32 handle; u32 type; /* port type, cached to use on port info set */ u32 index; /* port index, cached to use on port info set */ @@ -83,7 +83,7 @@ struct vchiq_mmal_port { struct vchiq_mmal_component { u32 in_use:1; - u32 enabled:1; + bool enabled:1; u32 handle; /* VideoCore handle for component */ u32 inputs; /* Number of input ports */ u32 outputs; /* Number of output ports */ From patchwork Thu Nov 17 16:00:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 21753 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp481110wrr; Thu, 17 Nov 2022 08:04:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Vpxgo93ah8ONVwbZSGAH3JUgD2mvjJusvzXSLVnWeKpsUPNbgoU+EU2/jH/3vTdzXh7zC X-Received: by 2002:a17:902:edd0:b0:188:bd82:861a with SMTP id q16-20020a170902edd000b00188bd82861amr3353182plk.56.1668701049919; Thu, 17 Nov 2022 08:04:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668701049; cv=none; d=google.com; s=arc-20160816; b=Gi1DdCsBVoZaz360dbFmbEJ8+qp8azwUPL5IofWemV25GdOPEtFebu8rSdPyp8Sw87 AbyeGUfCielc4h2I9IWF0Iqj8iU//2SsKXX7f1ywbqoeGx0XLqZGCoo8A/jDdT418Nrg Nv5jMmpYqIonlmzsl4i7YBIMnprjNBl+KFAf0hXQ5tc0yWHPxDbfTRBC5C1ScLA3tYAR uKAmouZOYb19fzYysVSk5YnNxTd+p3A39RUVL1WGmsCFdB/r3/AkU9WdZb5iKLA/1nSR Jo731/1MBo1mRadS0UCWuTZESVbW8Nm7qc4WncHAGW2W4lCyYQ67y/oMbdyeC88+r8QW gpQQ== 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=kUZc1S1W2J8ik4vyJXaCEjM9NVVy7up5J5fBNgoTttU=; b=jo7gyefc52hW0o74nuaqdrvKUxBMSd8wQX0U0xZM7QO34rcPn0b4FDA/RNNgrI8Zfi 9fhW22NJ9LiVfjvrl8mgWIr5cJh0G0owELSmuMJkUuA97l8wMiqA3Jh5z5YZ5zD6uX8Z zCz6x4JgondBLDbEWNJz3k7dEpK5Wf3T7t4F8XKviDVtGfUBilzBmZNP1hOYnmxMxtZz vBii98/7FKSD+ey+MHsyCyEFgWVbhgJXOHKk+G7OvnM5OKfI2zgU3pOZfZ1MPuBaEtE4 ip4/XHQ++XvdRqhdHW7gPAS2mIcq+szWuIYoHTVdvgBpKzlxENd6728vNcflxcCxeYd4 LpHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=GbhODj6i; 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 bw16-20020a056a00409000b0056e8f32463esi1107740pfb.322.2022.11.17.08.03.31; Thu, 17 Nov 2022 08:04:09 -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=GbhODj6i; 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 S240006AbiKQQAq (ORCPT + 99 others); Thu, 17 Nov 2022 11:00:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239654AbiKQQAl (ORCPT ); Thu, 17 Nov 2022 11:00:41 -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 0765913D44 for ; Thu, 17 Nov 2022 08:00:38 -0800 (PST) Received: from ideasonboard.com (unknown [103.251.226.79]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 03B7D133C; Thu, 17 Nov 2022 17:00:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1668700837; bh=JDyW2hzBjXtCPuLRQW6K0nYPrFiaE+Knjz7OMb7YeCE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GbhODj6iiGEgRSu9rTpEpm8hgEd04o/j8lstv9znuQDIJM2AvFkXQ2CTme/Xs3UDu SNdRsGlOAahqsWbNNDdRy8FiQHtm7BmLzgT/z2XrDG5b/i1kS9vFj4i08zGGKeBYG3 EnJQbychWK4/Bhx/s1njWyVuUdemz9L2kljwIOjI= 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 2/3] vc04_services: mmal-vchiq: Use bool for vchiq_mmal_component.in_use Date: Thu, 17 Nov 2022 21:30:14 +0530 Message-Id: <20221117160015.344528-3-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?1749759872237727922?= X-GMAIL-MSGID: =?utf-8?q?1749759872237727922?= In commit 7967656ffbfa ("coding-style: Clarify the expectations around bool") the check to dis-allow bool structure members was removed from checkpatch.pl. It promotes bool structure members to store boolean values. This enhances code readability. Signed-off-by: Umang Jain --- drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 6 +++--- drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c index 4abb6178cb9f..294b184d4a49 100644 --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c @@ -1648,7 +1648,7 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance, for (idx = 0; idx < VCHIQ_MMAL_MAX_COMPONENTS; idx++) { if (!instance->component[idx].in_use) { component = &instance->component[idx]; - component->in_use = 1; + component->in_use = true; break; } } @@ -1724,7 +1724,7 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance, destroy_component(instance, component); unlock: if (component) - component->in_use = 0; + component->in_use = false; mutex_unlock(&instance->vchiq_mutex); return ret; @@ -1747,7 +1747,7 @@ int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance, ret = destroy_component(instance, component); - component->in_use = 0; + component->in_use = false; mutex_unlock(&instance->vchiq_mutex); diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h index 70eda6cac1c6..c5be86b0479d 100644 --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h @@ -82,7 +82,7 @@ struct vchiq_mmal_port { }; struct vchiq_mmal_component { - u32 in_use:1; + bool in_use:1; bool enabled:1; u32 handle; /* VideoCore handle for component */ u32 inputs; /* Number of input ports */ 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;