Message ID | 20221117125953.88441-2-umang.jain@ideasonboard.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp387292wrr; Thu, 17 Nov 2022 05:05:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf4RJZqERYRqvRO96+T11FPOfR/EhGsezJ+JVC8VhZYdqdGfOBfiP7lHr4s0cY8Mshd9JYbd X-Received: by 2002:a17:906:6153:b0:7ad:b51d:39d0 with SMTP id p19-20020a170906615300b007adb51d39d0mr1949588ejl.571.1668690340663; Thu, 17 Nov 2022 05:05:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668690340; cv=none; d=google.com; s=arc-20160816; b=ThwIlL3fAG+DGoPCALsYBqTQKpIVNyPcDSXLzbzVPN6MK+UgyiD5p0GYfvs5EwAVei Cz8Ly7Ave9KXxANwbmgdwdeYWw9p3Eb0a7oUMTrE2Q8YUNvFg6+9mJTzN4a487N5Ly1+ VbfI4QCxNvWuDqFram1KVoqyetoOgJq3cfcKZeYkSXcsmDQnrcOAPOzjm4KtoVpKC6rh 53qvHwyDf5sVwTmKTEWkFIKe6F67kjImALzM1AExl44wxgnYflQUpa2s4ykedaFQazXW 38TYrcy5vQyduitNA3y7XNHdRBDQZ19KVtAaOxucs1cTfHEIHjwBUlzfUW/FOVNsoWh5 1vEQ== 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=Eb+B8frGuobVTp2uKAV2WvAIWS83WPR5wFN84Wnz+54=; b=lxWhXG5SwD59D+Xt+b97OySe2a+zVn8OmxH0QhcETTi6dyWKD640dpS+EyzSKf3qW3 rB9n7wus30EP3uBCeoOzr7Bf5YGmxZIC8V3zoMU6n/VOeiZFyXu9w7DgSB0LD/E6mv9m dZlNv12Bv3TiH0hB9kSB3sv2NOxU/wRzFLe3jSpRGhHW4m5ujCKICTZSA1zvb/Xpvf8M sEE0zEcr/Et0OZ6YXnIA+yFUh9LPqSZO+v8Mk5VdseOuiQEeNzDdyf/CXe8F3LAaB/vj iBrG+iebNeU9O08J/G8Mrl34mHdTiOQ9zOhzzOzFGOcRpe8WI24bDV10deV/pdC/pjgz 8rlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=gVaArLR5; 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 h12-20020a0564020e0c00b0046805e6392csi779274edh.474.2022.11.17.05.05.17; Thu, 17 Nov 2022 05:05:40 -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=gVaArLR5; 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 S239456AbiKQNAP (ORCPT <rfc822;a1648639935@gmail.com> + 99 others); Thu, 17 Nov 2022 08:00:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239310AbiKQNAL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 17 Nov 2022 08:00:11 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CF3D5916D for <linux-kernel@vger.kernel.org>; Thu, 17 Nov 2022 05:00:10 -0800 (PST) Received: from ideasonboard.com (unknown [103.251.226.79]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 40ED01056; Thu, 17 Nov 2022 14:00:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1668690008; bh=L3iuePaXU3I9Th2qNYgsdcfyya4frF4sh5w4xXhH/fY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gVaArLR5O9TBGGuWPC3CfM1iuFvXyUKFVxxhv+yzpg3QVEQzWVwMpGl70m0102nK1 LdEaQNAkhfeFlHjsoe9Orw56peP3CKcNLFBuoqnBLNBpTM6HiAr+ie/sFR4ewIN7oK qvJsHRQ/ptgyN6FK0dJMrDUDw6nBJqsPslpJNsWI= From: Umang Jain <umang.jain@ideasonboard.com> To: Florian Fainelli <f.fainelli@gmail.com>, Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Stefan Wahren <wahrenst@gmx.net>, Hans Verkuil <hverkuil-cisco@xs4all.nl>, Dave Stevenson <dave.stevenson@raspberrypi.com>, Mauro Carvalho Chehab <mchehab+samsung@kernel.org>, 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 <umang.jain@ideasonboard.com> Subject: [PATCH 1/2] staging: vc04_services: mmal-vchiq: Do not assign bool to u32 Date: Thu, 17 Nov 2022 18:29:52 +0530 Message-Id: <20221117125953.88441-2-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221117125953.88441-1-umang.jain@ideasonboard.com> References: <20221117125953.88441-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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749748642859497624?= X-GMAIL-MSGID: =?utf-8?q?1749748642859497624?= |
Series |
vc04_services: vchiq-mmal: Drop bool usage
|
|
Commit Message
Umang Jain
Nov. 17, 2022, 12:59 p.m. UTC
From: Dave Stevenson <dave.stevenson@raspberrypi.com> struct vchiq_mmal_component.enabled is a u32 type. Do not assign it a bool. Fixes: 640e77466e69 ("staging: mmal-vchiq: Avoid use of bool in structures") Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> --- drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Thu, Nov 17, 2022 at 06:29:52PM +0530, Umang Jain wrote: > From: Dave Stevenson <dave.stevenson@raspberrypi.com> > > struct vchiq_mmal_component.enabled is a u32 type. Do not assign > it a bool. > > Fixes: 640e77466e69 ("staging: mmal-vchiq: Avoid use of bool in structures") > Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> > --- > drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c > index cb921c94996a..17f8ceda87ca 100644 > --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c > +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c > @@ -1773,7 +1773,7 @@ int vchiq_mmal_component_enable(struct vchiq_mmal_instance *instance, > > ret = enable_component(instance, component); > if (ret == 0) > - component->enabled = true; > + component->enabled = 1; Why not make enabled a bool instead? thanks, greg k-h
Hi Greg, Thanks for the comment, On 11/17/22 6:43 PM, Greg Kroah-Hartman wrote: > On Thu, Nov 17, 2022 at 06:29:52PM +0530, Umang Jain wrote: >> From: Dave Stevenson <dave.stevenson@raspberrypi.com> >> >> struct vchiq_mmal_component.enabled is a u32 type. Do not assign >> it a bool. >> >> Fixes: 640e77466e69 ("staging: mmal-vchiq: Avoid use of bool in structures") >> Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> >> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> >> --- >> drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c >> index cb921c94996a..17f8ceda87ca 100644 >> --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c >> +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c >> @@ -1773,7 +1773,7 @@ int vchiq_mmal_component_enable(struct vchiq_mmal_instance *instance, >> >> ret = enable_component(instance, component); >> if (ret == 0) >> - component->enabled = true; >> + component->enabled = 1; > Why not make enabled a bool instead? Makes sense. It would probably require reverting the 640e77466e69 ("staging: mmal-vchiq: Avoid use of bool in structures") I'll also find other occurances in vchiq-mmal (if any). Also for other reviewers, I found the context at: 7967656ffbfa ("coding-style: Clarify the expectations around bool") Thanks, uajain > > thanks, > > greg k-h
On Thu, Nov 17, 2022 at 06:29:52PM +0530, Umang Jain wrote: > From: Dave Stevenson <dave.stevenson@raspberrypi.com> > > struct vchiq_mmal_component.enabled is a u32 type. Do not assign > it a bool. It's not a u32 type so this is wrong. u32 enabled:1; But also "true" is better than "1" in terms of a human reading the code. Perhaps this is from a static checker? I am also the author of a checker tool so I know how stupid they can be. When the checker says something dumb, then the correct response is to be be briefly amused and not to slavishly obey it. regards, dan
On Thu, Nov 17, 2022 at 06:57:07PM +0530, Umang Jain wrote: > Hi Greg, > > Thanks for the comment, > > On 11/17/22 6:43 PM, Greg Kroah-Hartman wrote: > > On Thu, Nov 17, 2022 at 06:29:52PM +0530, Umang Jain wrote: > > > From: Dave Stevenson <dave.stevenson@raspberrypi.com> > > > > > > struct vchiq_mmal_component.enabled is a u32 type. Do not assign > > > it a bool. > > > > > > Fixes: 640e77466e69 ("staging: mmal-vchiq: Avoid use of bool in structures") > > > Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> > > > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> > > > --- > > > drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c > > > index cb921c94996a..17f8ceda87ca 100644 > > > --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c > > > +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c > > > @@ -1773,7 +1773,7 @@ int vchiq_mmal_component_enable(struct vchiq_mmal_instance *instance, > > > ret = enable_component(instance, component); > > > if (ret == 0) > > > - component->enabled = true; > > > + component->enabled = 1; > > Why not make enabled a bool instead? > > Makes sense. It would probably require reverting the 640e77466e69 ("staging: > mmal-vchiq: Avoid use of bool in structures") > Reverting that patch seems like a good idea. regards, dan carpenter
diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c index cb921c94996a..17f8ceda87ca 100644 --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c @@ -1773,7 +1773,7 @@ int vchiq_mmal_component_enable(struct vchiq_mmal_instance *instance, ret = enable_component(instance, component); if (ret == 0) - component->enabled = true; + component->enabled = 1; mutex_unlock(&instance->vchiq_mutex);