summaryrefslogtreecommitdiff
path: root/drivers/net/wireguard
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-02-21 16:37:42 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2026-02-21 17:09:51 -0800
commitbf4afc53b77aeaa48b5409da5c8da6bb4eff7f43 (patch)
tree01fdd9d27f1b272bef0127966e08eac44d134d0a /drivers/net/wireguard
parente19e1b480ac73c3e62ffebbca1174f0f511f43e7 (diff)
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 'drivers/net/wireguard')
-rw-r--r--drivers/net/wireguard/noise.c2
-rw-r--r--drivers/net/wireguard/peerlookup.c4
-rw-r--r--drivers/net/wireguard/ratelimiter.c4
-rw-r--r--drivers/net/wireguard/selftest/allowedips.c10
-rw-r--r--drivers/net/wireguard/selftest/counter.c2
5 files changed, 11 insertions, 11 deletions
diff --git a/drivers/net/wireguard/noise.c b/drivers/net/wireguard/noise.c
index 994b7c6f0613..9c0a09bf6c95 100644
--- a/drivers/net/wireguard/noise.c
+++ b/drivers/net/wireguard/noise.c
@@ -97,7 +97,7 @@ void wg_noise_handshake_clear(struct noise_handshake *handshake)
static struct noise_keypair *keypair_create(struct wg_peer *peer)
{
- struct noise_keypair *keypair = kzalloc_obj(*keypair, GFP_KERNEL);
+ struct noise_keypair *keypair = kzalloc_obj(*keypair);
if (unlikely(!keypair))
return NULL;
diff --git a/drivers/net/wireguard/peerlookup.c b/drivers/net/wireguard/peerlookup.c
index 5ae4e6c5e7c9..99651a86ac95 100644
--- a/drivers/net/wireguard/peerlookup.c
+++ b/drivers/net/wireguard/peerlookup.c
@@ -21,7 +21,7 @@ static struct hlist_head *pubkey_bucket(struct pubkey_hashtable *table,
struct pubkey_hashtable *wg_pubkey_hashtable_alloc(void)
{
- struct pubkey_hashtable *table = kvmalloc_obj(*table, GFP_KERNEL);
+ struct pubkey_hashtable *table = kvmalloc_obj(*table);
if (!table)
return NULL;
@@ -82,7 +82,7 @@ static struct hlist_head *index_bucket(struct index_hashtable *table,
struct index_hashtable *wg_index_hashtable_alloc(void)
{
- struct index_hashtable *table = kvmalloc_obj(*table, GFP_KERNEL);
+ struct index_hashtable *table = kvmalloc_obj(*table);
if (!table)
return NULL;
diff --git a/drivers/net/wireguard/ratelimiter.c b/drivers/net/wireguard/ratelimiter.c
index 13d532a44294..2b3867f692ab 100644
--- a/drivers/net/wireguard/ratelimiter.c
+++ b/drivers/net/wireguard/ratelimiter.c
@@ -176,12 +176,12 @@ int wg_ratelimiter_init(void)
(1U << 14) / sizeof(struct hlist_head)));
max_entries = table_size * 8;
- table_v4 = kvzalloc_objs(*table_v4, table_size, GFP_KERNEL);
+ table_v4 = kvzalloc_objs(*table_v4, table_size);
if (unlikely(!table_v4))
goto err_kmemcache;
#if IS_ENABLED(CONFIG_IPV6)
- table_v6 = kvzalloc_objs(*table_v6, table_size, GFP_KERNEL);
+ table_v6 = kvzalloc_objs(*table_v6, table_size);
if (unlikely(!table_v6)) {
kvfree(table_v4);
goto err_kmemcache;
diff --git a/drivers/net/wireguard/selftest/allowedips.c b/drivers/net/wireguard/selftest/allowedips.c
index 6c7c79e39ad4..2da3008c3a01 100644
--- a/drivers/net/wireguard/selftest/allowedips.c
+++ b/drivers/net/wireguard/selftest/allowedips.c
@@ -181,7 +181,7 @@ static __init int
horrible_allowedips_insert_v4(struct horrible_allowedips *table,
struct in_addr *ip, u8 cidr, void *value)
{
- struct horrible_allowedips_node *node = kzalloc_obj(*node, GFP_KERNEL);
+ struct horrible_allowedips_node *node = kzalloc_obj(*node);
if (unlikely(!node))
return -ENOMEM;
@@ -198,7 +198,7 @@ static __init int
horrible_allowedips_insert_v6(struct horrible_allowedips *table,
struct in6_addr *ip, u8 cidr, void *value)
{
- struct horrible_allowedips_node *node = kzalloc_obj(*node, GFP_KERNEL);
+ struct horrible_allowedips_node *node = kzalloc_obj(*node);
if (unlikely(!node))
return -ENOMEM;
@@ -266,13 +266,13 @@ static __init bool randomized_test(void)
wg_allowedips_init(&t);
horrible_allowedips_init(&h);
- peers = kzalloc_objs(*peers, NUM_PEERS, GFP_KERNEL);
+ peers = kzalloc_objs(*peers, NUM_PEERS);
if (unlikely(!peers)) {
pr_err("allowedips random self-test malloc: FAIL\n");
goto free;
}
for (i = 0; i < NUM_PEERS; ++i) {
- peers[i] = kzalloc_obj(*peers[i], GFP_KERNEL);
+ peers[i] = kzalloc_obj(*peers[i]);
if (unlikely(!peers[i])) {
pr_err("allowedips random self-test malloc: FAIL\n");
goto free;
@@ -447,7 +447,7 @@ static __init inline struct in6_addr *ip6(u32 a, u32 b, u32 c, u32 d)
static __init struct wg_peer *init_peer(void)
{
- struct wg_peer *peer = kzalloc_obj(*peer, GFP_KERNEL);
+ struct wg_peer *peer = kzalloc_obj(*peer);
if (!peer)
return NULL;
diff --git a/drivers/net/wireguard/selftest/counter.c b/drivers/net/wireguard/selftest/counter.c
index 13c5535a1fd6..8595ab697869 100644
--- a/drivers/net/wireguard/selftest/counter.c
+++ b/drivers/net/wireguard/selftest/counter.c
@@ -10,7 +10,7 @@ bool __init wg_packet_counter_selftest(void)
unsigned int test_num = 0, i;
bool success = true;
- counter = kmalloc_obj(*counter, GFP_KERNEL);
+ counter = kmalloc_obj(*counter);
if (unlikely(!counter)) {
pr_err("nonce counter self-test malloc: FAIL\n");
return false;