Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2403751ioo; Sat, 28 May 2022 12:32:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2b6PPhigCNl48nMIeSe/7qFg9XJGKkM4QbXe8ruD6WUlI8o8jOKynlLQ6XlbrNWJa8uwc X-Received: by 2002:a62:e819:0:b0:518:6a98:b02 with SMTP id c25-20020a62e819000000b005186a980b02mr43150536pfi.74.1653766345665; Sat, 28 May 2022 12:32:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653766345; cv=none; d=google.com; s=arc-20160816; b=lajzljIFR7h/aioIjiHHAMT9JRUrD/akj+RK6WsB9Ch6Z8Sy9LYIDcLPegRuu+NuDO kF/lk4PU7j/BxBBX+Ix5AsKKo6nSAeZpWeBpPiIr/SSSS2Zfo/6WUNiOq5lzW1T+w314 +R8Bx8t0BYBAsTcqexOUk4S0ziRrYWHM1XtBYm8q/NImVQ6kVGOxP1vLlb8I+fOTdBLb Jdx1UR/dil/+n7mQioWjZCle3d6JffVfY4a1haV0qPVMYbH9dKsDA/FlyXVUqWqWECUj NJERlzlup/e4x0OGyIoab3doqidzXin1n2y6+lVm8BDSQ/Md3xSjCqDrDjpuo9IQWhR3 5p0Q== 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=vGbyzm1Y4tO25kkh5gKLeOTZt4QQvH+rxwsMu4j8N0I=; b=Vqn7NIPfwdnwzGl5sUx6jl7LQRKII9Vx14m1zkyvfNXF+1QDXBw/wEyg6meVea48rk 2F1vNYVM5m2ZflHx4zOPM1E9nmh6Gyi2j1ZhfgQG3rP5ZOOh1GAMonXwuz85ZXWlDGC2 G+21t/l/OFJ/wpOL4J6pLm0qFMqlKmuJhBMerMUuywk8c3yxAmfwaBN5MOWF3vBYBO7Z Jvx9kb+rj14ue1asiyFMO4i2JYmHm/CXoAGNpxZRttnWuaoVtF3jUwoPgBqDt639dpIr 8MQcMSrfZpdhQhlFYAHwhsV+OfO4sPULl77/b7I1y2nEqg3/aucAw11R28Uopy/cyKtQ gy+Q== 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:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x23-20020a056a00189700b0050abac273b4si11407642pfh.133.2022.05.28.12.32.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 12:32:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1C0E458386; Sat, 28 May 2022 12:00:04 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232075AbiE1JKV (ORCPT + 67 others); Sat, 28 May 2022 05:10:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230320AbiE1JKQ (ORCPT ); Sat, 28 May 2022 05:10:16 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BC8AF31; Sat, 28 May 2022 02:10:14 -0700 (PDT) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4L9G7946B9zgY9h; Sat, 28 May 2022 17:08:37 +0800 (CST) Received: from dggpemm500018.china.huawei.com (7.185.36.111) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 28 May 2022 17:10:12 +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; Sat, 28 May 2022 17:10:11 +0800 From: Ke Liu To: CC: , , , , , , , , Ke Liu Subject: [PATCH v2] mac80211: Directly use ida_alloc()/free() Date: Sat, 28 May 2022 09:31:40 +0000 Message-ID: <20220528093140.1573816-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: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500018.china.huawei.com (7.185.36.111) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: Ke Liu --- v2 deal with alignment to fix --- drivers/net/wireless/mac80211_hwsim.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 2f746eb64507..bd408d260e9c 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -290,8 +290,7 @@ 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 +4732,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