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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14955C433EF for ; Mon, 27 Sep 2021 13:41:22 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D338660230 for ; Mon, 27 Sep 2021 13:41:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D338660230 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=q8zyy9rkY4Own3f0xBD1Xmy39PtTmkUI46Ee5rTuw5U=; b=YyddDkA1mCrUIV k+BQQzti0kkJTZPLFnnaKeNz/IhCfOFEu/KJ99HB+F23vW2PsWAcUFTTt/pUKrP8ELbxTsat93cgT ztY4Lipeyt+Qa2l3SVwNvrVKdP38p5fqMo2GYSxJALbKYxZu1yWYsQSFC8OTS5+ZDzR8Et4Gk5N3D bm/YXDBe/oUqAEE2YGvDjyUbb0xm/VKgh5rhBiK67U5A91GFx7w6t/t4foN6LsLussMaobDFlDD2T n7bpq6p0mp+SJCDL4KVH/ZXukB80CkRaffSE9oKYL7LXeySwqEdfatCAFRnSAp3uSU59cmP/oHVXo FyUzl8I4DY36POLu3mCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUqpk-002mOp-SG; Mon, 27 Sep 2021 13:38:17 +0000 Received: from fllv0016.ext.ti.com ([198.47.19.142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUqpg-002mOO-VM for linux-arm-kernel@lists.infradead.org; Mon, 27 Sep 2021 13:38:14 +0000 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-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210927_063813_182713_FD5B325B X-CRM114-Status: GOOD ( 17.62 ) 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 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel