diff options
author | Ke Liu <liuke94@huawei.com> | 2022-05-28 09:31:40 +0000 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2022-06-10 16:13:01 +0200 |
commit | 1449c24e71a343a033af8de0842d1edb8a37926a (patch) | |
tree | 1bd7af33e22aa862382d14e53fc98915465b507a /drivers/net/wireless/mac80211_hwsim.c | |
parent | 8cbf0c2ab6dfd61066a6ce49d9d37d3d25b2d05f (diff) | |
download | linux-1449c24e71a343a033af8de0842d1edb8a37926a.tar.gz linux-1449c24e71a343a033af8de0842d1edb8a37926a.tar.bz2 linux-1449c24e71a343a033af8de0842d1edb8a37926a.zip |
wifi: mac80211_hwsim: Directly use ida_alloc()/free()
Use ida_alloc()/ida_free() instead of deprecated
ida_simple_get()/ida_simple_remove().
Signed-off-by: Ke Liu <liuke94@huawei.com>
Link: https://lore.kernel.org/r/20220528093140.1573816-1-liuke94@huawei.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/mac80211_hwsim.c')
-rw-r--r-- | drivers/net/wireless/mac80211_hwsim.c | 5 |
1 files 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 = { |