Skip to content

Commit

Permalink
wifi: mac80211_hwsim: Directly use ida_alloc()/free()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ke Liu authored and Johannes Berg committed Jun 10, 2022
1 parent 8cbf0c2 commit 1449c24
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit 1449c24

Please sign in to comment.