Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1021105rwb; Fri, 18 Nov 2022 11:27:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf6gcMSpO6aXRAfVw8zRL+kiD/7hBpXJPyvbsZbAQvTkdnjfZWxEhdHqvGbPqadcPc9AaVSe X-Received: by 2002:a05:6402:189:b0:469:85d:2663 with SMTP id r9-20020a056402018900b00469085d2663mr4093365edv.56.1668799670429; Fri, 18 Nov 2022 11:27:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668799670; cv=none; d=google.com; s=arc-20160816; b=OH/9LjJRN7D7L0/efCF4TCv0ZsJBak+ftfdKpHCK13dck/swYB6SxBj1zMFKvlxvxW RE/582a5CdpFPrY/PBSP52N3Se+T8qA6GFc2E7rKxkw9unaQHDOPCBfkFjYxeSn9qg8b udME1NY2g75s+WBpQDSMZzaahh2bSBLk+1mHlBAAooL5iCvL5ZusH24XI2tpQjocGJVt 44AUnEMOOtuZ4RC8thgjjnTwztIFTzw3tUzbpEAykGGPla8YmFf6kVs22XDeatfUp8SC 009E/dMzJHP1s3KG2wSnnyLZjqhvtYzoZi8V0J28NDecMFkaYliH3+DHz8dUT8xtvUBF PXkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=tGlHMVAixSLQ2/vSJKtVJw1fS47SH8DBN8tgE+O+1Dw=; b=cdWEHAHPTReG80GAR0X5Ss6kakBXVeqg9H1xa6NAzYjuoY9SvBlVYhZyqY3G4PZwaC sXI5qwRy/j1gzQlc6jy2rFkS130jnbhrUA88X1MIZGRWYW5ykoi4LzkgdO2yLKFaq6HF tr/mp2wzBBbCD66oH3M5gUxYDGmLIVF+SJSB5k5zqWep7xyitHjYU2CtcNl6C2ssh46Y 1PoU4P2Jxt3wHyVGiepADse1AeWMZaz3vyK93wnLW4mq0sJHAqzzvZu16Us9XtUuNvge 2Ukj65B+UiIsrqF4qRuUsFnpu4m/LTyrdacF7LZZY86R3z68CQvep9mD/Le6fuya8LVt q4ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@raspberrypi.com header.s=google header.b=OjlT+FkV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=raspberrypi.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z18-20020a05640235d200b0046762f4cc79si4174605edc.137.2022.11.18.11.27.28; Fri, 18 Nov 2022 11:27:50 -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 header.i=@raspberrypi.com header.s=google header.b=OjlT+FkV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=raspberrypi.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240866AbiKRRWd (ORCPT + 90 others); Fri, 18 Nov 2022 12:22:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234973AbiKRRWa (ORCPT ); Fri, 18 Nov 2022 12:22:30 -0500 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D9842F03B for ; Fri, 18 Nov 2022 09:22:29 -0800 (PST) Received: by mail-ej1-x62b.google.com with SMTP id kt23so14628359ejc.7 for ; Fri, 18 Nov 2022 09:22:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=tGlHMVAixSLQ2/vSJKtVJw1fS47SH8DBN8tgE+O+1Dw=; b=OjlT+FkV3ubQznoPIsACkVupwz5M/BwNXgn9nTXGpJQCMt858j95Bbt5uaocOT6zFt 18FjSBC/7LGXjKqU37PeyaBP9NipzTpWgsr41BiQfe9ZyGXXRyBSHqgyYsSt1UU+7aWg HqR+3cay+O13G9V+9VbC+9DNlTn3vMb90kT+QHVobVy2PLUjD17zi5uyZdNGFMP48Y9B qMTqGh9BPsEmeWB3pG+MoVMwFq4wK7M6gTbpU7CKznn87Lnta2WnpAL4A0/8UdnZ+u2T ooxthkH0fMlCsUozhubGVi1WCF9tF6z6+T+sAZ572CXMThA0V70d2P7JerZNUPCHFf0T r0NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tGlHMVAixSLQ2/vSJKtVJw1fS47SH8DBN8tgE+O+1Dw=; b=Caft3MFLOkFfXSmPNArfOwye4Z9ZyEL1H2DnTNyl+A7YHoSWkn+KWGwWpjNdm84Ycf WFgqrYOHv8vRaX/INHz+a3xAxcBE5wRq4YD6aNq21xxk9hkWpcBecjl8wmCXMTWdpJzC kubJ6VpkGQPEFJxHKe49FxyfZLaQvmboDWf/lthZ6GjAqsPZT3ZvTsq63/oXPV2lOScc vfXkQPwcRrie7XjXz81vSUcUyODUFuPGbkLeHb1zyg8MYboi13tilSMm35P+JtcVOwPt aWQ0EtazWBozAqPYpG8ofQSKONhTcopLhOwNGuRduGeEkgT/sdgTO2PZSSntPCjgFHlN 3/5Q== X-Gm-Message-State: ANoB5pm/oNUBr3G7UfyPXOAuKL/Who49vpn1y9iv9k7PEZUXbL0HTbfw 4eScCrYIimt0LVXIl6LiAp8vTMJJycIaS6OEhfoK5g== X-Received: by 2002:a17:906:9246:b0:7af:da0:aebe with SMTP id c6-20020a170906924600b007af0da0aebemr6761187ejx.723.1668792147755; Fri, 18 Nov 2022 09:22:27 -0800 (PST) MIME-Version: 1.0 References: <20221118084244.199909-1-umang.jain@ideasonboard.com> <20221118084244.199909-3-umang.jain@ideasonboard.com> <166876741790.50677.17305359640652054680@Monstersaurus> In-Reply-To: <166876741790.50677.17305359640652054680@Monstersaurus> From: Dave Stevenson Date: Fri, 18 Nov 2022 17:22:12 +0000 Message-ID: Subject: Re: [PATCH v2 2/3] vc04_services: mmal-vchiq: Use bool for vchiq_mmal_component.in_use To: Kieran Bingham Cc: Broadcom internal kernel review list , Dan Carpenter , 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,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 Hi Umang & Kieran On Fri, 18 Nov 2022 at 10:30, Kieran Bingham wrote: > > Quoting Umang Jain (2022-11-18 08:42:43) > > 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. > > This only talks about 7967656ffbfa as I can interpret it. A sentence > here describing what we're going to do about it in /this/ patch would be > clearer as a second paragraph: > > """ > Convert the remaining bit-field storage for 'in-use' to a bool and use > it accordingly. > """ > > But that's trivial and not worth a v3 specifically. (unless anyone > applying this wants to add it). Totally agree. > Reviewed-by: Kieran Bingham Reviewed-by: Dave Stevenson > > > > 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 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 */ > > -- > > 2.38.1 > >