Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp565602imw; Wed, 13 Jul 2022 04:04:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1trlqlvGo4FMtnFme8oyu1m7hySe3tCgJajgic+8UySdVFqiaX9hHqqZP75CWxLeZ9pKpWa X-Received: by 2002:a05:6402:35cf:b0:43a:d139:ea2b with SMTP id z15-20020a05640235cf00b0043ad139ea2bmr3978523edc.415.1657710248524; Wed, 13 Jul 2022 04:04:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657710248; cv=none; d=google.com; s=arc-20160816; b=ci5ysWTPmSoh3yadLSz7D90ItIB6D1/byBeJySGWEvVC/atxynsuL8b8InkrcY7qV9 2GbpiC3bTo/bVK2O6cDOqCXatyq+3B0qfAIIbQbeQGWj4sS6tXrtPUGpO7ccSszSWWPI c6haR4zXCrAmMT1X8JKCjgGub1bkBQ8S68ioF/tkGywpfsXOwbPSPqWOoi8Zy5n+bZK9 rDZriK33e3DgPaEpve+ZSPM7u9uYO6E/zZZmWOFUPYz/H3VRK6xFRGmr2AZ5R/zihU98 W80IBu3mM3C1rWvlzZn5Ps/G9zzHh7GqKlTvbuPYeOedfiawMpxrcW7ugX6AbkiQLFsC 2rag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Kmqld8FKlZicv4PPSOPTJp0SGSbSjDfGby4BCIfo6hI=; b=orhhXjTKYiCFNW7hnyumA+mvYouWNyaDJh44gLZlwl9ziFaahhGjgUxrzx96bRBm/x 0UgjTGRYam2gtPpRmZHsgJvgYA1kYuwGQB+EpiTjh0/Pp3+C+PhnnFsuy/hcwgVjbXV8 myx2/bcBIss+dtV/bJ3ajCSa27qNQXjbZVMvZRgQVQfJYg/ktFkFY05vQ1pqlSAL/hCX wFgj5NsIJptvfJSAAoOnrLycUwhEp8syL0jeLK0m9qV4Szp4eT6jirXEElD7l6HA6Yum jAnriyPlfwE3/Kl60NH2KlQPCC3DDK1mzWECdIJxY9Vhm6G184CsR44Dx2bZr0hzBIy1 MLEA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fb17-20020a1709073a1100b00718bdf7794esi10593673ejc.487.2022.07.13.04.03.32; Wed, 13 Jul 2022 04:04:08 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235660AbiGMKqB (ORCPT + 99 others); Wed, 13 Jul 2022 06:46:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230147AbiGMKqA (ORCPT ); Wed, 13 Jul 2022 06:46:00 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6A1EDF9907; Wed, 13 Jul 2022 03:45:59 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 871DD1424; Wed, 13 Jul 2022 03:45:59 -0700 (PDT) Received: from e120937-lin (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4D6013F792; Wed, 13 Jul 2022 03:45:58 -0700 (PDT) Date: Wed, 13 Jul 2022 11:45:52 +0100 From: Cristian Marussi To: Christophe JAILLET Cc: Sudeep Holla , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] firmware: arm_scmi: Use the bitmap API to allocate bitmaps Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 On Fri, Jul 08, 2022 at 09:30:01PM +0200, Christophe JAILLET wrote: > Use devm_bitmap_zalloc() instead of hand-writing them. > > It is less verbose and it improves the semantic. > > Signed-off-by: Christophe JAILLET > --- > drivers/firmware/arm_scmi/driver.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c > index 609ebedee9cb..b1265732d83a 100644 > --- a/drivers/firmware/arm_scmi/driver.c > +++ b/drivers/firmware/arm_scmi/driver.c > @@ -1911,8 +1911,8 @@ static int __scmi_xfer_info_init(struct scmi_info *sinfo, > hash_init(info->pending_xfers); > > /* Allocate a bitmask sized to hold MSG_TOKEN_MAX tokens */ > - info->xfer_alloc_table = devm_kcalloc(dev, BITS_TO_LONGS(MSG_TOKEN_MAX), > - sizeof(long), GFP_KERNEL); > + info->xfer_alloc_table = devm_bitmap_zalloc(dev, MSG_TOKEN_MAX, > + GFP_KERNEL); > if (!info->xfer_alloc_table) > return -ENOMEM; > LGTM. Reviewed-by: Cristian Marussi Tested-by: Cristian Marussi Thanks, Cristian