Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2993959pxb; Sat, 23 Oct 2021 13:05:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrP3AmGOcj0YncAy+M9lmHhbesz7QWWCh1EN1cZJzDU76EeRUZ8/DdsUdCxSKMtm+iFYib X-Received: by 2002:a05:6a00:2287:b0:47b:dde0:447a with SMTP id f7-20020a056a00228700b0047bdde0447amr3009921pfe.48.1635019500420; Sat, 23 Oct 2021 13:05:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635019500; cv=none; d=google.com; s=arc-20160816; b=CYHulu0Kogj7sFAYS5ErkWleg9t015RNjjDuziwv3R76q+WTGszzYR3RSZESqKut5T 2327ODd+JZvJpfT1+/TXMQP2toLFJ7QWe/5NVOGEhHerrL1ZB/yTQe3eqsPNjPsDZpiK n8SLT6PPRozUWA8pPq+pXHW8bbuTBKS8ZWlx0j27uTdkdfEjPOifjuKonC5CKUihvS72 1vbH4hI/NXjk4PPRRbkjB5RgxB4L/wwkOC0M8XRyk9qCgdQHR9UZ2qgIc8tXv6CoLvRq qib76Rpcx0FlN2XJJ8qrUQYQgXgityRGdAKNS3qy4kGOLa6BrnJ3wnp99xnjfSFvrWA0 rJvQ== 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=JEwxAxBB5SaXZApNsSTAtxZscobVsr6btsLDBCj34KY=; b=XUIH3Ze7Xg5ceXa+iIS3oIJT5//NMdwkDmyLUidTx9VKCuXi11jYyLY85637y9w01N elKw+eyBzopezvlWxz6zVZqrWrUXF6juFAi5MEj7G1OfiNwrR/vj7LzUJ8LeermkQOJX PaVrZwGLfkBnPoKehWPS4TJaPmk3MzHg0H8yXhLD3Ga9PZh0gf4XBqdAIMamiO01Cxm/ yTQ9rRQGuvzH2FEsbwV66vcuB1gUConS9mTPfF+iov4iSsIu99Fo17Ze0yMhVHvOfaEy 1QUWajvVyjbaRRBTWZmdRdXRkxuHAnXUpiiO+LQpfzs98HoZjXfPMKkg/oUGp/FHy6oC ecTA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x25si4997401pfa.96.2021.10.23.13.04.46; Sat, 23 Oct 2021 13:05:00 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230142AbhJWUE2 (ORCPT + 99 others); Sat, 23 Oct 2021 16:04:28 -0400 Received: from smtp06.smtpout.orange.fr ([80.12.242.128]:51163 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229954AbhJWUE2 (ORCPT ); Sat, 23 Oct 2021 16:04:28 -0400 Received: from pop-os.home ([92.140.161.106]) by smtp.orange.fr with ESMTPA id eNDSmCwfQTdRTeNDSmKOiE; Sat, 23 Oct 2021 22:02:07 +0200 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Sat, 23 Oct 2021 22:02:07 +0200 X-ME-IP: 92.140.161.106 From: Christophe JAILLET To: toan@os.amperecomputing.com, lorenzo.pieralisi@arm.com, robh@kernel.org, kw@linux.com, bhelgaas@google.com Cc: linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] PCI: xgene-msi: Use bitmap_zalloc() when applicable Date: Sat, 23 Oct 2021 22:02:05 +0200 Message-Id: <32f3bc1fbfbd6ee0815e565012904758ca9eff7e.1635019243.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 'xgene_msi->bitmap' is a bitmap. So use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. Signed-off-by: Christophe JAILLET --- drivers/pci/controller/pci-xgene-msi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/pci-xgene-msi.c b/drivers/pci/controller/pci-xgene-msi.c index c50ff279903c..bfa259781b69 100644 --- a/drivers/pci/controller/pci-xgene-msi.c +++ b/drivers/pci/controller/pci-xgene-msi.c @@ -269,9 +269,7 @@ static void xgene_free_domains(struct xgene_msi *msi) static int xgene_msi_init_allocator(struct xgene_msi *xgene_msi) { - int size = BITS_TO_LONGS(NR_MSI_VEC) * sizeof(long); - - xgene_msi->bitmap = kzalloc(size, GFP_KERNEL); + xgene_msi->bitmap = bitmap_zalloc(NR_MSI_VEC, GFP_KERNEL); if (!xgene_msi->bitmap) return -ENOMEM; @@ -360,7 +358,7 @@ static int xgene_msi_remove(struct platform_device *pdev) kfree(msi->msi_groups); - kfree(msi->bitmap); + bitmap_free(msi->bitmap); msi->bitmap = NULL; xgene_free_domains(msi); -- 2.30.2