diff options
author | Erik Hugne <erik.hugne@ericsson.com> | 2012-06-29 00:16:37 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2012-07-13 19:24:44 -0400 |
commit | 2cf8aa19fe8bec578b707daa383ebff80e3f81a1 (patch) | |
tree | bd800510d0e01d441e25dd476228462106eaa9ea /net/tipc/name_table.c | |
parent | f705ab956b3a0377181c9d73b235ad5bf4020937 (diff) |
tipc: use standard printk shortcut macros (pr_err etc.)
All messages should go directly to the kernel log. The TIPC
specific error, warning, info and debug trace macro's are
removed and all references replaced with pr_err, pr_warn,
pr_info and pr_debug.
Commonly used sub-strings are explicitly declared as a const
char to reduce .text size.
Note that this means the debug messages (changed to pr_debug),
are now enabled through dynamic debugging, instead of a TIPC
specific Kconfig option (TIPC_DEBUG). The latter will be
phased out completely
Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
[PG: use pr_fmt as suggested by Joe Perches <joe@perches.com>]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc/name_table.c')
-rw-r--r-- | net/tipc/name_table.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c index cade0acda4ef..c8b0b5c3c56e 100644 --- a/net/tipc/name_table.c +++ b/net/tipc/name_table.c | |||
@@ -126,7 +126,7 @@ static struct publication *publ_create(u32 type, u32 lower, u32 upper, | |||
126 | { | 126 | { |
127 | struct publication *publ = kzalloc(sizeof(*publ), GFP_ATOMIC); | 127 | struct publication *publ = kzalloc(sizeof(*publ), GFP_ATOMIC); |
128 | if (publ == NULL) { | 128 | if (publ == NULL) { |
129 | warn("Publication creation failure, no memory\n"); | 129 | pr_warn("Publication creation failure, no memory\n"); |
130 | return NULL; | 130 | return NULL; |
131 | } | 131 | } |
132 | 132 | ||
@@ -163,7 +163,7 @@ static struct name_seq *tipc_nameseq_create(u32 type, struct hlist_head *seq_hea | |||
163 | struct sub_seq *sseq = tipc_subseq_alloc(1); | 163 | struct sub_seq *sseq = tipc_subseq_alloc(1); |
164 | 164 | ||
165 | if (!nseq || !sseq) { | 165 | if (!nseq || !sseq) { |
166 | warn("Name sequence creation failed, no memory\n"); | 166 | pr_warn("Name sequence creation failed, no memory\n"); |
167 | kfree(nseq); | 167 | kfree(nseq); |
168 | kfree(sseq); | 168 | kfree(sseq); |
169 | return NULL; | 169 | return NULL; |
@@ -263,8 +263,8 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq, | |||
263 | 263 | ||
264 | /* Lower end overlaps existing entry => need an exact match */ | 264 | /* Lower end overlaps existing entry => need an exact match */ |
265 | if ((sseq->lower != lower) || (sseq->upper != upper)) { | 265 | if ((sseq->lower != lower) || (sseq->upper != upper)) { |
266 | warn("Cannot publish {%u,%u,%u}, overlap error\n", | 266 | pr_warn("Cannot publish {%u,%u,%u}, overlap error\n", |
267 | type, lower, upper); | 267 | type, lower, upper); |
268 | return NULL; | 268 | return NULL; |
269 | } | 269 | } |
270 | 270 | ||
@@ -286,8 +286,8 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq, | |||
286 | /* Fail if upper end overlaps into an existing entry */ | 286 | /* Fail if upper end overlaps into an existing entry */ |
287 | if ((inspos < nseq->first_free) && | 287 | if ((inspos < nseq->first_free) && |
288 | (upper >= nseq->sseqs[inspos].lower)) { | 288 | (upper >= nseq->sseqs[inspos].lower)) { |
289 | warn("Cannot publish {%u,%u,%u}, overlap error\n", | 289 | pr_warn("Cannot publish {%u,%u,%u}, overlap error\n", |
290 | type, lower, upper); | 290 | type, lower, upper); |
291 | return NULL; | 291 | return NULL; |
292 | } | 292 | } |
293 | 293 | ||
@@ -296,8 +296,8 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq, | |||
296 | struct sub_seq *sseqs = tipc_subseq_alloc(nseq->alloc * 2); | 296 | struct sub_seq *sseqs = tipc_subseq_alloc(nseq->alloc * 2); |
297 | 297 | ||
298 | if (!sseqs) { | 298 | if (!sseqs) { |
299 | warn("Cannot publish {%u,%u,%u}, no memory\n", | 299 | pr_warn("Cannot publish {%u,%u,%u}, no memory\n", |
300 | type, lower, upper); | 300 | type, lower, upper); |
301 | return NULL; | 301 | return NULL; |
302 | } | 302 | } |
303 | memcpy(sseqs, nseq->sseqs, | 303 | memcpy(sseqs, nseq->sseqs, |
@@ -309,8 +309,8 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq, | |||
309 | 309 | ||
310 | info = kzalloc(sizeof(*info), GFP_ATOMIC); | 310 | info = kzalloc(sizeof(*info), GFP_ATOMIC); |
311 | if (!info) { | 311 | if (!info) { |
312 | warn("Cannot publish {%u,%u,%u}, no memory\n", | 312 | pr_warn("Cannot publish {%u,%u,%u}, no memory\n", |
313 | type, lower, upper); | 313 | type, lower, upper); |
314 | return NULL; | 314 | return NULL; |
315 | } | 315 | } |
316 | 316 | ||
@@ -492,8 +492,8 @@ struct publication *tipc_nametbl_insert_publ(u32 type, u32 lower, u32 upper, | |||
492 | 492 | ||
493 | if ((scope < TIPC_ZONE_SCOPE) || (scope > TIPC_NODE_SCOPE) || | 493 | if ((scope < TIPC_ZONE_SCOPE) || (scope > TIPC_NODE_SCOPE) || |
494 | (lower > upper)) { | 494 | (lower > upper)) { |
495 | dbg("Failed to publish illegal {%u,%u,%u} with scope %u\n", | 495 | pr_debug("Failed to publish illegal {%u,%u,%u} with scope %u\n", |
496 | type, lower, upper, scope); | 496 | type, lower, upper, scope); |
497 | return NULL; | 497 | return NULL; |
498 | } | 498 | } |
499 | 499 | ||
@@ -668,8 +668,8 @@ struct publication *tipc_nametbl_publish(u32 type, u32 lower, u32 upper, | |||
668 | struct publication *publ; | 668 | struct publication *publ; |
669 | 669 | ||
670 | if (table.local_publ_count >= tipc_max_publications) { | 670 | if (table.local_publ_count >= tipc_max_publications) { |
671 | warn("Publication failed, local publication limit reached (%u)\n", | 671 | pr_warn("Publication failed, local publication limit reached (%u)\n", |
672 | tipc_max_publications); | 672 | tipc_max_publications); |
673 | return NULL; | 673 | return NULL; |
674 | } | 674 | } |
675 | 675 | ||
@@ -702,9 +702,9 @@ int tipc_nametbl_withdraw(u32 type, u32 lower, u32 ref, u32 key) | |||
702 | return 1; | 702 | return 1; |
703 | } | 703 | } |
704 | write_unlock_bh(&tipc_nametbl_lock); | 704 | write_unlock_bh(&tipc_nametbl_lock); |
705 | err("Unable to remove local publication\n" | 705 | pr_err("Unable to remove local publication\n" |
706 | "(type=%u, lower=%u, ref=%u, key=%u)\n", | 706 | "(type=%u, lower=%u, ref=%u, key=%u)\n", |
707 | type, lower, ref, key); | 707 | type, lower, ref, key); |
708 | return 0; | 708 | return 0; |
709 | } | 709 | } |
710 | 710 | ||
@@ -725,8 +725,8 @@ void tipc_nametbl_subscribe(struct tipc_subscription *s) | |||
725 | tipc_nameseq_subscribe(seq, s); | 725 | tipc_nameseq_subscribe(seq, s); |
726 | spin_unlock_bh(&seq->lock); | 726 | spin_unlock_bh(&seq->lock); |
727 | } else { | 727 | } else { |
728 | warn("Failed to create subscription for {%u,%u,%u}\n", | 728 | pr_warn("Failed to create subscription for {%u,%u,%u}\n", |
729 | s->seq.type, s->seq.lower, s->seq.upper); | 729 | s->seq.type, s->seq.lower, s->seq.upper); |
730 | } | 730 | } |
731 | write_unlock_bh(&tipc_nametbl_lock); | 731 | write_unlock_bh(&tipc_nametbl_lock); |
732 | } | 732 | } |
@@ -942,7 +942,7 @@ void tipc_nametbl_stop(void) | |||
942 | for (i = 0; i < tipc_nametbl_size; i++) { | 942 | for (i = 0; i < tipc_nametbl_size; i++) { |
943 | if (hlist_empty(&table.types[i])) | 943 | if (hlist_empty(&table.types[i])) |
944 | continue; | 944 | continue; |
945 | err("tipc_nametbl_stop(): orphaned hash chain detected\n"); | 945 | pr_err("nametbl_stop(): orphaned hash chain detected\n"); |
946 | break; | 946 | break; |
947 | } | 947 | } |
948 | kfree(table.types); | 948 | kfree(table.types); |