Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp1060330rwi; Wed, 2 Nov 2022 23:56:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7hPjk/Lrt6YLdP/MRIFVt9zDEbrvVYmVt6BhZtcwq9GHfUgdGj5mgCwtBwbMOzLP49VOQp X-Received: by 2002:a17:902:b944:b0:187:28c4:69a3 with SMTP id h4-20020a170902b94400b0018728c469a3mr17316527pls.134.1667458592919; Wed, 02 Nov 2022 23:56:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667458592; cv=none; d=google.com; s=arc-20160816; b=Th3umDhi8lbyce2n0lq73UtJ/ODNifjXNzwZKH6P0dmMSX3OIO4tWDaOxS1uQhftkM MbsLeFSUIzEHhNIyT8O1nmtYLJT9XPYEwzkuPiSuqpLncQKeP3mFV7hlYccd2M3vWoq5 UbzULDn0oVq5ur0hvAIHFh9cluVVv/YjPjERnBO7zuHqMHhtzz5vvc8RBbkU0POgrfy3 ud8t60diH7wH5cNvscEgrp4Oo1bl9ZVwKrC2wrAOUq8nyaUiY3ZBn5pEwJ/bSEFQN0ms LGmRUjyL62USyAsq+z/NZ++sT7Al0hNoyCB1DLYpiFVzhqi4jwYTBNKCHW7bznfStXB7 XRTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=cbVoDl1bgAHorQLr3vzNCOgK6U1WBWAwctO98XmDjWI=; b=fKfcVPr2BPjOyxt6oEz6aH6LTJjTL+VmSZZLBwKUoY6kgRRD+5XRO1rVc/rcCtlrRq 0wgp6T22vzFbHeFXsHW3a6nY+U5NVCzSziyTMgMZ5QNBWiZwKcRAHALdYUVlFVA2Ey++ texdeXVOJbGgYKaRgp7+hX4tWJO5em++qfn0moVvQ8iUocuVQQRO1cTmpmDSXKKnGkzy 7T4WsB7S0qrNqasq8BOp7BC7LnGlOHDNF5Ll4gh9YkuD+iXhQuG3W5iS+51ECdQC1wgA OwooRYRKPjF3psyp7QMCuH46G1U3veM3hTxBsPr/ew9MPsNfJC6sustR/c2qMsoZJ/Mx 7ZGA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nl14-20020a17090b384e00b00213b6c822acsi226881pjb.167.2022.11.02.23.56.18; Wed, 02 Nov 2022 23:56:32 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230489AbiKCGlj (ORCPT + 98 others); Thu, 3 Nov 2022 02:41:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230513AbiKCGlg (ORCPT ); Thu, 3 Nov 2022 02:41:36 -0400 Received: from smtp.smtpout.orange.fr (smtp-11.smtpout.orange.fr [80.12.242.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D314C6159 for ; Wed, 2 Nov 2022 23:41:34 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id qTuto9Kl2Fv0OqTutoMxwL; Thu, 03 Nov 2022 07:41:32 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 03 Nov 2022 07:41:32 +0100 X-ME-IP: 86.243.100.34 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 v2] firmware: ti_sci: Use devm_bitmap_zalloc when applicable Date: Thu, 3 Nov 2022 07:41:30 +0100 Message-Id: <43ab1a7dd073d0d037d5d4bbbd5f8335de605826.1667457664.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 '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 --- Change in v2: * sync with -next * add R-b v1: https://lore.kernel.org/all/1bd77909ff75f62a2228a39db208c4c6d1b3e0e2.1632659746.git.christophe.jaillet@wanadoo.fr/ --- 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 6d2fd0ff7ff3..039d92a595ec 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -3398,13 +3398,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.34.1