From patchwork Fri Jun 18 15:16:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12331621 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 565D8C48BDF for ; Fri, 18 Jun 2021 15:20:07 +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 2CC7B613E9 for ; Fri, 18 Jun 2021 15:20:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2CC7B613E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@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=NzPss2/rGTIvREVJm9xPIK2tnw4KqvG6Bx0VkuqgUIE=; b=coFQVgEV7SBBqb e0G1afyto9FIC2UuQ499Adyka7BLmshMA8jzMyUMA4LkscsWk0Mmid+I/0TqJr6eSEnh+I0l2NldX gOz0F/2MERIppu6uncqf3Ow3aBgcnRrR3zkSe277eRURFG9WtLTTKObwjjSUNtCX8T+AYPX01kLGa dImg6RE8XSl7jt0WmIgikaMT8PmOJFzEjPZsiFxHEntYrQabFkNZ9top0q3acYMZBCyAqK8tmb4eR +E7qL4SFuCCKXNfwOeBxH9dKVcgsLDdFLtF04lrSmBSRdJg1KJN0r9VmsWn3ZaZC/s7tJ5jKrmh1r w6DXT7UGeJlR/vxwDLyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luGFy-00EfPn-Eq; Fri, 18 Jun 2021 15:18:06 +0000 Received: from mga02.intel.com ([134.134.136.20]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1luGEu-00Ef7Z-P9 for linux-arm-kernel@lists.infradead.org; Fri, 18 Jun 2021 15:17:02 +0000 IronPort-SDR: lEt5T9N2wDMZhl2NLbABtbz4qrXl2pHrNkgYo0M+FinqhXkE0QnUAxZsjUvbGXPykkX6S+umqY jvl4nrOK6EHw== X-IronPort-AV: E=McAfee;i="6200,9189,10019"; a="193699525" X-IronPort-AV: E=Sophos;i="5.83,284,1616482800"; d="scan'208";a="193699525" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2021 08:16:45 -0700 IronPort-SDR: MnDAIQ1s5CO6BrbYYxwt4okj6XfWmoA+g4scyFsxt8SUxSr57N/HIlASk6B9MiTcq7Txyg6yFX F2HLK5/PTqig== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,284,1616482800"; d="scan'208";a="453180745" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 18 Jun 2021 08:16:43 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id C5A9C2AA; Fri, 18 Jun 2021 18:17:07 +0300 (EEST) From: Andy Shevchenko To: Marc Zyngier , Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Tsahee Zidenberg , Antoine Tenart , Thomas Gleixner , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth Subject: [PATCH v1 1/7] irqchip: Switch to bitmap_zalloc() Date: Fri, 18 Jun 2021 18:16:51 +0300 Message-Id: <20210618151657.65305-1-andriy.shevchenko@linux.intel.com> 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-20210618_081700_904408_03FF2517 X-CRM114-Status: GOOD ( 11.22 ) 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 Switch to bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko --- drivers/irqchip/irq-partition-percpu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-partition-percpu.c b/drivers/irqchip/irq-partition-percpu.c index 89c23a1566dc..8e76d2913e6b 100644 --- a/drivers/irqchip/irq-partition-percpu.c +++ b/drivers/irqchip/irq-partition-percpu.c @@ -215,8 +215,7 @@ struct partition_desc *partition_create_desc(struct fwnode_handle *fwnode, goto out; desc->domain = d; - desc->bitmap = kcalloc(BITS_TO_LONGS(nr_parts), sizeof(long), - GFP_KERNEL); + desc->bitmap = bitmap_zalloc(nr_parts, GFP_KERNEL); if (WARN_ON(!desc->bitmap)) goto out; From patchwork Fri Jun 18 15:16:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12331615 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6ADF1C48BDF for ; Fri, 18 Jun 2021 15:19:09 +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 2BEF2613E9 for ; Fri, 18 Jun 2021 15:19:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2BEF2613E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@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:References:In-Reply-To: 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: List-Owner; bh=bvVBxIzvu2Pnnrm2r1ZOG0Yax8T9MU95FSzTV9CX1nc=; b=gLdmQ/Y/dLUlKz ae7dT5wemCMbj8seih6VwguDowUP770W21DQ59/TkqOhGBKoeyDP/5wyOYWdU5dSZvCnimHYEIiOw /mewv8yd5IxcyA37UtyCUYGnN4+22KUw0NYr1Im9GQLdvRQBn2cqomGH1Y/WNIdvVfvCyZ042tUJV 2gmerbuUbOuNFFnNelcIqPnPQ5EEkAytJNw5+AKbQ+K5N3eTsyDzO/ZnKnDYF+GK2afWDzOudFv+N TDKeKEeatBSCiTssU9qzA+2POgGCiQwldASyzSZennyS6u72Jbs3EX5AsaoktJKFh52Ds3mSGwv6x CNpxE2W/ATk+QNASo42Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luGF5-00Ef94-RJ; Fri, 18 Jun 2021 15:17:12 +0000 Received: from mga09.intel.com ([134.134.136.24]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1luGEi-00Ef3k-HJ for linux-arm-kernel@lists.infradead.org; Fri, 18 Jun 2021 15:16:49 +0000 IronPort-SDR: zkgC65XGunLSFd7kp+80xQyy7uAGK/TgvhnvLlgjVz2dd1uq/HS3Kh2hS0+k/aE1cLyFoRVFX5 m5+V65FEPVwQ== X-IronPort-AV: E=McAfee;i="6200,9189,10019"; a="206519434" X-IronPort-AV: E=Sophos;i="5.83,284,1616482800"; d="scan'208";a="206519434" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2021 08:16:45 -0700 IronPort-SDR: UIfXERg0PegMnxreJLGLGSTeFjZWHu54VoWUtl+TkHnmFHqI7FWgA5fxnRjlFqziSiQGjyhYf6 BIe+Lq4+sodQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,284,1616482800"; d="scan'208";a="554764722" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 18 Jun 2021 08:16:43 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id CDAEA65; Fri, 18 Jun 2021 18:17:07 +0300 (EEST) From: Andy Shevchenko To: Marc Zyngier , Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Tsahee Zidenberg , Antoine Tenart , Thomas Gleixner , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth Subject: [PATCH v1 2/7] irqchip/alpine-msi: Switch to bitmap_zalloc() Date: Fri, 18 Jun 2021 18:16:52 +0300 Message-Id: <20210618151657.65305-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210618151657.65305-1-andriy.shevchenko@linux.intel.com> References: <20210618151657.65305-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_081648_651220_30DD28DB X-CRM114-Status: GOOD ( 10.88 ) 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 Switch to bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko --- drivers/irqchip/irq-alpine-msi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/irqchip/irq-alpine-msi.c b/drivers/irqchip/irq-alpine-msi.c index ede02dc2bcd0..5ddb8e578ac6 100644 --- a/drivers/irqchip/irq-alpine-msi.c +++ b/drivers/irqchip/irq-alpine-msi.c @@ -267,9 +267,7 @@ static int alpine_msix_init(struct device_node *node, goto err_priv; } - priv->msi_map = kcalloc(BITS_TO_LONGS(priv->num_spis), - sizeof(*priv->msi_map), - GFP_KERNEL); + priv->msi_map = bitmap_zalloc(priv->num_spis, GFP_KERNEL); if (!priv->msi_map) { ret = -ENOMEM; goto err_priv; @@ -285,7 +283,7 @@ static int alpine_msix_init(struct device_node *node, return 0; err_map: - kfree(priv->msi_map); + bitmap_free(priv->msi_map); err_priv: kfree(priv); return ret; From patchwork Fri Jun 18 15:16:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12331609 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB8DEC48BDF for ; Fri, 18 Jun 2021 15:18:54 +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 732B9613E9 for ; Fri, 18 Jun 2021 15:18:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 732B9613E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@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:References:In-Reply-To: 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: List-Owner; bh=U1hvR5P4s5c1Ew1h1oNNJ6EvX61e4IGktXi+ulySXIA=; b=hdf/3cLL/xGaD2 DekdHQCmPQGtc6+RGnObkKMYF/SKcfG4F87K9dY8Tdck8Rf+MCnyFe/s1Yzti7q/8aHlmHSwSkzGB 99sXC160CSJzEj1QYJ6BZsMhGCUu8X0O/CjOJMYWsOBlQsUnyfXQKnQFKpVzGCSQEV78y+tf1JecD 4B6lxyUuE/CX1bxRAFqCOFVvAchjxsAsKE8uMtOEwoT/DUKP/f+z3VjTBANEkrUqVIpXRTep+ht4k 5/bFbSI/tnlzYEsbrPgoJIJdpP0PFwMXgcI40RNFww+55wWQpCI1Ggi6s3NTdlnrcIgIZg8vWfs/i 1R/OiPFEAW3u7LXz1yWQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luGEk-00Ef4b-Cz; Fri, 18 Jun 2021 15:16:50 +0000 Received: from mga06.intel.com ([134.134.136.31]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1luGEg-00Ef37-W9 for linux-arm-kernel@lists.infradead.org; Fri, 18 Jun 2021 15:16:48 +0000 IronPort-SDR: bqWhKJFbf5+Q/qTo7VNQadZm4JSJZGPZim09PvBGopJgdIx/hs2y8e9UvkngsX3SDLgj26N8ai eUB8E+STX3+Q== X-IronPort-AV: E=McAfee;i="6200,9189,10019"; a="267713572" X-IronPort-AV: E=Sophos;i="5.83,284,1616482800"; d="scan'208";a="267713572" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2021 08:16:45 -0700 IronPort-SDR: FMZ/H460cl6HCD+Q5cecLc8TsIW79bsBdzpWK3cYkxs/+jO2P+6dP9d8d8Z95o5PZkYTP6XVgy jY6w1fnaX1Qw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,284,1616482800"; d="scan'208";a="451423865" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 18 Jun 2021 08:16:43 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id E10D4431; Fri, 18 Jun 2021 18:17:07 +0300 (EEST) From: Andy Shevchenko To: Marc Zyngier , Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Tsahee Zidenberg , Antoine Tenart , Thomas Gleixner , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth Subject: [PATCH v1 3/7] irqchip/gic-v2m: Switch to bitmap_zalloc() Date: Fri, 18 Jun 2021 18:16:53 +0300 Message-Id: <20210618151657.65305-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210618151657.65305-1-andriy.shevchenko@linux.intel.com> References: <20210618151657.65305-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_081647_127622_D9D8AB37 X-CRM114-Status: GOOD ( 10.92 ) 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 Switch to bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko --- drivers/irqchip/irq-gic-v2m.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-gic-v2m.c b/drivers/irqchip/irq-gic-v2m.c index be9ea6fd6f8b..9349fc68b81a 100644 --- a/drivers/irqchip/irq-gic-v2m.c +++ b/drivers/irqchip/irq-gic-v2m.c @@ -269,7 +269,7 @@ static void gicv2m_teardown(void) list_for_each_entry_safe(v2m, tmp, &v2m_nodes, entry) { list_del(&v2m->entry); - kfree(v2m->bm); + bitmap_free(v2m->bm); iounmap(v2m->base); of_node_put(to_of_node(v2m->fwnode)); if (is_fwnode_irqchip(v2m->fwnode)) @@ -386,8 +386,7 @@ static int __init gicv2m_init_one(struct fwnode_handle *fwnode, break; } } - v2m->bm = kcalloc(BITS_TO_LONGS(v2m->nr_spis), sizeof(long), - GFP_KERNEL); + v2m->bm = bitmap_zalloc(v2m->nr_spis, GFP_KERNEL); if (!v2m->bm) { ret = -ENOMEM; goto err_iounmap; From patchwork Fri Jun 18 15:16:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12331611 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C266EC49361 for ; Fri, 18 Jun 2021 15:18:55 +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 921C5613E9 for ; Fri, 18 Jun 2021 15:18:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 921C5613E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@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:References:In-Reply-To: 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: List-Owner; bh=54HkHJ/HfUOPSMYKBn7oSX6xKvOo5TykrLyJkNZQ/H0=; b=v050j2G/q5xAKp nkd951ut1Fv3GTnvj+dw6RH5RuG+x2M0kY54Sl8i7C47Zsp99I0v/gs2prYnVKFza3Du/HxqXGd1q /+FW3lkTHZ2YvMBF15OsmcqRw2LNUEeD2xwaWXVXdYJP+DOpVdjMiH6yfNe24/kYu2dhDQJSSj7JO E/ShENbXFyKlRSISiTbe9vhZ6dTzabCvNembcwHdYcaqTZNH4v9zl1AoeyOHt6chYIDSVdSZGHXl8 G26FRoGo7zpwt1jKFm/i37nh2RjekQDuIzK7n3H/AQVoNe2qrE1GdCtYQWSUlNk6nHhswnD1e9Frc CpcVXHKt17y2bYbzm6gw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luGEu-00Ef7b-BQ; Fri, 18 Jun 2021 15:17:00 +0000 Received: from mga06.intel.com ([134.134.136.31]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1luGEi-00Ef37-C6 for linux-arm-kernel@lists.infradead.org; Fri, 18 Jun 2021 15:16:49 +0000 IronPort-SDR: zMVxy1VUJAmqHPZkrFag6H5pgf+q3EBizf5nBbJxW3uyoBUh4bMXfq4qNRc7A3PJcpgScfNhJv 5j9zS6osH11Q== X-IronPort-AV: E=McAfee;i="6200,9189,10019"; a="267713574" X-IronPort-AV: E=Sophos;i="5.83,284,1616482800"; d="scan'208";a="267713574" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2021 08:16:45 -0700 IronPort-SDR: bUWn2aZ+KSWpqGLPniPUe4ytW8LWunC0LMYg7GeZzOY+uZJ6s1xAlopJsW03gj+ZFxbdxB1zFN JAUSB3pDdGQA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,284,1616482800"; d="scan'208";a="451423868" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 18 Jun 2021 08:16:43 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id EBEA450E; Fri, 18 Jun 2021 18:17:07 +0300 (EEST) From: Andy Shevchenko To: Marc Zyngier , Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Tsahee Zidenberg , Antoine Tenart , Thomas Gleixner , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth Subject: [PATCH v1 4/7] irqchip/gic-v3: Switch to bitmap_zalloc() Date: Fri, 18 Jun 2021 18:16:54 +0300 Message-Id: <20210618151657.65305-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210618151657.65305-1-andriy.shevchenko@linux.intel.com> References: <20210618151657.65305-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_081648_473837_4C6AFE2E X-CRM114-Status: GOOD ( 12.37 ) 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 Switch to bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko --- drivers/irqchip/irq-gic-v3-its.c | 9 ++++----- drivers/irqchip/irq-gic-v3-mbi.c | 5 ++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index ba39668c3e08..daa5b1c968f0 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -2140,7 +2140,7 @@ static unsigned long *its_lpi_alloc(int nr_irqs, u32 *base, int *nr_ids) if (err) goto out; - bitmap = kcalloc(BITS_TO_LONGS(nr_irqs), sizeof (long), GFP_ATOMIC); + bitmap = bitmap_zalloc(nr_irqs, GFP_ATOMIC); if (!bitmap) goto out; @@ -2156,7 +2156,7 @@ static unsigned long *its_lpi_alloc(int nr_irqs, u32 *base, int *nr_ids) static void its_lpi_free(unsigned long *bitmap, u32 base, u32 nr_ids) { WARN_ON(free_lpi_range(base, nr_ids)); - kfree(bitmap); + bitmap_free(bitmap); } static void gic_reset_prop_table(void *va) @@ -3376,8 +3376,7 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id, if (alloc_lpis) { lpi_map = its_lpi_alloc(nvecs, &lpi_base, &nr_lpis); if (lpi_map) - col_map = kcalloc(nr_lpis, sizeof(*col_map), - GFP_KERNEL); + col_map = kcalloc(nr_lpis, sizeof(*col_map), GFP_KERNEL); } else { col_map = kcalloc(nr_ites, sizeof(*col_map), GFP_KERNEL); nr_lpis = 0; @@ -3387,7 +3386,7 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id, if (!dev || !itt || !col_map || (!lpi_map && alloc_lpis)) { kfree(dev); kfree(itt); - kfree(lpi_map); + bitmap_free(lpi_map); kfree(col_map); return NULL; } diff --git a/drivers/irqchip/irq-gic-v3-mbi.c b/drivers/irqchip/irq-gic-v3-mbi.c index e81e89a81cb5..b84c9c2eccdc 100644 --- a/drivers/irqchip/irq-gic-v3-mbi.c +++ b/drivers/irqchip/irq-gic-v3-mbi.c @@ -290,8 +290,7 @@ int __init mbi_init(struct fwnode_handle *fwnode, struct irq_domain *parent) if (ret) goto err_free_mbi; - mbi_ranges[n].bm = kcalloc(BITS_TO_LONGS(mbi_ranges[n].nr_spis), - sizeof(long), GFP_KERNEL); + mbi_ranges[n].bm = bitmap_zalloc(mbi_ranges[n].nr_spis, GFP_KERNEL); if (!mbi_ranges[n].bm) { ret = -ENOMEM; goto err_free_mbi; @@ -329,7 +328,7 @@ int __init mbi_init(struct fwnode_handle *fwnode, struct irq_domain *parent) err_free_mbi: if (mbi_ranges) { for (n = 0; n < mbi_range_nr; n++) - kfree(mbi_ranges[n].bm); + bitmap_free(mbi_ranges[n].bm); kfree(mbi_ranges); } From patchwork Fri Jun 18 15:16:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12331619 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B81EEC48BDF for ; Fri, 18 Jun 2021 15:19:21 +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 78A36613EE for ; Fri, 18 Jun 2021 15:19:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 78A36613EE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@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:References:In-Reply-To: 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: List-Owner; bh=o+z/kfBjleEc2mY2xnGcClApCO/YarFPbY59EhLdGWA=; b=fDmnnqsPjd66I5 PUKONPxJThDaClMUGzy7WslINQn99pybbvh/2/oARahq3p1QRKifxNzE1/FN9SeGgRIYAgidIh4lP yGJC2eUBfKcV19efzDzDGmy0dqXaCISvSk/luqRCjmxajBu6UVqQv2JgGUF4P2JkLptnA3VWIFlYa EztkX+XXWhZ+QPtarO8H7zBEpmcfcXXCjjTxJOTze6Z8bT3xTcv0V8L0pW2iB6wf4FTbNMIjiiDh+ YmfrCqv/UwG38Cel3W2+P8SJ7ucQwDEq52YU+FJhNH0csy895jPMqA5Hy2B+mZ/YZPWNbdx8GpEZs BBiH8Ecf5taXG6tetPxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luGFI-00EfBn-6i; Fri, 18 Jun 2021 15:17:24 +0000 Received: from mga18.intel.com ([134.134.136.126]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1luGEi-00Ef3j-J0 for linux-arm-kernel@lists.infradead.org; Fri, 18 Jun 2021 15:16:51 +0000 IronPort-SDR: 6g6xUEFyp/nmYI+ZtiMx05kU4Zt47lGwthvPtCiGaGBmg9rrL92clPUXtIxTMdVO2/s1a2uP+v OSAM/3DmEosg== X-IronPort-AV: E=McAfee;i="6200,9189,10019"; a="193881478" X-IronPort-AV: E=Sophos;i="5.83,284,1616482800"; d="scan'208";a="193881478" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2021 08:16:46 -0700 IronPort-SDR: 5xNIyIt+KVgy6vf8LLlD2o/7eztn5hWSJlPn67HksO+ShYXYRgk3m7E63O9iX+i25TReGNrqHl XUMt/FBWvtRw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,284,1616482800"; d="scan'208";a="416470862" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 18 Jun 2021 08:16:43 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 03553516; Fri, 18 Jun 2021 18:17:07 +0300 (EEST) From: Andy Shevchenko To: Marc Zyngier , Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Tsahee Zidenberg , Antoine Tenart , Thomas Gleixner , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth Subject: [PATCH v1 5/7] irqchip/ls-scfg-msi: Switch to devm_bitmap_zalloc() Date: Fri, 18 Jun 2021 18:16:55 +0300 Message-Id: <20210618151657.65305-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210618151657.65305-1-andriy.shevchenko@linux.intel.com> References: <20210618151657.65305-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_081648_710353_997484DB X-CRM114-Status: GOOD ( 11.97 ) 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 Switch to devm_bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko --- drivers/irqchip/irq-ls-scfg-msi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/irqchip/irq-ls-scfg-msi.c b/drivers/irqchip/irq-ls-scfg-msi.c index 55322da51c56..b4927e425f7b 100644 --- a/drivers/irqchip/irq-ls-scfg-msi.c +++ b/drivers/irqchip/irq-ls-scfg-msi.c @@ -362,10 +362,7 @@ static int ls_scfg_msi_probe(struct platform_device *pdev) msi_data->irqs_num = MSI_IRQS_PER_MSIR * (1 << msi_data->cfg->ibs_shift); - msi_data->used = devm_kcalloc(&pdev->dev, - BITS_TO_LONGS(msi_data->irqs_num), - sizeof(*msi_data->used), - GFP_KERNEL); + msi_data->used = devm_bitmap_zalloc(&pdev->dev, msi_data->irqs_num, GFP_KERNEL); if (!msi_data->used) return -ENOMEM; /* From patchwork Fri Jun 18 15:16:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12331617 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3978C48BE8 for ; Fri, 18 Jun 2021 15:19:11 +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 A527E613E9 for ; Fri, 18 Jun 2021 15:19:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A527E613E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@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:References:In-Reply-To: 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: List-Owner; bh=8VgcBeLFacWpxTsnunMvD4A/kozyi8rI+VwI4MUzb1g=; b=jL5EVKK9v6SNX3 /M55ow9YT8RkumqjNjnA/0/ziI7N/Eunc5O+jeTbNnxC4AI0wQ8Tbj9vy2h4jCdwH2Pxt945rqsax nyeVKqPBNvIdEJFgOOsvLy7OaQj+BTTJGWloNm3wI8WHvtzzLrv/4lDT2Xc+kn0gdUt0AjheUmqWB GFxX4MJo08wh3L1owyDwglluP08GXyw+22LyS01JP/7XwIa/x4qOpBUTXYiVAapdAElvIFgNwXeuU XdQk6rbGCsTcYE4GIo4vddwup81bc31BHX7ru5NUljrrFCWIc8knctXtI733VX2aZH6Nl6awTebRu YZBWRl9FgL7NKrz0Duag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luGFe-00EfHz-Ph; Fri, 18 Jun 2021 15:17:46 +0000 Received: from mga14.intel.com ([192.55.52.115]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1luGEk-00Ef4n-1t for linux-arm-kernel@lists.infradead.org; Fri, 18 Jun 2021 15:16:51 +0000 IronPort-SDR: oE4zdL/TjtY87+EuNEDht4thnI21TWlD4HZ8WOGeNFGgWBkgpGlO8ke2YXyf515Wf9UitYXMIJ XptraYHfDPSQ== X-IronPort-AV: E=McAfee;i="6200,9189,10019"; a="206387570" X-IronPort-AV: E=Sophos;i="5.83,284,1616482800"; d="scan'208";a="206387570" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2021 08:16:49 -0700 IronPort-SDR: wRUYq2tY94H9uf/fve+Yd18pcLRgHVg2dDTdtx+3HRfbonck/TIWds9vhn2Iha71nVrHduz5U9 o42zTKb7TyxQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,284,1616482800"; d="scan'208";a="489096683" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 18 Jun 2021 08:16:46 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0ED96580; Fri, 18 Jun 2021 18:17:08 +0300 (EEST) From: Andy Shevchenko To: Marc Zyngier , Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Tsahee Zidenberg , Antoine Tenart , Thomas Gleixner , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth Subject: [PATCH v1 6/7] irqchip/mvebu-gicp: Switch to devm_bitmap_zalloc() Date: Fri, 18 Jun 2021 18:16:56 +0300 Message-Id: <20210618151657.65305-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210618151657.65305-1-andriy.shevchenko@linux.intel.com> References: <20210618151657.65305-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_081650_173767_30CA536E X-CRM114-Status: GOOD ( 12.18 ) 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 Switch to devm_bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko --- drivers/irqchip/irq-mvebu-gicp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-mvebu-gicp.c b/drivers/irqchip/irq-mvebu-gicp.c index 3be5c5dba1da..fe88a782173d 100644 --- a/drivers/irqchip/irq-mvebu-gicp.c +++ b/drivers/irqchip/irq-mvebu-gicp.c @@ -210,9 +210,7 @@ static int mvebu_gicp_probe(struct platform_device *pdev) gicp->spi_cnt += gicp->spi_ranges[i].count; } - gicp->spi_bitmap = devm_kcalloc(&pdev->dev, - BITS_TO_LONGS(gicp->spi_cnt), sizeof(long), - GFP_KERNEL); + gicp->spi_bitmap = devm_bitmap_zalloc(&pdev->dev, gicp->spi_cnt, GFP_KERNEL); if (!gicp->spi_bitmap) return -ENOMEM; From patchwork Fri Jun 18 15:16:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12331613 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E81EEC48BE8 for ; Fri, 18 Jun 2021 15:18:59 +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 B15FE613EE for ; Fri, 18 Jun 2021 15:18:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B15FE613EE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@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:References:In-Reply-To: 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: List-Owner; bh=L1NwgBbxmQ1U7+LMZ6D3rOEyPSUMVGmi/cB22rE8nFg=; b=jZ2WRVueEDSGRp +ysUEh7vRER4P9Mdl1tDWOixG1Z3UicADjSoUPI7v5k2iLj+jg6gFb/oHadaU6b7Glux75BzVM/pX RaCZVZZPMTlTVEF3g1urXisi3dWVfh/z1T2FU999U0jGZ3M8GqxLWnO43pYhfdA9BkJbxw0u1lno2 AvSFeBUaSQlB/8PB1WNM3BL+iuVC9+V4AcGiV5iSdcihhXX77R9FzISi9U9Gfq6bzCsSQcB04W1oT nY4I9q8A4+E2Xt/qIz1c426zNz7dxX+VHeRX4qO9xfpVQCeijyVoAnoBm46SBg40Hx2P2AQyq01fZ dUKvljJ69p5VLhtkFj+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luGFT-00EfE9-DO; Fri, 18 Jun 2021 15:17:35 +0000 Received: from mga18.intel.com ([134.134.136.126]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1luGEj-00Ef4e-72 for linux-arm-kernel@lists.infradead.org; Fri, 18 Jun 2021 15:16:51 +0000 IronPort-SDR: ydxgBhEjcWyf9MfC7cn2h58DbmvHNO3tCsJnDzLZKrSSZCMkf6GvaWGU2m538hbZGPyepkvwzV uB4e3QWQ1GFQ== X-IronPort-AV: E=McAfee;i="6200,9189,10019"; a="193881486" X-IronPort-AV: E=Sophos;i="5.83,284,1616482800"; d="scan'208";a="193881486" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2021 08:16:48 -0700 IronPort-SDR: l88ugZuCTd4LwDkS8RN7RX9Z/0a1zHb350z8eo2TeAkQJZJbyupWEnUHf0+3eui2WV1N1GTK5K DEKir6tpoI7A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,284,1616482800"; d="scan'208";a="416470877" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 18 Jun 2021 08:16:46 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 1A0A45B5; Fri, 18 Jun 2021 18:17:08 +0300 (EEST) From: Andy Shevchenko To: Marc Zyngier , Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Tsahee Zidenberg , Antoine Tenart , Thomas Gleixner , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth Subject: [PATCH v1 7/7] irqchip/mvebu-odmi: Switch to bitmap_zalloc() Date: Fri, 18 Jun 2021 18:16:57 +0300 Message-Id: <20210618151657.65305-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210618151657.65305-1-andriy.shevchenko@linux.intel.com> References: <20210618151657.65305-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_081649_340868_2D18757F X-CRM114-Status: GOOD ( 12.20 ) 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 Switch to bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko --- drivers/irqchip/irq-mvebu-odmi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-mvebu-odmi.c b/drivers/irqchip/irq-mvebu-odmi.c index b4d367868dbb..dc4145abdd6f 100644 --- a/drivers/irqchip/irq-mvebu-odmi.c +++ b/drivers/irqchip/irq-mvebu-odmi.c @@ -171,8 +171,7 @@ static int __init mvebu_odmi_init(struct device_node *node, if (!odmis) return -ENOMEM; - odmis_bm = kcalloc(BITS_TO_LONGS(odmis_count * NODMIS_PER_FRAME), - sizeof(long), GFP_KERNEL); + odmis_bm = bitmap_zalloc(odmis_count * NODMIS_PER_FRAME, GFP_KERNEL); if (!odmis_bm) { ret = -ENOMEM; goto err_alloc; @@ -227,7 +226,7 @@ static int __init mvebu_odmi_init(struct device_node *node, if (odmi->base && !IS_ERR(odmi->base)) iounmap(odmis[i].base); } - kfree(odmis_bm); + bitmap_free(odmis_bm); err_alloc: kfree(odmis); return ret;