diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-10-25 17:13:46 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-10-31 17:25:23 +0100 |
commit | 7491cd4c22601eb0c3bedfea740f2aec3b8372ed (patch) | |
tree | e5b8c3adf9e17e9abf3c028ea163ee7840659826 /src/selftest | |
parent | peer: store total number of peers instead of iterating (diff) | |
download | wireguard-monolithic-historical-7491cd4c22601eb0c3bedfea740f2aec3b8372ed.tar.xz wireguard-monolithic-historical-7491cd4c22601eb0c3bedfea740f2aec3b8372ed.zip |
global: infuriating kernel iterator style
One types:
for (i = 0 ...
So one should also type:
for_each_obj (obj ...
But the upstream kernel style guidelines are insane, and so we must
instead do:
for_each_obj(obj ...
Ugly, but one must choose his battles wisely.
Diffstat (limited to 'src/selftest')
-rw-r--r-- | src/selftest/routingtable.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/selftest/routingtable.h b/src/selftest/routingtable.h index 473f0f9..434c6fc 100644 --- a/src/selftest/routingtable.h +++ b/src/selftest/routingtable.h @@ -65,7 +65,7 @@ static __init void horrible_routing_table_free(struct horrible_routing_table *ta { struct hlist_node *h; struct horrible_routing_table_node *node; - hlist_for_each_entry_safe (node, h, &table->head, table) { + hlist_for_each_entry_safe(node, h, &table->head, table) { hlist_del(&node->table); kfree(node); } @@ -112,7 +112,7 @@ static __init void horrible_insert_ordered(struct horrible_routing_table *table, { struct horrible_routing_table_node *other = NULL, *where = NULL; uint8_t my_cidr = horrible_mask_to_cidr(node->mask); - hlist_for_each_entry (other, &table->head, table) { + hlist_for_each_entry(other, &table->head, table) { if (!memcmp(&other->mask, &node->mask, sizeof(union nf_inet_addr)) && !memcmp(&other->ip, &node->ip, sizeof(union nf_inet_addr)) && other->ip_version == node->ip_version) { @@ -161,7 +161,7 @@ static __init void *horrible_routing_table_lookup_v4(struct horrible_routing_tab { struct horrible_routing_table_node *node; void *ret = NULL; - hlist_for_each_entry (node, &table->head, table) { + hlist_for_each_entry(node, &table->head, table) { if (node->ip_version != 4) continue; if (horrible_match_v4(node, ip)) { @@ -175,7 +175,7 @@ static __init void *horrible_routing_table_lookup_v6(struct horrible_routing_tab { struct horrible_routing_table_node *node; void *ret = NULL; - hlist_for_each_entry (node, &table->head, table) { + hlist_for_each_entry(node, &table->head, table) { if (node->ip_version != 6) continue; if (horrible_match_v6(node, ip)) { |