From patchwork Fri Nov 18 08:42:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 22199 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp70263wrr; Fri, 18 Nov 2022 00:47:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf5gleAViDFHHAMnntSE4RkRYu5Oy7IrtJBKaNUr5VyJufb1ymsu+V7QqNYoSXYenCojlen4 X-Received: by 2002:a17:902:76c9:b0:188:ec14:e3a3 with SMTP id j9-20020a17090276c900b00188ec14e3a3mr6514877plt.154.1668761237623; Fri, 18 Nov 2022 00:47:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668761237; cv=none; d=google.com; s=arc-20160816; b=iHtr8YnyuR/8CrkT1rKntRvsY1uETX4l0z7S+VHPc4YhPDNsaJnTLw4XhXzOTzoDHJ 4KVR9qmFdK9OJVY4Bw5QXp5+6k/X0HG6JoaXVJUmxjdJyivFvytdEhYUYZ1O8e8dIxNS 8kgbUgX9qunFoOded98Gqnp5I0Dabqh/qb/uUKi+QKEwj0EuJX5k1R7Aq8gReJXtYuQd plMcy5BfAwBKgCL9pFwhb0C1BjKPIhaG2KIuyvJBZof/IiaRCiRMcxHsp4XccDbVsYJH oVz1OsomutaL+IIIbU7jKX3wtH9e0eQgF1U/P8Prb3AGkwA9iXnBCiXo8IbCwxZRpVdQ AfEw== 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=nf46BIXXdlzbWawqhN+2txVG5TK3ubh7JMpQSZiF53M=; b=IiVRBddPk8huUzOGdnvu7Nvawv0WHED5/871DgMI0Cg5MODybR1QJAqpy5a60iCZFS CLjg3NjuC74GVH1vOz07PuuE/Fb8VL47aKeKAPuqa96l1baFugrtq0obvUU4fgOze0fO rOxIqDiheagq9l3V/+ljhvkWQo6E1H5H5zY7rS3jkiqHX8PhXzVgCZsZm5JTtcpt4oOo AHeFZoqN8kJWelQREGZ/jLQqn+CEr+zId6ttic/STsJSRUT6AiotQsOM4UXLARdVt7ig iRIwgesciwkvjM09UMr9Tv/WwmSV1R0JCXP/tnmnLqFXxrxishxMp9Ni7B2WNa06Z3UW yxZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=DHpanySh; 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 h64-20020a638343000000b004770fe93635si2971493pge.36.2022.11.18.00.47.04; Fri, 18 Nov 2022 00:47:17 -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=DHpanySh; 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 S241364AbiKRInJ (ORCPT + 99 others); Fri, 18 Nov 2022 03:43:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241132AbiKRInE (ORCPT ); Fri, 18 Nov 2022 03:43:04 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72F7BE0F7 for ; Fri, 18 Nov 2022 00:43:02 -0800 (PST) Received: from ideasonboard.com (unknown [103.251.226.79]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 296CACCA; Fri, 18 Nov 2022 09:42:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1668760981; bh=iQ68jUqBgEQAwQC2wOa1YQTubJd9hMRa/Dl1/9xvBPs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DHpanySh5ExNVFhh5w2sahewHz+aHB5bWT76gVavMrbh2ANZW6V7tJn0DsdvcNEdZ QdFIyN4ofwz2N1NjWAOIleTonFE3rVblXo3AXexUbXoDbxaEkXR9y1LRVPqb1eFaML omm3fI/MXYxxsVUw3IbY4OhOHtGfRU0tkM0KfWrg= 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 v2 1/3] Revert "staging: mmal-vchiq: Avoid use of bool in structures" Date: Fri, 18 Nov 2022 14:12:42 +0530 Message-Id: <20221118084244.199909-2-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118084244.199909-1-umang.jain@ideasonboard.com> References: <20221118084244.199909-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?1749822983396647767?= X-GMAIL-MSGID: =?utf-8?q?1749822983396647767?= 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 Reviewed-by: Kieran Bingham Reviewed-by: Dave Stevenson --- .../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..6d984cf5a83a 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; 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; u32 handle; /* VideoCore handle for component */ u32 inputs; /* Number of input ports */ u32 outputs; /* Number of output ports */ From patchwork Fri Nov 18 08:42:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 22196 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp70021wrr; Fri, 18 Nov 2022 00:46:22 -0800 (PST) X-Google-Smtp-Source: AA0mqf7gmecsYlkP/wV9NZMbYdxgumqbEtMInN3yEGk9zq2V2SlNTr1J8HkG39yKtb8eWtQNU5hw X-Received: by 2002:a17:902:7e48:b0:187:3c62:582c with SMTP id a8-20020a1709027e4800b001873c62582cmr6545851pln.114.1668761181910; Fri, 18 Nov 2022 00:46:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668761181; cv=none; d=google.com; s=arc-20160816; b=EpvaFZagmMmA4FBzW+2b77qHNbZ3U307FIIKkf+wcDmZAinFfv3n/wrNCSBjlBeHVo pXQOMG7cOnBZJPWVTFro/IQzYEjn0wDLjQAW1yjDDLYyryVh4s0YbY6SQvGmmpxq+9xW bWUdaKu6CzTciRWGEFXdxcEWvXqKD1dTuOM138vH/0DcA1kyyAlyoiYjk+woiDrGt1qf BjM8IAiD+NiusEbHG3nRXGffPV/f4epYp8fgFxXtGdXT60yWxFEfxbt94btIOcpwZ0VI sZfa69Auap8lFGD0z8kLzwdTjoPIwvX6ReUdIouo0Kx+uT3CqI+ugkz/jDRLVc6lU0V/ ykgA== 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=wjmTCjZ4OPQDeC/EQQ+ebYa1WoM4aB7s/Y3boN5iZpU=; b=hBz2bRurvxaqIOXBIafGPIMig0k8llZWi1kwC92mudiqp8vjW9Z31gDhfDnVrVGJX4 xhAd41iBy4hc1Dn8f4llU35U145mCZjfP5An2N+cqhPOj1AXeOa3TTt/m4UnWJyLgHhZ M6jWqYj8Rw6JOKqHvjgeWILZIpOFgQ/P5o5GVuzKZn+hKAxPxKmRXHRB6X2MZPmEMLd8 VEmUn3M8ZI5Mjxh3QiNcZsdjt8f7vVEGH5pDOx2ZUpOaPC/to4NVEY2tF4RyS8+kpZmQ 70l77HxXQeDaiphZMSlU73t4FQD8ZFe5YtW1PbhRME/aUmChtj9Malv8Tqu60z2tu24N xixA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=SvuHBB6G; 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 q16-20020a17090311d000b00186a6b63515si3708220plh.214.2022.11.18.00.46.07; Fri, 18 Nov 2022 00:46:21 -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=SvuHBB6G; 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 S241539AbiKRInY (ORCPT + 99 others); Fri, 18 Nov 2022 03:43:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241489AbiKRInK (ORCPT ); Fri, 18 Nov 2022 03:43:10 -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 77E5673404 for ; Fri, 18 Nov 2022 00:43:07 -0800 (PST) Received: from ideasonboard.com (unknown [103.251.226.79]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EBC9BCE1; Fri, 18 Nov 2022 09:43:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1668760986; bh=6Phtney9spbBUHdVRM2VGrePUW5l4G22Zp/hlcIOKcI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SvuHBB6Gb8xK4U/2WKK92L7uHV4jHTdlWpJ2AhFmEM0Dj3zfnH/eCHCOpODGSO/iD cMY9VLGjJXYs/umwSYu4nyEPfDlVoxu7inLCBG2kCn40/Fn1VpVRdt0w4Za9d7HaIa 89fIIkC5ZKp6sAdXQyw5TiWKVaz+DxV/7COIcOEM= 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 v2 2/3] vc04_services: mmal-vchiq: Use bool for vchiq_mmal_component.in_use Date: Fri, 18 Nov 2022 14:12:43 +0530 Message-Id: <20221118084244.199909-3-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118084244.199909-1-umang.jain@ideasonboard.com> References: <20221118084244.199909-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?1749822925045341110?= X-GMAIL-MSGID: =?utf-8?q?1749822925045341110?= 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 Reviewed-by: Kieran Bingham Reviewed-by: Dave Stevenson --- 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 6d984cf5a83a..09f030919d4e 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; bool enabled; u32 handle; /* VideoCore handle for component */ u32 inputs; /* Number of input ports */ From patchwork Fri Nov 18 08:42:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 22200 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp70266wrr; Fri, 18 Nov 2022 00:47:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf7ZwKClIKZiONeir8MNxJd9eB2BJ9gHKNQXkicvE2c734pfZicpT4DZQiKKE9M2amWFNHdK X-Received: by 2002:a63:2745:0:b0:475:2f42:7638 with SMTP id n66-20020a632745000000b004752f427638mr5777317pgn.439.1668761238540; Fri, 18 Nov 2022 00:47:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668761238; cv=none; d=google.com; s=arc-20160816; b=lojag2MvwjCgG3zpiCTgdtRmyQXAdfw5DfO7PMQ/iPsDTQF6skchV9BaTuptjJOnpm xOevYBxw2JOPwx5TLToLGavcChVWhScnxdfcs/RU7S6z0SIUhoKAvDqt00hPojaD48sz u0Jxnn4YYWSA3JVxtnC0vC1eVRHd+CBlYVr9+6OUt3XyMHQ7T4/Ogjw/oloI9NpmnPZa Ce1Ul2DXAWGaULXSV2J5bKOH0+PA1PRgaNFLdfSO1UoSuqxKQ91IMtRfeJmA1hNDg8FF t4Vfs8qx+xWwFcvpU4sNuIx/JtOZHmq+n2XCg/xZfRKF5OindpgOQ1dNBJ7mLh9x42EL yUfg== 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=6S1Ez7QExwUECsS20D0pJL5hAhOyW+i1RDEJyshWE3c=; b=icxHaELIZqDAxQlgHJHkQEoF9I9x4eA67QoFIsrMzOiRfFVmKgCSivAzv8TmyvZ3wq N7EIlWnumM6HbbAXF2raUKr2+gSQ+a25iMUZH3ILtZX0sh/Y1MBqUlbh3kV4sTc9qqaX 3yZWpF65oDRqkwDutdhTK3N/NGIw/0S2hzAH1Rw3J73ejLFZ7YxHi8QFus9AAbGdthyO KsOpR/f3eKL3CnccVNRJj00bewnNZGH0JFm5Fiq7KDURF3UXLKbAqEa6LI5oNrJjxTPR P3902Cka12h5G99kkWMizPuXkNRhnuNY5nRN8j8wLpCFUkpaRijzpe4Nd06ugi7Rb9Ie 0j3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=d79mtO2J; 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 c18-20020a631c52000000b004607f6b2586si3124124pgm.736.2022.11.18.00.47.06; Fri, 18 Nov 2022 00:47:18 -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=d79mtO2J; 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 S241574AbiKRIna (ORCPT + 99 others); Fri, 18 Nov 2022 03:43:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241527AbiKRInW (ORCPT ); Fri, 18 Nov 2022 03:43:22 -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 6A7938E090 for ; Fri, 18 Nov 2022 00:43:12 -0800 (PST) Received: from ideasonboard.com (unknown [103.251.226.79]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B6719AF4; Fri, 18 Nov 2022 09:43:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1668760991; bh=lVDUJHWVeAyJX4GtZijiGPXUXmMu80hKu+K2BJug9Dg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d79mtO2JYKFu4+5g6P1Cw8PN1KSFyN4AbS1LHvzLnDZ8Ezir5nK8rUbbqXC+2W7X5 kMrseAbR8vQfD+9vD8WgOA0IL1lXxXBBBLInwGgYHkmBoDA3AS5hdaSZ/dsDazoVqJ GEGbT7zSTiWMhAEO4gLVAx5lY7aEJtKU0R2PDd08= 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 v2 3/3] vc04_services: bcm2835-camera: Use bool values for mmal_fmt.remove_padding Date: Fri, 18 Nov 2022 14:12:44 +0530 Message-Id: <20221118084244.199909-4-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118084244.199909-1-umang.jain@ideasonboard.com> References: <20221118084244.199909-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?1749822984666514859?= X-GMAIL-MSGID: =?utf-8?q?1749822984666514859?= 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 Reviewed-by: Kieran Bingham Reviewed-by: Dave Stevenson --- .../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;