Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1379084ioo; Fri, 27 May 2022 07:32:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyj34ZrClriMnokuWfik1lUs7NpOqzPndU/PWYppwvEWw5PsgelETmLx5dsEWNfnxXNaqdI X-Received: by 2002:a05:6a00:234b:b0:519:c7c:e58b with SMTP id j11-20020a056a00234b00b005190c7ce58bmr10072107pfj.32.1653661935269; Fri, 27 May 2022 07:32:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653661935; cv=none; d=google.com; s=arc-20160816; b=jqa2N3qnFS/Hbq4YOFYYbfq7VyY1A1yhU+W8PPvdCBHSvUdMjZLcqv6HW+TJznpaY0 tmLaurQhd9yp8qgxsRDEVRLPWn5tqAdwA0O709jr0Fe8yyQKHYEC4+Sd67YSFyy1r3KA zptKM8eRsbRpVwGh9GxVK8GB1hAkos6eM8Ejd5uzKqOg+vOzF8AQ/kyimRt5VxQ/98JA wpArrLIsfLmlTK7Lp0jz90YAP8PHEQFXvsu3Er9fc8zd+atQd/8e1tQreHDEFkezvwRG LPei9guMtMX6VWVHNTr5cccAKZiooJffx+b0Hmslq+RAadosESs27rO2iVGYgTfkJRzA df3g== 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=3+ScvU5CBMjMclEIj/rg98+Zu9vPgpmscgEmAIDUvrk=; b=mQivLB+ud6DuD9DkfNQCDTIncOB18unoGsmw6lqkHKn5mxBF8PH/YczvsJPF12C2/o W5eWQIxfA83FZy9LaaeipYGzh367lWoR32wvo4UiRG40hktDC5RjcUH3eQZ3udDMR9T5 yot50NWh2m/LWqxjT7FWinXhM1m8ugcvltBSb3UdwPQ4S6pmxZsU2KBepSMpDh5EPvKv kyF+KMYZe7tqf5MLjkQIKEG4VB9+hInljuSLnN5CSMwUZ/BThCdJAnPd/Lpu+CwMlvCL UjfXRobaXGR2+Pk4Mzn1BCeuHTnmrFnJ/MhHwFDbGLHJQAYcgJjUTtPzVdB9Bey6VFYG 0KQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w16-20020a170902e89000b00153b2d16512si6076106plg.282.2022.05.27.07.31.58; Fri, 27 May 2022 07:32:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243510AbiE0HUX (ORCPT + 67 others); Fri, 27 May 2022 03:20:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345866AbiE0HUJ (ORCPT ); Fri, 27 May 2022 03:20:09 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EABAF68A2; Fri, 27 May 2022 00:20:06 -0700 (PDT) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4L8bmG6NVPzDqMG; Fri, 27 May 2022 15:19:58 +0800 (CST) Received: from dggpemm500018.china.huawei.com (7.185.36.111) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 27 May 2022 15:20:04 +0800 Received: from localhost.localdomain (10.175.112.125) by dggpemm500018.china.huawei.com (7.185.36.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 27 May 2022 15:20:03 +0800 From: keliu To: , , , , , , , , CC: keliu Subject: [PATCH] mac80211: Directly use ida_alloc()/free() Date: Fri, 27 May 2022 07:41:32 +0000 Message-ID: <20220527074132.2474867-1-liuke94@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500018.china.huawei.com (7.185.36.111) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-wireless@vger.kernel.org Use ida_alloc()/ida_free() instead of deprecated ida_simple_get()/ida_simple_remove() . Signed-off-by: keliu --- drivers/net/wireless/mac80211_hwsim.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index e9ec63e0e395..6ad884d9e9a4 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -290,8 +290,8 @@ static inline int hwsim_net_set_netgroup(struct net *net) { struct hwsim_net *hwsim_net = net_generic(net, hwsim_net_id); - hwsim_net->netgroup = ida_simple_get(&hwsim_netgroup_ida, - 0, 0, GFP_KERNEL); + hwsim_net->netgroup = ida_alloc(&hwsim_netgroup_ida, + GFP_KERNEL); return hwsim_net->netgroup >= 0 ? 0 : -ENOMEM; } @@ -4733,7 +4733,7 @@ static void __net_exit hwsim_exit_net(struct net *net) NULL); } - ida_simple_remove(&hwsim_netgroup_ida, hwsim_net_get_netgroup(net)); + ida_free(&hwsim_netgroup_ida, hwsim_net_get_netgroup(net)); } static struct pernet_operations hwsim_net_ops = { -- 2.25.1