Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1606845imw; Sat, 9 Jul 2022 07:52:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vjl5laTXAq/TiF4C+luMSABSxRoCjMBjO7xQHHh5CeurGBtOsPb8XsSHGyaKGVV4BoLIsL X-Received: by 2002:a17:902:e5cb:b0:16a:7321:c3a1 with SMTP id u11-20020a170902e5cb00b0016a7321c3a1mr8934891plf.62.1657378331445; Sat, 09 Jul 2022 07:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657378331; cv=none; d=google.com; s=arc-20160816; b=xsmp8slbLX8lsFkcaw53jYy1mCKoOTNWd3JUfJnTlNdiQMcFPpNDvHmfxw4dHPLxY4 iryLREtn9z3KhnnatEsqIZILFfwI/H5sivywaBQDy9Tx4zwPqCqVpCoewgLI3H2bZbcV bpcjniBeJQb6lDaZx2vVXhyglu8WrlL2eN3fM9LjGxk1kIEGZYJvlau4twY9v0IGHt0J Qx7IGQYFEAz1g0+32ILHbM79u9A9ocq8Sjb0XE9K+0EoZIVvnoY5hWDzz7+K/66Ind0z lUXGgWwotyCd25Ocpk8/g5A6NWUO2ovJ9QERuQGkEQgYznckksXzbwOpdsu8Hhw/F9eF w66A== 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=pgVjtmfi1BlsCKI1wgEyDK00K1G5GOXFVO5C1JZIKwo=; b=n/gSZLN1D9UvPC0gDf3rjzRbO01z1dMD/6UeIgqReXfV7p1f98571A3tVAwoXZ+qR5 YosHrK8++ijm0BXn+4zmVSacfB/eR5DQPzCpXJm3HMZ2dqsHEfW4DFoK3yd+tP2PDesv xzjSP/uLUsP4eKrRzOUIB3eguCeFoDLmlyRvJGPtC1WyJ6stzpXEefyQuzzVCcWtmCeA pccVDUqGWZtC+hJhPSrqlgGxpMwn5tB+8zYHhaYQf0OVcG/ZrN9MSPL+oFN1mAPAT7Ko O3IvgKMrcHuqrFBgjgU73YIDO6K7DHFm6SmSJT0cR28wZcVeK4IU9k0ujHuKWeAg7xSb qGpg== 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 k67-20020a633d46000000b003fdcf4695c8si2213536pga.400.2022.07.09.07.51.58; Sat, 09 Jul 2022 07:52:11 -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 S229454AbiGIOYw (ORCPT + 99 others); Sat, 9 Jul 2022 10:24:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229471AbiGIOYv (ORCPT ); Sat, 9 Jul 2022 10:24:51 -0400 Received: from smtp.smtpout.orange.fr (smtp09.smtpout.orange.fr [80.12.242.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EBB31261E for ; Sat, 9 Jul 2022 07:24:50 -0700 (PDT) Received: from pop-os.home ([90.11.190.129]) by smtp.orange.fr with ESMTPA id ABO2oJ7IeV0xUABO2oTBqZ; Sat, 09 Jul 2022 16:24:48 +0200 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Sat, 09 Jul 2022 16:24:48 +0200 X-ME-IP: 90.11.190.129 From: Christophe JAILLET To: Kurt Kanzenbach , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , netdev@vger.kernel.org Subject: [PATCH] net: dsa: hellcreek: Use the bitmap API to allocate bitmaps Date: Sat, 9 Jul 2022 16:24:45 +0200 Message-Id: <8306e2ae69a5d8553691f5d10a86a4390daf594b.1657376651.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_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Use devm_bitmap_zalloc() instead of hand-writing them. It is less verbose and it improves the semantic. Signed-off-by: Christophe JAILLET --- drivers/net/dsa/hirschmann/hellcreek.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hirschmann/hellcreek.c index ac1f3b3a7040..01f90994dedd 100644 --- a/drivers/net/dsa/hirschmann/hellcreek.c +++ b/drivers/net/dsa/hirschmann/hellcreek.c @@ -1894,11 +1894,8 @@ static int hellcreek_probe(struct platform_device *pdev) if (!port->counter_values) return -ENOMEM; - port->vlan_dev_bitmap = - devm_kcalloc(dev, - BITS_TO_LONGS(VLAN_N_VID), - sizeof(unsigned long), - GFP_KERNEL); + port->vlan_dev_bitmap = devm_bitmap_zalloc(dev, VLAN_N_VID, + GFP_KERNEL); if (!port->vlan_dev_bitmap) return -ENOMEM; -- 2.34.1