From patchwork Fri Jul 8 19:23:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 12911807 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 571BEC43334 for ; Fri, 8 Jul 2022 19:25:02 +0000 (UTC) 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=ahGPKzhhYMrSBfZZWanCM2FepLRg/IdB5gwC+pTiLHI=; b=f1svaws2gj2Gnm CMvXPyQtg4sRRuj0htZI9MHjIcNn8fS6ZPGI+KkOm7BJ303LXPwOr1qt0wcnm9jw2Es4ulcKDw0ll Ufs+rBduQZVkuI4cMBHa6EomyLvak2/CLpsOYCiQ8KyboF4hWteZPtZaJi4DH1FrTnd8rf6B6FwEO 0cnNu0sSrfQRg4eBx8o4SJRKSuvSMGJXRZkbDHZ0+xnnWOEwdCWpRbVmoq2Hf0qrkjifNs8I9jWkr x2+HW83UeFM2ixKxwiFnvOM9gfAhW3dsyOjdWcOBSZhEKzKXc0FgeqiFX9Xf8DsGAGkcLa47BnUvt fEKU/3HgaNqbFiaYcwpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o9ta8-005aNQ-H5; Fri, 08 Jul 2022 19:24:04 +0000 Received: from smtp04.smtpout.orange.fr ([80.12.242.126] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o9ta4-005aLo-IX for linux-arm-kernel@lists.infradead.org; Fri, 08 Jul 2022 19:24:02 +0000 Received: from pop-os.home ([90.11.190.129]) by smtp.orange.fr with ESMTPA id 9tZroHmKEEhCQ9tZrokYfy; Fri, 08 Jul 2022 21:23:48 +0200 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Fri, 08 Jul 2022 21:23:48 +0200 X-ME-IP: 90.11.190.129 From: Christophe JAILLET To: Nishanth Menon , Tero Kristo , Santosh Shilimkar Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] firmware: ti_sci: Use the bitmap API to allocate bitmaps Date: Fri, 8 Jul 2022 21:23:46 +0200 Message-Id: <3ee11e9e83f7c1552d237f5c28f554319fcbbf1f.1657308216.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220708_122400_793062_1D676134 X-CRM114-Status: UNSURE ( 9.29 ) X-CRM114-Notice: Please train this message. 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 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/ti_sci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index ebc32bbd9b83..522be2b75ce1 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -3201,9 +3201,8 @@ devm_ti_sci_get_resource_sets(const struct ti_sci_handle *handle, valid_set = true; res_count = res->desc[i].num + res->desc[i].num_sec; - res->desc[i].res_map = - devm_kzalloc(dev, BITS_TO_LONGS(res_count) * - sizeof(*res->desc[i].res_map), GFP_KERNEL); + res->desc[i].res_map = devm_bitmap_zalloc(dev, res_count, + GFP_KERNEL); if (!res->desc[i].res_map) return ERR_PTR(-ENOMEM); }