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;