diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 16:37:42 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 17:09:51 -0800 |
| commit | bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43 (patch) | |
| tree | 01fdd9d27f1b272bef0127966e08eac44d134d0a /net/mac80211 | |
| parent | e19e1b480ac73c3e62ffebbca1174f0f511f43e7 (diff) | |
| download | lwn-bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43.tar.gz lwn-bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43.zip | |
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>
Diffstat (limited to 'net/mac80211')
| -rw-r--r-- | net/mac80211/agg-rx.c | 4 | ||||
| -rw-r--r-- | net/mac80211/cfg.c | 2 | ||||
| -rw-r--r-- | net/mac80211/chan.c | 2 | ||||
| -rw-r--r-- | net/mac80211/led.c | 2 | ||||
| -rw-r--r-- | net/mac80211/link.c | 2 | ||||
| -rw-r--r-- | net/mac80211/mesh.c | 2 | ||||
| -rw-r--r-- | net/mac80211/mlme.c | 2 | ||||
| -rw-r--r-- | net/mac80211/offchannel.c | 2 | ||||
| -rw-r--r-- | net/mac80211/rate.c | 4 | ||||
| -rw-r--r-- | net/mac80211/sta_info.c | 6 | ||||
| -rw-r--r-- | net/mac80211/tests/util.c | 6 | ||||
| -rw-r--r-- | net/mac80211/tx.c | 2 |
12 files changed, 18 insertions, 18 deletions
diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c index e8670a46371c..f301a8622bee 100644 --- a/net/mac80211/agg-rx.c +++ b/net/mac80211/agg-rx.c @@ -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) { diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index d1adbc4984d1..8b76525c56ee 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -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)); diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c index 60654b0b542d..4447cf03c41b 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c @@ -1612,7 +1612,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; diff --git a/net/mac80211/led.c b/net/mac80211/led.c index f93fe928c4bc..b5600d223452 100644 --- a/net/mac80211/led.c +++ b/net/mac80211/led.c @@ -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; diff --git a/net/mac80211/link.c b/net/mac80211/link.c index 7102d113d89d..f589450754a9 100644 --- a/net/mac80211/link.c +++ b/net/mac80211/link.c @@ -295,7 +295,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; diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index a7bd4dd9aa19..a7e71eef3660 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c @@ -178,7 +178,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; diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index c1d0808f2545..e8edcee0e08a 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -10839,7 +10839,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; diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c index 00ef339f7de4..f60f6a58948b 100644 --- a/net/mac80211/offchannel.c +++ b/net/mac80211/offchannel.c @@ -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; diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index 3ae891be800b..31af7dd6aedc 100644 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c @@ -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); diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 6abcf410a0ca..6dc22f1593be 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -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); @@ -3306,7 +3306,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; diff --git a/net/mac80211/tests/util.c b/net/mac80211/tests/util.c index cddc46eeb648..0b01264af577 100644 --- a/net/mac80211/tests/util.c +++ b/net/mac80211/tests/util.c @@ -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"); diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index a3113e1d9829..8cdbd417d7be 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -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); |
