Skip to content

Commit b167a37

Browse files
JoePerchesdavem330
authored andcommitted
netfilter: Convert pr_warning to pr_warn
Use the more common pr_warn. Other miscellanea: o Coalesce formats o Realign arguments Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 47c4cfc commit b167a37

5 files changed

Lines changed: 35 additions & 40 deletions

File tree

‎net/netfilter/ipset/ip_set_core.c‎

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ load_settype(const char *name)
101101
nfnl_unlock(NFNL_SUBSYS_IPSET);
102102
pr_debug("try to load ip_set_%s\n", name);
103103
if (request_module("ip_set_%s", name) < 0) {
104-
pr_warning("Can't find ip_set type %s\n", name);
104+
pr_warn("Can't find ip_set type %s\n", name);
105105
nfnl_lock(NFNL_SUBSYS_IPSET);
106106
return false;
107107
}
@@ -195,20 +195,19 @@ ip_set_type_register(struct ip_set_type *type)
195195
int ret = 0;
196196

197197
if (type->protocol != IPSET_PROTOCOL) {
198-
pr_warning("ip_set type %s, family %s, revision %u:%u uses "
199-
"wrong protocol version %u (want %u)\n",
200-
type->name, family_name(type->family),
201-
type->revision_min, type->revision_max,
202-
type->protocol, IPSET_PROTOCOL);
198+
pr_warn("ip_set type %s, family %s, revision %u:%u uses wrong protocol version %u (want %u)\n",
199+
type->name, family_name(type->family),
200+
type->revision_min, type->revision_max,
201+
type->protocol, IPSET_PROTOCOL);
203202
return -EINVAL;
204203
}
205204

206205
ip_set_type_lock();
207206
if (find_set_type(type->name, type->family, type->revision_min)) {
208207
/* Duplicate! */
209-
pr_warning("ip_set type %s, family %s with revision min %u "
210-
"already registered!\n", type->name,
211-
family_name(type->family), type->revision_min);
208+
pr_warn("ip_set type %s, family %s with revision min %u already registered!\n",
209+
type->name, family_name(type->family),
210+
type->revision_min);
212211
ret = -EINVAL;
213212
goto unlock;
214213
}
@@ -228,9 +227,9 @@ ip_set_type_unregister(struct ip_set_type *type)
228227
{
229228
ip_set_type_lock();
230229
if (!find_set_type(type->name, type->family, type->revision_min)) {
231-
pr_warning("ip_set type %s, family %s with revision min %u "
232-
"not registered\n", type->name,
233-
family_name(type->family), type->revision_min);
230+
pr_warn("ip_set type %s, family %s with revision min %u not registered\n",
231+
type->name, family_name(type->family),
232+
type->revision_min);
234233
goto unlock;
235234
}
236235
list_del_rcu(&type->list);

‎net/netfilter/ipset/ip_set_hash_gen.h‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,8 @@ mtype_resize(struct ip_set *set, bool retried)
565565
set->name, orig->htable_bits, htable_bits, orig);
566566
if (!htable_bits) {
567567
/* In case we have plenty of memory :-) */
568-
pr_warning("Cannot increase the hashsize of set %s further\n",
569-
set->name);
568+
pr_warn("Cannot increase the hashsize of set %s further\n",
569+
set->name);
570570
return -IPSET_ERR_HASH_FULL;
571571
}
572572
t = ip_set_alloc(sizeof(*t)
@@ -651,8 +651,8 @@ mtype_add(struct ip_set *set, void *value, const struct ip_set_ext *ext,
651651

652652
if (h->elements >= h->maxelem) {
653653
if (net_ratelimit())
654-
pr_warning("Set %s is full, maxelem %u reached\n",
655-
set->name, h->maxelem);
654+
pr_warn("Set %s is full, maxelem %u reached\n",
655+
set->name, h->maxelem);
656656
return -IPSET_ERR_HASH_FULL;
657657
}
658658

@@ -998,8 +998,8 @@ mtype_list(const struct ip_set *set,
998998
nla_put_failure:
999999
nlmsg_trim(skb, incomplete);
10001000
if (unlikely(first == cb->args[IPSET_CB_ARG0])) {
1001-
pr_warning("Can't list set %s: one bucket does not fit into "
1002-
"a message. Please report it!\n", set->name);
1001+
pr_warn("Can't list set %s: one bucket does not fit into a message. Please report it!\n",
1002+
set->name);
10031003
cb->args[IPSET_CB_ARG0] = 0;
10041004
return -EMSGSIZE;
10051005
}

‎net/netfilter/xt_connbytes.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static int connbytes_mt_check(const struct xt_mtchk_param *par)
120120
* accounting is enabled, so complain in the hope that someone notices.
121121
*/
122122
if (!nf_ct_acct_enabled(par->net)) {
123-
pr_warning("Forcing CT accounting to be enabled\n");
123+
pr_warn("Forcing CT accounting to be enabled\n");
124124
nf_ct_set_acct(par->net, true);
125125
}
126126

‎net/netfilter/xt_hashlimit.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ static int __init hashlimit_mt_init(void)
943943
sizeof(struct dsthash_ent), 0, 0,
944944
NULL);
945945
if (!hashlimit_cachep) {
946-
pr_warning("unable to create slab cache\n");
946+
pr_warn("unable to create slab cache\n");
947947
goto err2;
948948
}
949949
return 0;

‎net/netfilter/xt_set.c‎

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,12 @@ set_match_v0_checkentry(const struct xt_mtchk_param *par)
8484
index = ip_set_nfnl_get_byindex(par->net, info->match_set.index);
8585

8686
if (index == IPSET_INVALID_ID) {
87-
pr_warning("Cannot find set identified by id %u to match\n",
88-
info->match_set.index);
87+
pr_warn("Cannot find set identified by id %u to match\n",
88+
info->match_set.index);
8989
return -ENOENT;
9090
}
9191
if (info->match_set.u.flags[IPSET_DIM_MAX-1] != 0) {
92-
pr_warning("Protocol error: set match dimension "
93-
"is over the limit!\n");
92+
pr_warn("Protocol error: set match dimension is over the limit!\n");
9493
ip_set_nfnl_put(par->net, info->match_set.index);
9594
return -ERANGE;
9695
}
@@ -134,13 +133,12 @@ set_match_v1_checkentry(const struct xt_mtchk_param *par)
134133
index = ip_set_nfnl_get_byindex(par->net, info->match_set.index);
135134

136135
if (index == IPSET_INVALID_ID) {
137-
pr_warning("Cannot find set identified by id %u to match\n",
138-
info->match_set.index);
136+
pr_warn("Cannot find set identified by id %u to match\n",
137+
info->match_set.index);
139138
return -ENOENT;
140139
}
141140
if (info->match_set.dim > IPSET_DIM_MAX) {
142-
pr_warning("Protocol error: set match dimension "
143-
"is over the limit!\n");
141+
pr_warn("Protocol error: set match dimension is over the limit!\n");
144142
ip_set_nfnl_put(par->net, info->match_set.index);
145143
return -ERANGE;
146144
}
@@ -230,26 +228,25 @@ set_target_v0_checkentry(const struct xt_tgchk_param *par)
230228
if (info->add_set.index != IPSET_INVALID_ID) {
231229
index = ip_set_nfnl_get_byindex(par->net, info->add_set.index);
232230
if (index == IPSET_INVALID_ID) {
233-
pr_warning("Cannot find add_set index %u as target\n",
234-
info->add_set.index);
231+
pr_warn("Cannot find add_set index %u as target\n",
232+
info->add_set.index);
235233
return -ENOENT;
236234
}
237235
}
238236

239237
if (info->del_set.index != IPSET_INVALID_ID) {
240238
index = ip_set_nfnl_get_byindex(par->net, info->del_set.index);
241239
if (index == IPSET_INVALID_ID) {
242-
pr_warning("Cannot find del_set index %u as target\n",
243-
info->del_set.index);
240+
pr_warn("Cannot find del_set index %u as target\n",
241+
info->del_set.index);
244242
if (info->add_set.index != IPSET_INVALID_ID)
245243
ip_set_nfnl_put(par->net, info->add_set.index);
246244
return -ENOENT;
247245
}
248246
}
249247
if (info->add_set.u.flags[IPSET_DIM_MAX-1] != 0 ||
250248
info->del_set.u.flags[IPSET_DIM_MAX-1] != 0) {
251-
pr_warning("Protocol error: SET target dimension "
252-
"is over the limit!\n");
249+
pr_warn("Protocol error: SET target dimension is over the limit!\n");
253250
if (info->add_set.index != IPSET_INVALID_ID)
254251
ip_set_nfnl_put(par->net, info->add_set.index);
255252
if (info->del_set.index != IPSET_INVALID_ID)
@@ -303,26 +300,25 @@ set_target_v1_checkentry(const struct xt_tgchk_param *par)
303300
if (info->add_set.index != IPSET_INVALID_ID) {
304301
index = ip_set_nfnl_get_byindex(par->net, info->add_set.index);
305302
if (index == IPSET_INVALID_ID) {
306-
pr_warning("Cannot find add_set index %u as target\n",
307-
info->add_set.index);
303+
pr_warn("Cannot find add_set index %u as target\n",
304+
info->add_set.index);
308305
return -ENOENT;
309306
}
310307
}
311308

312309
if (info->del_set.index != IPSET_INVALID_ID) {
313310
index = ip_set_nfnl_get_byindex(par->net, info->del_set.index);
314311
if (index == IPSET_INVALID_ID) {
315-
pr_warning("Cannot find del_set index %u as target\n",
316-
info->del_set.index);
312+
pr_warn("Cannot find del_set index %u as target\n",
313+
info->del_set.index);
317314
if (info->add_set.index != IPSET_INVALID_ID)
318315
ip_set_nfnl_put(par->net, info->add_set.index);
319316
return -ENOENT;
320317
}
321318
}
322319
if (info->add_set.dim > IPSET_DIM_MAX ||
323320
info->del_set.dim > IPSET_DIM_MAX) {
324-
pr_warning("Protocol error: SET target dimension "
325-
"is over the limit!\n");
321+
pr_warn("Protocol error: SET target dimension is over the limit!\n");
326322
if (info->add_set.index != IPSET_INVALID_ID)
327323
ip_set_nfnl_put(par->net, info->add_set.index);
328324
if (info->del_set.index != IPSET_INVALID_ID)

0 commit comments

Comments
 (0)