From patchwork Sun Sep 26 12:36:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 12518265 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 7C79EC433EF for ; Sun, 26 Sep 2021 12:46:53 +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 3999960F93 for ; Sun, 26 Sep 2021 12:46:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3999960F93 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=wanadoo.fr 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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=thk0M2HKFaC//yz0i1MD1Pg3LO49UmB0/0vmsg8tBSw=; b=Qc0jecnYXMzUy/ a+qIPL7UfXujdCVSCTB/W4rOPaDTi+jqqYUodzcdHDudszWdlZ6R5jLS68NteMhdWT+uMZmrNx8z1 l4QHYy+mLlpONoDSB5X+Bs0JS1qqlwC1fR88N7/YP4geIUu6/gYuiDVxDfk16eh26UwHKON+4lKzL zoLL3BxIKXzsW6XCxe59U0iz4x3ACseIV2qVEXcnC4iZkoOmqZjc65fvGLz56tkObM3QYil0qMg+S rOwHP6ql+nsIgdIE2ubMgNYukSSIpSnTuKfMMYsx+V+u+GYV+n8alMO+zeezerJnw35L+7sTEfnmq xN1G1VIfJC5IoJNR34FA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUTWq-000b8T-Im; Sun, 26 Sep 2021 12:45:12 +0000 Received: from smtp09.smtpout.orange.fr ([80.12.242.131] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUTWn-000b7t-56 for linux-arm-kernel@lists.infradead.org; Sun, 26 Sep 2021 12:45:10 +0000 Received: from pop-os.home ([90.126.248.220]) by mwinf5d33 with ME id ycdV250084m3Hzu03cdVkC; Sun, 26 Sep 2021 14:37:31 +0200 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 26 Sep 2021 14:37:31 +0200 X-ME-IP: 90.126.248.220 From: Christophe JAILLET To: nm@ti.com, kristo@kernel.org, ssantosh@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] firmware: ti_sci: Use devm_bitmap_zalloc when applicable Date: Sun, 26 Sep 2021 14:36:55 +0200 Message-Id: <1bd77909ff75f62a2228a39db208c4c6d1b3e0e2.1632659746.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210926_054509_377956_9FA59807 X-CRM114-Status: GOOD ( 10.72 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org '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 Reviewed-by: Nishanth Menon --- 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++) {