Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3965322pxb; Mon, 27 Sep 2021 06:39:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBZGk/jXgGj7ZXBa865azhazkVFPC29idG1ZFhy6iq1RzYlVMb56le6lMErONrXjQXLp8Z X-Received: by 2002:a63:9a19:: with SMTP id o25mr16730580pge.61.1632749964799; Mon, 27 Sep 2021 06:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632749964; cv=none; d=google.com; s=arc-20160816; b=ORJcDCPMV7k2r8s+PWiKVugligvAmxMnZ30rtkprXdJB/693h3VN6ufHPeQ0zcp26y pmxMNNx/uyyUhx2yefSFSR1k1E1xQauhlHC+nEFMjRzIIlxecRKJH9miEOuZbxqTh932 /h7ZCfliCp3dWU8Uu3OOuCwf01lE7TJVjN1kkUyLc4ISAvjMFUjqWgjwNKurQ7GfIUhG C97FErvDYYFnJVRr8qlZTuJwCv05FMiShhttctitprO9ifGkdHlXExBE8Rk9ULaLy+84 W2n8TwV/vvLdf1lryPbK1aIusx844d7nMNRSpieruI76/fqQAGTCGIA4lf0RK/sUPEm5 jKyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=DCKjXvBPcTFSaHvRzpi9LbszU5rTTnzEeL7qD7ID1K0=; b=HDqDDTJSHL4SLzOWOPz6vyKqFlzS6VU3ZOAjRJmVjHclEpDibfjne5PvfrdibnFIEv BCQL9/Ktj0WrN7EV6mHslRbP4mTNM6dRtDKNwx84YHNCezCi6e4dcS/yBa8PcdSANkeo cFN/8MZEtYSxH201KY320P98C+APgFpvMB6E7+kIGPZwBVAUXYkEXzzNSvxdIGl6xywo nZHuTX0o1NEiAah6eT4J4OWQs6nrfY6X7Yv3LsNOqzOEbhgAbcIgpKtI4XBnHb9fhKDb BxyxtnCGVtYpvGlG832QCt5Y1W2QIcvMICKiUyv2+ZBYHzEGu3rmxALB+yUNcEJPlyVn yzFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=xlAAAl5m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l184si21838483pfl.52.2021.09.27.06.39.11; Mon, 27 Sep 2021 06:39:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=xlAAAl5m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234487AbhI0Njz (ORCPT + 99 others); Mon, 27 Sep 2021 09:39:55 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:60332 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234359AbhI0Njy (ORCPT ); Mon, 27 Sep 2021 09:39:54 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 18RDc74e004328; Mon, 27 Sep 2021 08:38:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1632749887; bh=DCKjXvBPcTFSaHvRzpi9LbszU5rTTnzEeL7qD7ID1K0=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=xlAAAl5m2wqfELe+3wvlHeFZ8Z4dbIS1BiUxEn1Lcgir6ubyB1NXYvwNGXguKC/sF B9IqViEcjrDPGBbTb3lLMznIw7q0kEkQ7bgsEaRTW3/C84Nj4TPC3MMYV9dt/0i7ZX 1PQqGb9qky7+ekp3ViHH4f4fysSPebd/ZPdrYC8Q= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 18RDc7HC100275 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 27 Sep 2021 08:38:07 -0500 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Mon, 27 Sep 2021 08:38:06 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Mon, 27 Sep 2021 08:38:07 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 18RDc7mR022309; Mon, 27 Sep 2021 08:38:07 -0500 Date: Mon, 27 Sep 2021 08:38:07 -0500 From: Nishanth Menon To: Christophe JAILLET CC: , , , , Subject: Re: [PATCH] firmware: ti_sci: Use devm_bitmap_zalloc when applicable Message-ID: <20210927133807.rtkfjkxxlwpdqcnf@scouring> References: <1bd77909ff75f62a2228a39db208c4c6d1b3e0e2.1632659746.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1bd77909ff75f62a2228a39db208c4c6d1b3e0e2.1632659746.git.christophe.jaillet@wanadoo.fr> User-Agent: NeoMutt/20171215 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14:36-20210926, Christophe JAILLET wrote: > 'xfer_alloc_table' is a bitmap. So use 'devm_bitmap_zalloc()' to simplify > code and improve the semantic of the code. > > While at it, remove a redundant 'bitmap_zero()' call. > > Signed-off-by: Christophe JAILLET > --- > drivers/firmware/ti_sci.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c > index 235c7e7869aa..a33eb884102f 100644 > --- a/drivers/firmware/ti_sci.c > +++ b/drivers/firmware/ti_sci.c > @@ -3352,13 +3352,11 @@ static int ti_sci_probe(struct platform_device *pdev) > if (!minfo->xfer_block) > return -ENOMEM; > > - minfo->xfer_alloc_table = devm_kcalloc(dev, > - BITS_TO_LONGS(desc->max_msgs), > - sizeof(unsigned long), > - GFP_KERNEL); > + minfo->xfer_alloc_table = devm_bitmap_zalloc(dev, > + desc->max_msgs, > + GFP_KERNEL); > if (!minfo->xfer_alloc_table) > return -ENOMEM; > - bitmap_zero(minfo->xfer_alloc_table, desc->max_msgs); > > /* Pre-initialize the buffer pointer to pre-allocated buffers */ > for (i = 0, xfer = minfo->xfer_block; i < desc->max_msgs; i++, xfer++) { > -- > 2.30.2 > Reviewed-by: Nishanth Menon -- Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D