Convert 'alloc_obj' family to use the new default GFP_KERNEL argument [mac80211]

JIRA: https://issues.redhat.com/browse/RHEL-184812

Conflicts: only mac80211

commit bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sat Feb 21 16:37:42 2026 -0800

    Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
    
    This was done entirely with mindless brute force, using
    
        git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
            xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'
    
    to convert the new alloc_obj() users that had a simple GFP_KERNEL
    argument to just drop that argument.
    
    Note that due to the extreme simplicity of the scripting, any slightly
    more complex cases spread over multiple lines would not be triggered:
    they definitely exist, but this covers the vast bulk of the cases, and
    the resulting diff is also then easier to check automatically.
    
    For the same reason the 'flex' versions will be done as a separate
    conversion.
    
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
This commit is contained in:
Jose Ignacio Tornos Martinez
2026-07-12 07:53:51 +02:00
parent 0487e7282e
commit 2edb588112
12 changed files with 18 additions and 18 deletions
+2 -2
View File
@@ -395,7 +395,7 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta,
}
/* prepare A-MPDU MLME for Rx aggregation */
tid_agg_rx = kzalloc_obj(*tid_agg_rx, GFP_KERNEL);
tid_agg_rx = kzalloc_obj(*tid_agg_rx);
if (!tid_agg_rx)
goto end;
@@ -411,7 +411,7 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta,
/* prepare reordering buffer */
tid_agg_rx->reorder_buf =
kzalloc_objs(struct sk_buff_head, buf_size, GFP_KERNEL);
kzalloc_objs(struct sk_buff_head, buf_size);
tid_agg_rx->reorder_time =
kcalloc(buf_size, sizeof(unsigned long), GFP_KERNEL);
if (!tid_agg_rx->reorder_buf || !tid_agg_rx->reorder_time) {
+1 -1
View File
@@ -4742,7 +4742,7 @@ static int ieee80211_set_qos_map(struct wiphy *wiphy,
struct mac80211_qos_map *new_qos_map, *old_qos_map;
if (qos_map) {
new_qos_map = kzalloc_obj(*new_qos_map, GFP_KERNEL);
new_qos_map = kzalloc_obj(*new_qos_map);
if (!new_qos_map)
return -ENOMEM;
memcpy(&new_qos_map->qos_map, qos_map, sizeof(*qos_map));
+1 -1
View File
@@ -1614,7 +1614,7 @@ static int ieee80211_chsw_switch_vifs(struct ieee80211_local *local,
lockdep_assert_wiphy(local->hw.wiphy);
vif_chsw = kzalloc_objs(vif_chsw[0], n_vifs, GFP_KERNEL);
vif_chsw = kzalloc_objs(vif_chsw[0], n_vifs);
if (!vif_chsw)
return -ENOMEM;
+1 -1
View File
@@ -298,7 +298,7 @@ __ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw,
if (WARN_ON(local->tpt_led_trigger))
return NULL;
tpt_trig = kzalloc_obj(struct tpt_led_trigger, GFP_KERNEL);
tpt_trig = kzalloc_obj(struct tpt_led_trigger);
if (!tpt_trig)
return NULL;
+1 -1
View File
@@ -296,7 +296,7 @@ static int ieee80211_vif_update_links(struct ieee80211_sub_if_data *sdata,
/* allocate new link structures first */
for_each_set_bit(link_id, &add, IEEE80211_MLD_MAX_NUM_LINKS) {
link = kzalloc_obj(*link, GFP_KERNEL);
link = kzalloc_obj(*link);
if (!link) {
ret = -ENOMEM;
goto free;
+1 -1
View File
@@ -181,7 +181,7 @@ int mesh_rmc_init(struct ieee80211_sub_if_data *sdata)
{
int i;
sdata->u.mesh.rmc = kmalloc_obj(struct mesh_rmc, GFP_KERNEL);
sdata->u.mesh.rmc = kmalloc_obj(struct mesh_rmc);
if (!sdata->u.mesh.rmc)
return -ENOMEM;
sdata->u.mesh.rmc->idx_mask = RMC_BUCKETS - 1;
+1 -1
View File
@@ -10841,7 +10841,7 @@ int ieee80211_mgd_assoc_ml_reconf(struct ieee80211_sub_if_data *sdata,
if (added_links) {
bool uapsd_supported;
data = kzalloc_obj(*data, GFP_KERNEL);
data = kzalloc_obj(*data);
if (!data)
return -ENOMEM;
+1 -1
View File
@@ -579,7 +579,7 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
if (!local->emulate_chanctx && !local->ops->remain_on_channel)
return -EOPNOTSUPP;
roc = kzalloc_obj(*roc, GFP_KERNEL);
roc = kzalloc_obj(*roc);
if (!roc)
return -ENOMEM;
+2 -2
View File
@@ -163,7 +163,7 @@ int ieee80211_rate_control_register(const struct rate_control_ops *ops)
}
}
alg = kzalloc_obj(*alg, GFP_KERNEL);
alg = kzalloc_obj(*alg);
if (alg == NULL) {
mutex_unlock(&rate_ctrl_mutex);
return -ENOMEM;
@@ -263,7 +263,7 @@ rate_control_alloc(const char *name, struct ieee80211_local *local)
{
struct rate_control_ref *ref;
ref = kmalloc_obj(struct rate_control_ref, GFP_KERNEL);
ref = kmalloc_obj(struct rate_control_ref);
if (!ref)
return NULL;
ref->ops = ieee80211_rate_control_ops_get(name);
+3 -3
View File
@@ -903,7 +903,7 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)
goto out_cleanup;
}
sinfo = kzalloc_obj(struct station_info, GFP_KERNEL);
sinfo = kzalloc_obj(struct station_info);
if (!sinfo) {
err = -ENOMEM;
goto out_cleanup;
@@ -1545,7 +1545,7 @@ static void __sta_info_destroy_part2(struct sta_info *sta, bool recalc)
}
}
sinfo = kzalloc_obj(*sinfo, GFP_KERNEL);
sinfo = kzalloc_obj(*sinfo);
if (sinfo)
sta_set_sinfo(sta, sinfo, true);
@@ -3309,7 +3309,7 @@ int ieee80211_sta_allocate_link(struct sta_info *sta, unsigned int link_id)
sta->link[link_id]))
return -EBUSY;
alloc = kzalloc_obj(*alloc, GFP_KERNEL);
alloc = kzalloc_obj(*alloc);
if (!alloc)
return -ENOMEM;
+3 -3
View File
@@ -195,16 +195,16 @@ int t_sdata_init(struct kunit_resource *resource, void *ctx)
struct kunit *test = kunit_get_current_test();
struct t_sdata *t_sdata;
t_sdata = kzalloc_obj(*t_sdata, GFP_KERNEL);
t_sdata = kzalloc_obj(*t_sdata);
KUNIT_ASSERT_NOT_NULL(test, t_sdata);
resource->data = t_sdata;
resource->name = "sdata";
t_sdata->sdata = kzalloc_obj(*t_sdata->sdata, GFP_KERNEL);
t_sdata->sdata = kzalloc_obj(*t_sdata->sdata);
KUNIT_ASSERT_NOT_NULL(test, t_sdata->sdata);
t_sdata->wiphy = kzalloc_obj(*t_sdata->wiphy, GFP_KERNEL);
t_sdata->wiphy = kzalloc_obj(*t_sdata->wiphy);
KUNIT_ASSERT_NOT_NULL(test, t_sdata->wiphy);
strscpy(t_sdata->sdata->name, "kunit");
+1 -1
View File
@@ -1611,7 +1611,7 @@ int ieee80211_txq_setup_flows(struct ieee80211_local *local)
local->cparams.target = MS2TIME(20);
local->cparams.ecn = true;
local->cvars = kvzalloc_objs(local->cvars[0], fq->flows_cnt, GFP_KERNEL);
local->cvars = kvzalloc_objs(local->cvars[0], fq->flows_cnt);
if (!local->cvars) {
spin_lock_bh(&fq->lock);
fq_reset(fq, fq_skb_free_func);