Commit 2cf8aa19 authored by Erik Hugne's avatar Erik Hugne Committed by Paul Gortmaker

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: default avatarErik Hugne <erik.hugne@ericsson.com>
Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
[PG: use pr_fmt as suggested by Joe Perches <joe@perches.com>]
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
parent f705ab95
...@@ -880,7 +880,7 @@ void tipc_port_list_add(struct tipc_port_list *pl_ptr, u32 port) ...@@ -880,7 +880,7 @@ void tipc_port_list_add(struct tipc_port_list *pl_ptr, u32 port)
if (!item->next) { if (!item->next) {
item->next = kmalloc(sizeof(*item), GFP_ATOMIC); item->next = kmalloc(sizeof(*item), GFP_ATOMIC);
if (!item->next) { if (!item->next) {
warn("Incomplete multicast delivery, no memory\n"); pr_warn("Incomplete multicast delivery, no memory\n");
return; return;
} }
item->next->next = NULL; item->next->next = NULL;
......
...@@ -123,7 +123,7 @@ int tipc_register_media(struct tipc_media *m_ptr) ...@@ -123,7 +123,7 @@ int tipc_register_media(struct tipc_media *m_ptr)
exit: exit:
write_unlock_bh(&tipc_net_lock); write_unlock_bh(&tipc_net_lock);
if (res) if (res)
warn("Media <%s> registration error\n", m_ptr->name); pr_warn("Media <%s> registration error\n", m_ptr->name);
return res; return res;
} }
...@@ -418,12 +418,12 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority) ...@@ -418,12 +418,12 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority)
int res = -EINVAL; int res = -EINVAL;
if (!tipc_own_addr) { if (!tipc_own_addr) {
warn("Bearer <%s> rejected, not supported in standalone mode\n", pr_warn("Bearer <%s> rejected, not supported in standalone mode\n",
name); name);
return -ENOPROTOOPT; return -ENOPROTOOPT;
} }
if (!bearer_name_validate(name, &b_names)) { if (!bearer_name_validate(name, &b_names)) {
warn("Bearer <%s> rejected, illegal name\n", name); pr_warn("Bearer <%s> rejected, illegal name\n", name);
return -EINVAL; return -EINVAL;
} }
if (tipc_addr_domain_valid(disc_domain) && if (tipc_addr_domain_valid(disc_domain) &&
...@@ -435,12 +435,13 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority) ...@@ -435,12 +435,13 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority)
res = 0; /* accept specified node in own cluster */ res = 0; /* accept specified node in own cluster */
} }
if (res) { if (res) {
warn("Bearer <%s> rejected, illegal discovery domain\n", name); pr_warn("Bearer <%s> rejected, illegal discovery domain\n",
name);
return -EINVAL; return -EINVAL;
} }
if ((priority > TIPC_MAX_LINK_PRI) && if ((priority > TIPC_MAX_LINK_PRI) &&
(priority != TIPC_MEDIA_LINK_PRI)) { (priority != TIPC_MEDIA_LINK_PRI)) {
warn("Bearer <%s> rejected, illegal priority\n", name); pr_warn("Bearer <%s> rejected, illegal priority\n", name);
return -EINVAL; return -EINVAL;
} }
...@@ -448,8 +449,8 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority) ...@@ -448,8 +449,8 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority)
m_ptr = tipc_media_find(b_names.media_name); m_ptr = tipc_media_find(b_names.media_name);
if (!m_ptr) { if (!m_ptr) {
warn("Bearer <%s> rejected, media <%s> not registered\n", name, pr_warn("Bearer <%s> rejected, media <%s> not registered\n",
b_names.media_name); name, b_names.media_name);
goto exit; goto exit;
} }
...@@ -465,24 +466,25 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority) ...@@ -465,24 +466,25 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority)
continue; continue;
} }
if (!strcmp(name, tipc_bearers[i].name)) { if (!strcmp(name, tipc_bearers[i].name)) {
warn("Bearer <%s> rejected, already enabled\n", name); pr_warn("Bearer <%s> rejected, already enabled\n",
name);
goto exit; goto exit;
} }
if ((tipc_bearers[i].priority == priority) && if ((tipc_bearers[i].priority == priority) &&
(++with_this_prio > 2)) { (++with_this_prio > 2)) {
if (priority-- == 0) { if (priority-- == 0) {
warn("Bearer <%s> rejected, duplicate priority\n", pr_warn("Bearer <%s> rejected, duplicate priority\n",
name); name);
goto exit; goto exit;
} }
warn("Bearer <%s> priority adjustment required %u->%u\n", pr_warn("Bearer <%s> priority adjustment required %u->%u\n",
name, priority + 1, priority); name, priority + 1, priority);
goto restart; goto restart;
} }
} }
if (bearer_id >= MAX_BEARERS) { if (bearer_id >= MAX_BEARERS) {
warn("Bearer <%s> rejected, bearer limit reached (%u)\n", pr_warn("Bearer <%s> rejected, bearer limit reached (%u)\n",
name, MAX_BEARERS); name, MAX_BEARERS);
goto exit; goto exit;
} }
...@@ -490,7 +492,8 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority) ...@@ -490,7 +492,8 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority)
strcpy(b_ptr->name, name); strcpy(b_ptr->name, name);
res = m_ptr->enable_bearer(b_ptr); res = m_ptr->enable_bearer(b_ptr);
if (res) { if (res) {
warn("Bearer <%s> rejected, enable failure (%d)\n", name, -res); pr_warn("Bearer <%s> rejected, enable failure (%d)\n",
name, -res);
goto exit; goto exit;
} }
...@@ -508,12 +511,13 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority) ...@@ -508,12 +511,13 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority)
res = tipc_disc_create(b_ptr, &m_ptr->bcast_addr, disc_domain); res = tipc_disc_create(b_ptr, &m_ptr->bcast_addr, disc_domain);
if (res) { if (res) {
bearer_disable(b_ptr); bearer_disable(b_ptr);
warn("Bearer <%s> rejected, discovery object creation failed\n", pr_warn("Bearer <%s> rejected, discovery object creation failed\n",
name); name);
goto exit; goto exit;
} }
info("Enabled bearer <%s>, discovery domain %s, priority %u\n", pr_info("Enabled bearer <%s>, discovery domain %s, priority %u\n",
name, tipc_addr_string_fill(addr_string, disc_domain), priority); name,
tipc_addr_string_fill(addr_string, disc_domain), priority);
exit: exit:
write_unlock_bh(&tipc_net_lock); write_unlock_bh(&tipc_net_lock);
return res; return res;
...@@ -531,12 +535,12 @@ int tipc_block_bearer(const char *name) ...@@ -531,12 +535,12 @@ int tipc_block_bearer(const char *name)
read_lock_bh(&tipc_net_lock); read_lock_bh(&tipc_net_lock);
b_ptr = tipc_bearer_find(name); b_ptr = tipc_bearer_find(name);
if (!b_ptr) { if (!b_ptr) {
warn("Attempt to block unknown bearer <%s>\n", name); pr_warn("Attempt to block unknown bearer <%s>\n", name);
read_unlock_bh(&tipc_net_lock); read_unlock_bh(&tipc_net_lock);
return -EINVAL; return -EINVAL;
} }
info("Blocking bearer <%s>\n", name); pr_info("Blocking bearer <%s>\n", name);
spin_lock_bh(&b_ptr->lock); spin_lock_bh(&b_ptr->lock);
b_ptr->blocked = 1; b_ptr->blocked = 1;
list_splice_init(&b_ptr->cong_links, &b_ptr->links); list_splice_init(&b_ptr->cong_links, &b_ptr->links);
...@@ -562,7 +566,7 @@ static void bearer_disable(struct tipc_bearer *b_ptr) ...@@ -562,7 +566,7 @@ static void bearer_disable(struct tipc_bearer *b_ptr)
struct tipc_link *l_ptr; struct tipc_link *l_ptr;
struct tipc_link *temp_l_ptr; struct tipc_link *temp_l_ptr;
info("Disabling bearer <%s>\n", b_ptr->name); pr_info("Disabling bearer <%s>\n", b_ptr->name);
spin_lock_bh(&b_ptr->lock); spin_lock_bh(&b_ptr->lock);
b_ptr->blocked = 1; b_ptr->blocked = 1;
b_ptr->media->disable_bearer(b_ptr); b_ptr->media->disable_bearer(b_ptr);
...@@ -584,7 +588,7 @@ int tipc_disable_bearer(const char *name) ...@@ -584,7 +588,7 @@ int tipc_disable_bearer(const char *name)
write_lock_bh(&tipc_net_lock); write_lock_bh(&tipc_net_lock);
b_ptr = tipc_bearer_find(name); b_ptr = tipc_bearer_find(name);
if (b_ptr == NULL) { if (b_ptr == NULL) {
warn("Attempt to disable unknown bearer <%s>\n", name); pr_warn("Attempt to disable unknown bearer <%s>\n", name);
res = -EINVAL; res = -EINVAL;
} else { } else {
bearer_disable(b_ptr); bearer_disable(b_ptr);
......
...@@ -432,7 +432,7 @@ static void cfg_named_msg_event(void *userdata, ...@@ -432,7 +432,7 @@ static void cfg_named_msg_event(void *userdata,
if ((size < sizeof(*req_hdr)) || if ((size < sizeof(*req_hdr)) ||
(size != TCM_ALIGN(ntohl(req_hdr->tcm_len))) || (size != TCM_ALIGN(ntohl(req_hdr->tcm_len))) ||
(ntohs(req_hdr->tcm_flags) != TCM_F_REQUEST)) { (ntohs(req_hdr->tcm_flags) != TCM_F_REQUEST)) {
warn("Invalid configuration message discarded\n"); pr_warn("Invalid configuration message discarded\n");
return; return;
} }
...@@ -478,7 +478,7 @@ int tipc_cfg_init(void) ...@@ -478,7 +478,7 @@ int tipc_cfg_init(void)
return 0; return 0;
failed: failed:
err("Unable to create configuration service\n"); pr_err("Unable to create configuration service\n");
return res; return res;
} }
...@@ -494,7 +494,7 @@ void tipc_cfg_reinit(void) ...@@ -494,7 +494,7 @@ void tipc_cfg_reinit(void)
seq.lower = seq.upper = tipc_own_addr; seq.lower = seq.upper = tipc_own_addr;
res = tipc_publish(config_port_ref, TIPC_ZONE_SCOPE, &seq); res = tipc_publish(config_port_ref, TIPC_ZONE_SCOPE, &seq);
if (res) if (res)
err("Unable to reinitialize configuration service\n"); pr_err("Unable to reinitialize configuration service\n");
} }
void tipc_cfg_stop(void) void tipc_cfg_stop(void)
......
...@@ -34,14 +34,13 @@ ...@@ -34,14 +34,13 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <linux/module.h>
#include "core.h" #include "core.h"
#include "ref.h" #include "ref.h"
#include "name_table.h" #include "name_table.h"
#include "subscr.h" #include "subscr.h"
#include "config.h" #include "config.h"
#include <linux/module.h>
#ifndef CONFIG_TIPC_PORTS #ifndef CONFIG_TIPC_PORTS
#define CONFIG_TIPC_PORTS 8191 #define CONFIG_TIPC_PORTS 8191
...@@ -162,9 +161,9 @@ static int __init tipc_init(void) ...@@ -162,9 +161,9 @@ static int __init tipc_init(void)
int res; int res;
if (tipc_log_resize(CONFIG_TIPC_LOG) != 0) if (tipc_log_resize(CONFIG_TIPC_LOG) != 0)
warn("Unable to create log buffer\n"); pr_warn("Unable to create log buffer\n");
info("Activated (version " TIPC_MOD_VER ")\n"); pr_info("Activated (version " TIPC_MOD_VER ")\n");
tipc_own_addr = 0; tipc_own_addr = 0;
tipc_remote_management = 1; tipc_remote_management = 1;
...@@ -175,9 +174,9 @@ static int __init tipc_init(void) ...@@ -175,9 +174,9 @@ static int __init tipc_init(void)
res = tipc_core_start(); res = tipc_core_start();
if (res) if (res)
err("Unable to start in single node mode\n"); pr_err("Unable to start in single node mode\n");
else else
info("Started in single node mode\n"); pr_info("Started in single node mode\n");
return res; return res;
} }
...@@ -185,7 +184,7 @@ static void __exit tipc_exit(void) ...@@ -185,7 +184,7 @@ static void __exit tipc_exit(void)
{ {
tipc_core_stop_net(); tipc_core_stop_net();
tipc_core_stop(); tipc_core_stop();
info("Deactivated\n"); pr_info("Deactivated\n");
} }
module_init(tipc_init); module_init(tipc_init);
......
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
#ifndef _TIPC_CORE_H #ifndef _TIPC_CORE_H
#define _TIPC_CORE_H #define _TIPC_CORE_H
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/tipc.h> #include <linux/tipc.h>
#include <linux/tipc_config.h> #include <linux/tipc_config.h>
#include <linux/types.h> #include <linux/types.h>
...@@ -89,13 +91,6 @@ void tipc_printf(struct print_buf *, const char *fmt, ...); ...@@ -89,13 +91,6 @@ void tipc_printf(struct print_buf *, const char *fmt, ...);
#define TIPC_OUTPUT TIPC_LOG #define TIPC_OUTPUT TIPC_LOG
#endif #endif
#define err(fmt, arg...) tipc_printf(TIPC_OUTPUT, \
KERN_ERR "TIPC: " fmt, ## arg)
#define warn(fmt, arg...) tipc_printf(TIPC_OUTPUT, \
KERN_WARNING "TIPC: " fmt, ## arg)
#define info(fmt, arg...) tipc_printf(TIPC_OUTPUT, \
KERN_NOTICE "TIPC: " fmt, ## arg)
#ifdef CONFIG_TIPC_DEBUG #ifdef CONFIG_TIPC_DEBUG
/* /*
...@@ -105,15 +100,12 @@ void tipc_printf(struct print_buf *, const char *fmt, ...); ...@@ -105,15 +100,12 @@ void tipc_printf(struct print_buf *, const char *fmt, ...);
#define DBG_OUTPUT TIPC_LOG #define DBG_OUTPUT TIPC_LOG
#endif #endif
#define dbg(fmt, arg...) tipc_printf(DBG_OUTPUT, KERN_DEBUG fmt, ## arg);
#define msg_dbg(msg, txt) tipc_msg_dbg(DBG_OUTPUT, msg, txt); #define msg_dbg(msg, txt) tipc_msg_dbg(DBG_OUTPUT, msg, txt);
void tipc_msg_dbg(struct print_buf *, struct tipc_msg *, const char *); void tipc_msg_dbg(struct print_buf *, struct tipc_msg *, const char *);
#else #else
#define dbg(fmt, arg...) do {} while (0)
#define msg_dbg(msg, txt) do {} while (0) #define msg_dbg(msg, txt) do {} while (0)
#define tipc_msg_dbg(buf, msg, txt) do {} while (0) #define tipc_msg_dbg(buf, msg, txt) do {} while (0)
......
...@@ -106,8 +106,8 @@ static void disc_dupl_alert(struct tipc_bearer *b_ptr, u32 node_addr, ...@@ -106,8 +106,8 @@ static void disc_dupl_alert(struct tipc_bearer *b_ptr, u32 node_addr,
tipc_printbuf_init(&pb, media_addr_str, sizeof(media_addr_str)); tipc_printbuf_init(&pb, media_addr_str, sizeof(media_addr_str));
tipc_media_addr_printf(&pb, media_addr); tipc_media_addr_printf(&pb, media_addr);
tipc_printbuf_validate(&pb); tipc_printbuf_validate(&pb);
warn("Duplicate %s using %s seen on <%s>\n", pr_warn("Duplicate %s using %s seen on <%s>\n", node_addr_str,
node_addr_str, media_addr_str, b_ptr->name); media_addr_str, b_ptr->name);
} }
/** /**
......
...@@ -57,14 +57,14 @@ unsigned int tipc_k_signal(Handler routine, unsigned long argument) ...@@ -57,14 +57,14 @@ unsigned int tipc_k_signal(Handler routine, unsigned long argument)
struct queue_item *item; struct queue_item *item;
if (!handler_enabled) { if (!handler_enabled) {
err("Signal request ignored by handler\n"); pr_err("Signal request ignored by handler\n");
return -ENOPROTOOPT; return -ENOPROTOOPT;
} }
spin_lock_bh(&qitem_lock); spin_lock_bh(&qitem_lock);
item = kmem_cache_alloc(tipc_queue_item_cache, GFP_ATOMIC); item = kmem_cache_alloc(tipc_queue_item_cache, GFP_ATOMIC);
if (!item) { if (!item) {
err("Signal queue out of memory\n"); pr_err("Signal queue out of memory\n");
spin_unlock_bh(&qitem_lock); spin_unlock_bh(&qitem_lock);
return -ENOMEM; return -ENOMEM;
} }
......
This diff is collapsed.
...@@ -161,7 +161,7 @@ void tipc_named_publish(struct publication *publ) ...@@ -161,7 +161,7 @@ void tipc_named_publish(struct publication *publ)
buf = named_prepare_buf(PUBLICATION, ITEM_SIZE, 0); buf = named_prepare_buf(PUBLICATION, ITEM_SIZE, 0);
if (!buf) { if (!buf) {
warn("Publication distribution failure\n"); pr_warn("Publication distribution failure\n");
return; return;
} }
...@@ -186,7 +186,7 @@ void tipc_named_withdraw(struct publication *publ) ...@@ -186,7 +186,7 @@ void tipc_named_withdraw(struct publication *publ)
buf = named_prepare_buf(WITHDRAWAL, ITEM_SIZE, 0); buf = named_prepare_buf(WITHDRAWAL, ITEM_SIZE, 0);
if (!buf) { if (!buf) {
warn("Withdrawal distribution failure\n"); pr_warn("Withdrawal distribution failure\n");
return; return;
} }
...@@ -213,7 +213,7 @@ static void named_distribute(struct list_head *message_list, u32 node, ...@@ -213,7 +213,7 @@ static void named_distribute(struct list_head *message_list, u32 node,
rest -= left; rest -= left;
buf = named_prepare_buf(PUBLICATION, left, node); buf = named_prepare_buf(PUBLICATION, left, node);
if (!buf) { if (!buf) {
warn("Bulk publication failure\n"); pr_warn("Bulk publication failure\n");
return; return;
} }
item = (struct distr_item *)msg_data(buf_msg(buf)); item = (struct distr_item *)msg_data(buf_msg(buf));
...@@ -283,9 +283,10 @@ static void named_purge_publ(struct publication *publ) ...@@ -283,9 +283,10 @@ static void named_purge_publ(struct publication *publ)
write_unlock_bh(&tipc_nametbl_lock); write_unlock_bh(&tipc_nametbl_lock);
if (p != publ) { if (p != publ) {
err("Unable to remove publication from failed node\n" pr_err("Unable to remove publication from failed node\n"
"(type=%u, lower=%u, node=0x%x, ref=%u, key=%u)\n", " (type=%u, lower=%u, node=0x%x, ref=%u, key=%u)\n",
publ->type, publ->lower, publ->node, publ->ref, publ->key); publ->type, publ->lower, publ->node, publ->ref,
publ->key);
} }
kfree(p); kfree(p);
...@@ -329,14 +330,14 @@ void tipc_named_recv(struct sk_buff *buf) ...@@ -329,14 +330,14 @@ void tipc_named_recv(struct sk_buff *buf)
tipc_nodesub_unsubscribe(&publ->subscr); tipc_nodesub_unsubscribe(&publ->subscr);
kfree(publ); kfree(publ);
} else { } else {
err("Unable to remove publication by node 0x%x\n" pr_err("Unable to remove publication by node 0x%x\n"
"(type=%u, lower=%u, ref=%u, key=%u)\n", " (type=%u, lower=%u, ref=%u, key=%u)\n",
msg_orignode(msg), msg_orignode(msg), ntohl(item->type),
ntohl(item->type), ntohl(item->lower), ntohl(item->lower), ntohl(item->ref),
ntohl(item->ref), ntohl(item->key)); ntohl(item->key));
} }
} else { } else {
warn("Unrecognized name table message received\n"); pr_warn("Unrecognized name table message received\n");
} }
item++; item++;
} }
......
...@@ -126,7 +126,7 @@ static struct publication *publ_create(u32 type, u32 lower, u32 upper, ...@@ -126,7 +126,7 @@ static struct publication *publ_create(u32 type, u32 lower, u32 upper,
{ {
struct publication *publ = kzalloc(sizeof(*publ), GFP_ATOMIC); struct publication *publ = kzalloc(sizeof(*publ), GFP_ATOMIC);
if (publ == NULL) { if (publ == NULL) {
warn("Publication creation failure, no memory\n"); pr_warn("Publication creation failure, no memory\n");
return NULL; return NULL;
} }
...@@ -163,7 +163,7 @@ static struct name_seq *tipc_nameseq_create(u32 type, struct hlist_head *seq_hea ...@@ -163,7 +163,7 @@ static struct name_seq *tipc_nameseq_create(u32 type, struct hlist_head *seq_hea
struct sub_seq *sseq = tipc_subseq_alloc(1); struct sub_seq *sseq = tipc_subseq_alloc(1);
if (!nseq || !sseq) { if (!nseq || !sseq) {
warn("Name sequence creation failed, no memory\n"); pr_warn("Name sequence creation failed, no memory\n");
kfree(nseq); kfree(nseq);
kfree(sseq); kfree(sseq);
return NULL; return NULL;
...@@ -263,8 +263,8 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq, ...@@ -263,8 +263,8 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq,
/* Lower end overlaps existing entry => need an exact match */ /* Lower end overlaps existing entry => need an exact match */
if ((sseq->lower != lower) || (sseq->upper != upper)) { if ((sseq->lower != lower) || (sseq->upper != upper)) {
warn("Cannot publish {%u,%u,%u}, overlap error\n", pr_warn("Cannot publish {%u,%u,%u}, overlap error\n",
type, lower, upper); type, lower, upper);
return NULL; return NULL;
} }
...@@ -286,8 +286,8 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq, ...@@ -286,8 +286,8 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq,
/* Fail if upper end overlaps into an existing entry */ /* Fail if upper end overlaps into an existing entry */
if ((inspos < nseq->first_free) && if ((inspos < nseq->first_free) &&
(upper >= nseq->sseqs[inspos].lower)) { (upper >= nseq->sseqs[inspos].lower)) {
warn("Cannot publish {%u,%u,%u}, overlap error\n", pr_warn("Cannot publish {%u,%u,%u}, overlap error\n",
type, lower, upper); type, lower, upper);
return NULL; return NULL;
} }
...@@ -296,8 +296,8 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq, ...@@ -296,8 +296,8 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq,
struct sub_seq *sseqs = tipc_subseq_alloc(nseq->alloc * 2); struct sub_seq *sseqs = tipc_subseq_alloc(nseq->alloc * 2);
if (!sseqs) { if (!sseqs) {
warn("Cannot publish {%u,%u,%u}, no memory\n", pr_warn("Cannot publish {%u,%u,%u}, no memory\n",
type, lower, upper); type, lower, upper);
return NULL; return NULL;
} }
memcpy(sseqs, nseq->sseqs, memcpy(sseqs, nseq->sseqs,
...@@ -309,8 +309,8 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq, ...@@ -309,8 +309,8 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq,
info = kzalloc(sizeof(*info), GFP_ATOMIC); info = kzalloc(sizeof(*info), GFP_ATOMIC);
if (!info) { if (!info) {
warn("Cannot publish {%u,%u,%u}, no memory\n", pr_warn("Cannot publish {%u,%u,%u}, no memory\n",
type, lower, upper); type, lower, upper);
return NULL; return NULL;
} }
...@@ -492,8 +492,8 @@ struct publication *tipc_nametbl_insert_publ(u32 type, u32 lower, u32 upper, ...@@ -492,8 +492,8 @@ struct publication *tipc_nametbl_insert_publ(u32 type, u32 lower, u32 upper,
if ((scope < TIPC_ZONE_SCOPE) || (scope > TIPC_NODE_SCOPE) || if ((scope < TIPC_ZONE_SCOPE) || (scope > TIPC_NODE_SCOPE) ||
(lower > upper)) { (lower > upper)) {
dbg("Failed to publish illegal {%u,%u,%u} with scope %u\n", pr_debug("Failed to publish illegal {%u,%u,%u} with scope %u\n",
type, lower, upper, scope); type, lower, upper, scope);
return NULL; return NULL;
} }
...@@ -668,8 +668,8 @@ struct publication *tipc_nametbl_publish(u32 type, u32 lower, u32 upper, ...@@ -668,8 +668,8 @@ struct publication *tipc_nametbl_publish(u32 type, u32 lower, u32 upper,
struct publication *publ; struct publication *publ;
if (table.local_publ_count >= tipc_max_publications) { if (table.local_publ_count >= tipc_max_publications) {
warn("Publication failed, local publication limit reached (%u)\n", pr_warn("Publication failed, local publication limit reached (%u)\n",
tipc_max_publications); tipc_max_publications);
return NULL; return NULL;
} }
...@@ -702,9 +702,9 @@ int tipc_nametbl_withdraw(u32 type, u32 lower, u32 ref, u32 key) ...@@ -702,9 +702,9 @@ int tipc_nametbl_withdraw(u32 type, u32 lower, u32 ref, u32 key)
return 1; return 1;
} }
write_unlock_bh(&tipc_nametbl_lock); write_unlock_bh(&tipc_nametbl_lock);
err("Unable to remove local publication\n" pr_err("Unable to remove local publication\n"
"(type=%u, lower=%u, ref=%u, key=%u)\n", "(type=%u, lower=%u, ref=%u, key=%u)\n",
type, lower, ref, key); type, lower, ref, key);
return 0; return 0;
} }
...@@ -725,8 +725,8 @@ void tipc_nametbl_subscribe(struct tipc_subscription *s) ...@@ -725,8 +725,8 @@ void tipc_nametbl_subscribe(struct tipc_subscription *s)
tipc_nameseq_subscribe(seq, s); tipc_nameseq_subscribe(seq, s);
spin_unlock_bh(&seq->lock); spin_unlock_bh(&seq->lock);
} else { } else {
warn("Failed to create subscription for {%u,%u,%u}\n", pr_warn("Failed to create subscription for {%u,%u,%u}\n",
s->seq.type, s->seq.lower, s->seq.upper); s->seq.type, s->seq.lower, s->seq.upper);
} }
write_unlock_bh(&tipc_nametbl_lock); write_unlock_bh(&tipc_nametbl_lock);
} }
...@@ -942,7 +942,7 @@ void tipc_nametbl_stop(void) ...@@ -942,7 +942,7 @@ void tipc_nametbl_stop(void)
for (i = 0; i < tipc_nametbl_size; i++) { for (i = 0; i < tipc_nametbl_size; i++) {
if (hlist_empty(&table.types[i])) if (hlist_empty(&table.types[i]))
continue; continue;
err("tipc_nametbl_stop(): orphaned hash chain detected\n"); pr_err("nametbl_stop(): orphaned hash chain detected\n");
break; break;
} }
kfree(table.types); kfree(table.types);
......
...@@ -184,9 +184,9 @@ int tipc_net_start(u32 addr) ...@@ -184,9 +184,9 @@ int tipc_net_start(u32 addr)
tipc_cfg_reinit(); tipc_cfg_reinit();
info("Started in network mode\n"); pr_info("Started in network mode\n");
info("Own node address %s, network identity %u\n", pr_info("Own node address %s, network identity %u\n",
tipc_addr_string_fill(addr_string, tipc_own_addr), tipc_net_id); tipc_addr_string_fill(addr_string, tipc_own_addr), tipc_net_id);
return 0; return 0;
} }
...@@ -202,5 +202,5 @@ void tipc_net_stop(void) ...@@ -202,5 +202,5 @@ void tipc_net_stop(void)
list_for_each_entry_safe(node, t_node, &tipc_node_list, list) list_for_each_entry_safe(node, t_node, &tipc_node_list, list)
tipc_node_delete(node); tipc_node_delete(node);
write_unlock_bh(&tipc_net_lock); write_unlock_bh(&tipc_net_lock);
info("Left network mode\n"); pr_info("Left network mode\n");
} }
...@@ -90,7 +90,7 @@ int tipc_netlink_start(void) ...@@ -90,7 +90,7 @@ int tipc_netlink_start(void)
res = genl_register_family_with_ops(&tipc_genl_family, res = genl_register_family_with_ops(&tipc_genl_family,
&tipc_genl_ops, 1); &tipc_genl_ops, 1);
if (res) { if (res) {
err("Failed to register netlink interface\n"); pr_err("Failed to register netlink interface\n");
return res; return res;
} }
......
...@@ -105,7 +105,7 @@ struct tipc_node *tipc_node_create(u32 addr) ...@@ -105,7 +105,7 @@ struct tipc_node *tipc_node_create(u32 addr)
n_ptr = kzalloc(sizeof(*n_ptr), GFP_ATOMIC); n_ptr = kzalloc(sizeof(*n_ptr), GFP_ATOMIC);
if (!n_ptr) { if (!n_ptr) {
spin_unlock_bh(&node_create_lock); spin_unlock_bh(&node_create_lock);
warn("Node creation failed, no memory\n"); pr_warn("Node creation failed, no memory\n");
return NULL; return NULL;
} }
...@@ -151,8 +151,8 @@ void tipc_node_link_up(struct tipc_node *n_ptr, struct tipc_link *l_ptr) ...@@ -151,8 +151,8 @@ void tipc_node_link_up(struct tipc_node *n_ptr, struct tipc_link *l_ptr)
n_ptr->working_links++; n_ptr->working_links++;
info("Established link <%s> on network plane %c\n", pr_info("Established link <%s> on network plane %c\n",
l_ptr->name, l_ptr->b_ptr->net_plane); l_ptr->name, l_ptr->b_ptr->net_plane);
if (!active[0]) { if (!active[0]) {
active[0] = active[1] = l_ptr; active[0] = active[1] = l_ptr;
...@@ -160,7 +160,7 @@ void tipc_node_link_up(struct tipc_node *n_ptr, struct tipc_link *l_ptr) ...@@ -160,7 +160,7 @@ void tipc_node_link_up(struct tipc_node *n_ptr, struct tipc_link *l_ptr)
return; return;
} }
if (l_ptr->priority < active[0]->priority) { if (l_ptr->priority < active[0]->priority) {
info("New link <%s> becomes standby\n", l_ptr->name); pr_info("New link <%s> becomes standby\n", l_ptr->name);
return; return;
} }
tipc_link_send_duplicate(active[0], l_ptr); tipc_link_send_duplicate(active[0], l_ptr);
...@@ -168,9 +168,9 @@ void tipc_node_link_up(struct tipc_node *n_ptr, struct tipc_link *l_ptr) ...@@ -168,9 +168,9 @@ void tipc_node_link_up(struct tipc_node *n_ptr, struct tipc_link *l_ptr)
active[0] = l_ptr; active[0] = l_ptr;
return; return;
} }
info("Old link <%s> becomes standby\n", active[0]->name); pr_info("Old link <%s> becomes standby\n", active[0]->name);
if (active[1] != active[0]) if (active[1] != active[0])
info("Old link <%s> becomes standby\n", active[1]->name); pr_info("Old link <%s> becomes standby\n", active[1]->name);
active[0] = active[1] = l_ptr; active[0] = active[1] = l_ptr;
} }
...@@ -211,11 +211,11 @@ void tipc_node_link_down(struct tipc_node *n_ptr, struct tipc_link *l_ptr) ...@@ -211,11 +211,11 @@ void tipc_node_link_down(struct tipc_node *n_ptr, struct tipc_link *l_ptr)
n_ptr->working_links--; n_ptr->working_links--;
if (!tipc_link_is_active(l_ptr)) { if (!tipc_link_is_active(l_ptr)) {
info("Lost standby link <%s> on network plane %c\n", pr_info("Lost standby link <%s> on network plane %c\n",
l_ptr->name, l_ptr->b_ptr->net_plane); l_ptr->name, l_ptr->b_ptr->net_plane);
return; return;
} }
info("Lost link <%s> on network plane %c\n", pr_info("Lost link <%s> on network plane %c\n",
l_ptr->name, l_ptr->b_ptr->net_plane); l_ptr->name, l_ptr->b_ptr->net_plane);
active = &n_ptr->active_links[0]; active = &n_ptr->active_links[0];
...@@ -290,8 +290,8 @@ static void node_lost_contact(struct tipc_node *n_ptr) ...@@ -290,8 +290,8 @@ static void node_lost_contact(struct tipc_node *n_ptr)
char addr_string[16]; char addr_string[16];
u32 i; u32 i;
info("Lost contact with %s\n", pr_info("Lost contact with %s\n",
tipc_addr_string_fill(addr_string, n_ptr->addr)); tipc_addr_string_fill(addr_string, n_ptr->addr));
/* Flush broadcast link info associated with lost node */ /* Flush broadcast link info associated with lost node */
if (n_ptr->bclink.supported) { if (n_ptr->bclink.supported) {
......
...@@ -51,7 +51,8 @@ void tipc_nodesub_subscribe(struct tipc_node_subscr *node_sub, u32 addr, ...@@ -51,7 +51,8 @@ void tipc_nodesub_subscribe(struct tipc_node_subscr *node_sub, u32 addr,
node_sub->node = tipc_node_find(addr); node_sub->node = tipc_node_find(addr);
if (!node_sub->node) { if (!node_sub->node) {
warn("Node subscription rejected, unknown node 0x%x\n", addr); pr_warn("Node subscription rejected, unknown node 0x%x\n",
addr);
return; return;
} }
node_sub->handle_node_down = handle_down; node_sub->handle_node_down = handle_down;
......
...@@ -191,7 +191,7 @@ void tipc_port_recv_mcast(struct sk_buff *buf, struct tipc_port_list *dp) ...@@ -191,7 +191,7 @@ void tipc_port_recv_mcast(struct sk_buff *buf, struct tipc_port_list *dp)
struct sk_buff *b = skb_clone(buf, GFP_ATOMIC); struct sk_buff *b = skb_clone(buf, GFP_ATOMIC);
if (b == NULL) { if (b == NULL) {
warn("Unable to deliver multicast message(s)\n"); pr_warn("Unable to deliver multicast message(s)\n");
goto exit; goto exit;
} }
if ((index == 0) && (cnt != 0)) if ((index == 0) && (cnt != 0))
...@@ -221,12 +221,12 @@ struct tipc_port *tipc_createport_raw(void *usr_handle, ...@@ -221,12 +221,12 @@ struct tipc_port *tipc_createport_raw(void *usr_handle,
p_ptr = kzalloc(sizeof(*p_ptr), GFP_ATOMIC); p_ptr = kzalloc(sizeof(*p_ptr), GFP_ATOMIC);
if (!p_ptr) { if (!p_ptr) {
warn("Port creation failed, no memory\n"); pr_warn("Port creation failed, no memory\n");
return NULL; return NULL;
} }
ref = tipc_ref_acquire(p_ptr, &p_ptr->lock); ref = tipc_ref_acquire(p_ptr, &p_ptr->lock);
if (!ref) { if (!ref) {
warn("Port creation failed, reference table exhausted\n"); pr_warn("Port creation failed, ref. table exhausted\n");
kfree(p_ptr); kfree(p_ptr);
return NULL; return NULL;
} }
...@@ -906,7 +906,7 @@ int tipc_createport(void *usr_handle, ...@@ -906,7 +906,7 @@ int tipc_createport(void *usr_handle,
up_ptr = kmalloc(sizeof(*up_ptr), GFP_ATOMIC); up_ptr = kmalloc(sizeof(*up_ptr), GFP_ATOMIC);
if (!up_ptr) { if (!up_ptr) {
warn("Port creation failed, no memory\n"); pr_warn("Port creation failed, no memory\n");
return -ENOMEM; return -ENOMEM;
} }
p_ptr = tipc_createport_raw(NULL, port_dispatcher, port_wakeup, p_ptr = tipc_createport_raw(NULL, port_dispatcher, port_wakeup,
......
...@@ -153,11 +153,11 @@ u32 tipc_ref_acquire(void *object, spinlock_t **lock) ...@@ -153,11 +153,11 @@ u32 tipc_ref_acquire(void *object, spinlock_t **lock)
struct reference *entry = NULL; struct reference *entry = NULL;
if (!object) { if (!object) {
err("Attempt to acquire reference to non-existent object\n"); pr_err("Attempt to acquire ref. to non-existent obj\n");
return 0; return 0;
} }
if (!tipc_ref_table.entries) { if (!tipc_ref_table.entries) {
err("Reference table not found during acquisition attempt\n"); pr_err("Ref. table not found in acquisition attempt\n");
return 0; return 0;
} }
...@@ -211,7 +211,7 @@ void tipc_ref_discard(u32 ref) ...@@ -211,7 +211,7 @@ void tipc_ref_discard(u32 ref)
u32 index_mask; u32 index_mask;
if (!tipc_ref_table.entries) { if (!tipc_ref_table.entries) {
err("Reference table not found during discard attempt\n"); pr_err("Ref. table not found during discard attempt\n");
return; return;
} }
...@@ -222,11 +222,11 @@ void tipc_ref_discard(u32 ref) ...@@ -222,11 +222,11 @@ void tipc_ref_discard(u32 ref)
write_lock_bh(&ref_table_lock); write_lock_bh(&ref_table_lock);
if (!entry->object) { if (!entry->object) {
err("Attempt to discard reference to non-existent object\n"); pr_err("Attempt to discard ref. to non-existent obj\n");
goto exit; goto exit;
} }
if (entry->ref != ref) { if (entry->ref != ref) {
err("Attempt to discard non-existent reference\n"); pr_err("Attempt to discard non-existent reference\n");
goto exit; goto exit;
} }
......
...@@ -34,12 +34,12 @@ ...@@ -34,12 +34,12 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <linux/export.h>
#include <net/sock.h>
#include "core.h" #include "core.h"
#include "port.h" #include "port.h"
#include <linux/export.h>
#include <net/sock.h>
#define SS_LISTENING -1 /* socket is listening */ #define SS_LISTENING -1 /* socket is listening */
#define SS_READY -2 /* socket is connectionless */ #define SS_READY -2 /* socket is connectionless */
...@@ -1787,13 +1787,13 @@ int tipc_socket_init(void) ...@@ -1787,13 +1787,13 @@ int tipc_socket_init(void)
res = proto_register(&tipc_proto, 1); res = proto_register(&tipc_proto, 1);
if (res) { if (res) {
err("Failed to register TIPC protocol type\n"); pr_err("Failed to register TIPC protocol type\n");
goto out; goto out;
} }
res = sock_register(&tipc_family_ops); res = sock_register(&tipc_family_ops);
if (res) { if (res) {
err("Failed to register TIPC socket type\n"); pr_err("Failed to register TIPC socket type\n");
proto_unregister(&tipc_proto); proto_unregister(&tipc_proto);
goto out; goto out;
} }
......
...@@ -305,8 +305,8 @@ static struct tipc_subscription *subscr_subscribe(struct tipc_subscr *s, ...@@ -305,8 +305,8 @@ static struct tipc_subscription *subscr_subscribe(struct tipc_subscr *s,
/* Refuse subscription if global limit exceeded */ /* Refuse subscription if global limit exceeded */
if (atomic_read(&topsrv.subscription_count) >= tipc_max_subscriptions) { if (atomic_read(&topsrv.subscription_count) >= tipc_max_subscriptions) {
warn("Subscription rejected, subscription limit reached (%u)\n", pr_warn("Subscription rejected, limit reached (%u)\n",
tipc_max_subscriptions); tipc_max_subscriptions);
subscr_terminate(subscriber); subscr_terminate(subscriber);
return NULL; return NULL;
} }
...@@ -314,7 +314,7 @@ static struct tipc_subscription *subscr_subscribe(struct tipc_subscr *s, ...@@ -314,7 +314,7 @@ static struct tipc_subscription *subscr_subscribe(struct tipc_subscr *s,
/* Allocate subscription object */ /* Allocate subscription object */
sub = kmalloc(sizeof(*sub), GFP_ATOMIC); sub = kmalloc(sizeof(*sub), GFP_ATOMIC);
if (!sub) { if (!sub) {
warn("Subscription rejected, no memory\n"); pr_warn("Subscription rejected, no memory\n");
subscr_terminate(subscriber); subscr_terminate(subscriber);
return NULL; return NULL;
} }
...@@ -328,7 +328,7 @@ static struct tipc_subscription *subscr_subscribe(struct tipc_subscr *s, ...@@ -328,7 +328,7 @@ static struct tipc_subscription *subscr_subscribe(struct tipc_subscr *s,
if ((!(sub->filter & TIPC_SUB_PORTS) == if ((!(sub->filter & TIPC_SUB_PORTS) ==
!(sub->filter & TIPC_SUB_SERVICE)) || !(sub->filter & TIPC_SUB_SERVICE)) ||
(sub->seq.lower > sub->seq.upper)) { (sub->seq.lower > sub->seq.upper)) {
warn("Subscription rejected, illegal request\n"); pr_warn("Subscription rejected, illegal request\n");
kfree(sub); kfree(sub);
subscr_terminate(subscriber); subscr_terminate(subscriber);
return NULL; return NULL;
...@@ -440,7 +440,7 @@ static void subscr_named_msg_event(void *usr_handle, ...@@ -440,7 +440,7 @@ static void subscr_named_msg_event(void *usr_handle,
/* Create subscriber object */ /* Create subscriber object */
subscriber = kzalloc(sizeof(struct tipc_subscriber), GFP_ATOMIC); subscriber = kzalloc(sizeof(struct tipc_subscriber), GFP_ATOMIC);
if (subscriber == NULL) { if (subscriber == NULL) {
warn("Subscriber rejected, no memory\n"); pr_warn("Subscriber rejected, no memory\n");
return; return;
} }
INIT_LIST_HEAD(&subscriber->subscription_list); INIT_LIST_HEAD(&subscriber->subscription_list);
...@@ -458,7 +458,7 @@ static void subscr_named_msg_event(void *usr_handle, ...@@ -458,7 +458,7 @@ static void subscr_named_msg_event(void *usr_handle,
NULL, NULL,
&subscriber->port_ref); &subscriber->port_ref);
if (subscriber->port_ref == 0) { if (subscriber->port_ref == 0) {
warn("Subscriber rejected, unable to create port\n"); pr_warn("Subscriber rejected, unable to create port\n");
kfree(subscriber); kfree(subscriber);
return; return;
} }
...@@ -517,7 +517,7 @@ int tipc_subscr_start(void) ...@@ -517,7 +517,7 @@ int tipc_subscr_start(void)
return 0; return 0;
failed: failed:
err("Failed to create subscription service\n"); pr_err("Failed to create subscription service\n");
return res; return res;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment