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 8CBBAC4332F for ; Fri, 18 Nov 2022 10:22:18 +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=nSD6fDvX03ZVholTkALrup39rgcTT2KNyX0S3yrqsMM=; b=QJ1i0INM8u20CJ KcGr2JkBASo9jzIodYZWx563xlTWSy41vwcx1HXuDK4tH/TvYP139cHPohlOzTR396nVz9dnfR7ps GXDTJNq7WNK9gs0zrPsgOyOw+1juIzI/grQWYybpGerqEuMfv8QPMyc/wEaFgLIj0sz7sNOpvkiYo VGCgYygL5UTK27fZ/ElEz79bDlWX9vqqRoNmp3JYAgzD9p3xXqr/rDXOJwPellxawD5qR+xUULXu/ 4j5Mw4M7DmPFLbTAlX+ZJB+IZEFl0k/pDeP12dINs4lHQax7GHs64YrUy0vvoGjlnnNDuH8pKn4+T lNMJl9HKLUeJPwBVGVPA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ovyUm-003MQ3-GR; Fri, 18 Nov 2022 10:21:16 +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 1ovyUh-003MOd-O1; Fri, 18 Nov 2022 10:21:14 +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 86C67AF4; Fri, 18 Nov 2022 11:21:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1668766867; bh=JKnBzxfXovb0tLwxFVvmmGsWChmiTr5mJEqcRlUT6eI=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=ScjWB42MLc45TmwtfQqFJVNud+HcPVvcdEAjezOrjWDpfyKGrnoRu5UumiY+tpgE6 eGmElSQx6zhNDyYA3jUgr7NQYNXSutz87Ov7uX5EjuI76+bYpWSYoNAssndlX7/xPL Ryn7sb0sPBgFqDgYJmVSa4ZRTKOVGtR25LR5IIAY= MIME-Version: 1.0 In-Reply-To: <20221118084244.199909-2-umang.jain@ideasonboard.com> References: <20221118084244.199909-1-umang.jain@ideasonboard.com> <20221118084244.199909-2-umang.jain@ideasonboard.com> Subject: Re: [PATCH v2 1/3] Revert "staging: mmal-vchiq: Avoid use of bool in structures" 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:21:04 +0000 Message-ID: <166876686476.50677.13666680068580068271@Monstersaurus> User-Agent: alot/0.10 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221118_022111_947934_5B1E5FBE X-CRM114-Status: GOOD ( 20.23 ) 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:42) > 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 Thanks, That's a more direct revert of 640e77466e69 ("staging: mmal-vchiq: Avoid use of bool in structures") indeed. I see Stefan was concerned about clarifying that this won't affect firmware or userspace, it may still be good to hear from Dave to confirm, but my understanding of 640e77466e69, means I believe this is safe. I don't expect this structure to be used as any kind of ABI to firmware or userspace. Reviewed-by: Kieran Bingham > --- > .../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 */ > -- > 2.38.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel