mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-18 17:26:41 +07:00
[TIPC]: Fix simple sparse warnings
Tried to run the new tipc stack through sparse. Following patch fixes all cases where 0 was used as replacement of NULL. Use NULL to document this is a pointer and to silence sparse. This brough sparse warning count down with 127 to 24 warnings. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Per Liden <per.liden@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
edb2c34fb2
commit
1fc54d8f49
@ -271,7 +271,7 @@ static void bclink_send_nack(struct node *n_ptr)
|
|||||||
msg_set_bcgap_to(msg, n_ptr->bclink.gap_to);
|
msg_set_bcgap_to(msg, n_ptr->bclink.gap_to);
|
||||||
msg_set_bcast_tag(msg, tipc_own_tag);
|
msg_set_bcast_tag(msg, tipc_own_tag);
|
||||||
|
|
||||||
if (tipc_bearer_send(&bcbearer->bearer, buf, 0)) {
|
if (tipc_bearer_send(&bcbearer->bearer, buf, NULL)) {
|
||||||
bcl->stats.sent_nacks++;
|
bcl->stats.sent_nacks++;
|
||||||
buf_discard(buf);
|
buf_discard(buf);
|
||||||
} else {
|
} else {
|
||||||
|
@ -45,10 +45,10 @@
|
|||||||
|
|
||||||
#define MAX_ADDR_STR 32
|
#define MAX_ADDR_STR 32
|
||||||
|
|
||||||
static struct media *media_list = 0;
|
static struct media *media_list = NULL;
|
||||||
static u32 media_count = 0;
|
static u32 media_count = 0;
|
||||||
|
|
||||||
struct bearer *tipc_bearers = 0;
|
struct bearer *tipc_bearers = NULL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* media_name_valid - validate media name
|
* media_name_valid - validate media name
|
||||||
@ -79,7 +79,7 @@ static struct media *media_find(const char *name)
|
|||||||
if (!strcmp(m_ptr->name, name))
|
if (!strcmp(m_ptr->name, name))
|
||||||
return m_ptr;
|
return m_ptr;
|
||||||
}
|
}
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -287,7 +287,7 @@ static struct bearer *bearer_find(const char *name)
|
|||||||
if (b_ptr->active && (!strcmp(b_ptr->publ.name, name)))
|
if (b_ptr->active && (!strcmp(b_ptr->publ.name, name)))
|
||||||
return b_ptr;
|
return b_ptr;
|
||||||
}
|
}
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -307,7 +307,7 @@ struct bearer *tipc_bearer_find_interface(const char *if_name)
|
|||||||
if (!strcmp(b_if_name, if_name))
|
if (!strcmp(b_if_name, if_name))
|
||||||
return b_ptr;
|
return b_ptr;
|
||||||
}
|
}
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -569,7 +569,7 @@ int tipc_enable_bearer(const char *name, u32 bcast_scope, u32 priority)
|
|||||||
|
|
||||||
int tipc_block_bearer(const char *name)
|
int tipc_block_bearer(const char *name)
|
||||||
{
|
{
|
||||||
struct bearer *b_ptr = 0;
|
struct bearer *b_ptr = NULL;
|
||||||
struct link *l_ptr;
|
struct link *l_ptr;
|
||||||
struct link *temp_l_ptr;
|
struct link *temp_l_ptr;
|
||||||
|
|
||||||
@ -666,8 +666,8 @@ int tipc_bearer_init(void)
|
|||||||
} else {
|
} else {
|
||||||
kfree(tipc_bearers);
|
kfree(tipc_bearers);
|
||||||
kfree(media_list);
|
kfree(media_list);
|
||||||
tipc_bearers = 0;
|
tipc_bearers = NULL;
|
||||||
media_list = 0;
|
media_list = NULL;
|
||||||
res = -ENOMEM;
|
res = -ENOMEM;
|
||||||
}
|
}
|
||||||
write_unlock_bh(&tipc_net_lock);
|
write_unlock_bh(&tipc_net_lock);
|
||||||
@ -691,8 +691,8 @@ void tipc_bearer_stop(void)
|
|||||||
}
|
}
|
||||||
kfree(tipc_bearers);
|
kfree(tipc_bearers);
|
||||||
kfree(media_list);
|
kfree(media_list);
|
||||||
tipc_bearers = 0;
|
tipc_bearers = NULL;
|
||||||
media_list = 0;
|
media_list = NULL;
|
||||||
media_count = 0;
|
media_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf,
|
|||||||
u32 lower, u32 upper);
|
u32 lower, u32 upper);
|
||||||
struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest);
|
struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest);
|
||||||
|
|
||||||
struct node **tipc_local_nodes = 0;
|
struct node **tipc_local_nodes = NULL;
|
||||||
struct node_map tipc_cltr_bcast_nodes = {0,{0,}};
|
struct node_map tipc_cltr_bcast_nodes = {0,{0,}};
|
||||||
u32 tipc_highest_allowed_slave = 0;
|
u32 tipc_highest_allowed_slave = 0;
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ struct cluster *tipc_cltr_create(u32 addr)
|
|||||||
|
|
||||||
c_ptr = (struct cluster *)kmalloc(sizeof(*c_ptr), GFP_ATOMIC);
|
c_ptr = (struct cluster *)kmalloc(sizeof(*c_ptr), GFP_ATOMIC);
|
||||||
if (c_ptr == NULL)
|
if (c_ptr == NULL)
|
||||||
return 0;
|
return NULL;
|
||||||
memset(c_ptr, 0, sizeof(*c_ptr));
|
memset(c_ptr, 0, sizeof(*c_ptr));
|
||||||
|
|
||||||
c_ptr->addr = tipc_addr(tipc_zone(addr), tipc_cluster(addr), 0);
|
c_ptr->addr = tipc_addr(tipc_zone(addr), tipc_cluster(addr), 0);
|
||||||
@ -73,7 +73,7 @@ struct cluster *tipc_cltr_create(u32 addr)
|
|||||||
c_ptr->nodes = (struct node **)kmalloc(alloc, GFP_ATOMIC);
|
c_ptr->nodes = (struct node **)kmalloc(alloc, GFP_ATOMIC);
|
||||||
if (c_ptr->nodes == NULL) {
|
if (c_ptr->nodes == NULL) {
|
||||||
kfree(c_ptr);
|
kfree(c_ptr);
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
memset(c_ptr->nodes, 0, alloc);
|
memset(c_ptr->nodes, 0, alloc);
|
||||||
if (in_own_cluster(addr))
|
if (in_own_cluster(addr))
|
||||||
@ -91,7 +91,7 @@ struct cluster *tipc_cltr_create(u32 addr)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
kfree(c_ptr);
|
kfree(c_ptr);
|
||||||
c_ptr = 0;
|
c_ptr = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return c_ptr;
|
return c_ptr;
|
||||||
@ -204,7 +204,7 @@ struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector)
|
|||||||
|
|
||||||
assert(!in_own_cluster(c_ptr->addr));
|
assert(!in_own_cluster(c_ptr->addr));
|
||||||
if (!c_ptr->highest_node)
|
if (!c_ptr->highest_node)
|
||||||
return 0;
|
return NULL;
|
||||||
|
|
||||||
/* Start entry must be random */
|
/* Start entry must be random */
|
||||||
while (mask > c_ptr->highest_node) {
|
while (mask > c_ptr->highest_node) {
|
||||||
@ -222,7 +222,7 @@ struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector)
|
|||||||
if (tipc_node_has_active_links(c_ptr->nodes[n_num]))
|
if (tipc_node_has_active_links(c_ptr->nodes[n_num]))
|
||||||
return c_ptr->nodes[n_num];
|
return c_ptr->nodes[n_num];
|
||||||
}
|
}
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -86,7 +86,7 @@ static inline struct cluster *tipc_cltr_find(u32 addr)
|
|||||||
|
|
||||||
if (z_ptr)
|
if (z_ptr)
|
||||||
return z_ptr->clusters[1];
|
return z_ptr->clusters[1];
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -683,11 +683,11 @@ int tipc_cfg_init(void)
|
|||||||
memset(&mng, 0, sizeof(mng));
|
memset(&mng, 0, sizeof(mng));
|
||||||
INIT_LIST_HEAD(&mng.link_subscribers);
|
INIT_LIST_HEAD(&mng.link_subscribers);
|
||||||
|
|
||||||
res = tipc_attach(&mng.user_ref, 0, 0);
|
res = tipc_attach(&mng.user_ref, NULL, NULL);
|
||||||
if (res)
|
if (res)
|
||||||
goto failed;
|
goto failed;
|
||||||
|
|
||||||
res = tipc_createport(mng.user_ref, 0, TIPC_CRITICAL_IMPORTANCE,
|
res = tipc_createport(mng.user_ref, NULL, TIPC_CRITICAL_IMPORTANCE,
|
||||||
NULL, NULL, NULL,
|
NULL, NULL, NULL,
|
||||||
NULL, cfg_named_msg_event, NULL,
|
NULL, cfg_named_msg_event, NULL,
|
||||||
NULL, &mng.port_ref);
|
NULL, &mng.port_ref);
|
||||||
|
@ -81,7 +81,7 @@ void tipc_printbuf_init(struct print_buf *pb, char *raw, u32 sz)
|
|||||||
|
|
||||||
pb->crs = pb->buf = raw;
|
pb->crs = pb->buf = raw;
|
||||||
pb->size = sz;
|
pb->size = sz;
|
||||||
pb->next = 0;
|
pb->next = NULL;
|
||||||
pb->buf[0] = 0;
|
pb->buf[0] = 0;
|
||||||
pb->buf[sz-1] = ~0;
|
pb->buf[sz-1] = ~0;
|
||||||
}
|
}
|
||||||
@ -216,7 +216,7 @@ void tipc_printf(struct print_buf *pb, const char *fmt, ...)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
pb_next = pb->next;
|
pb_next = pb->next;
|
||||||
pb->next = 0;
|
pb->next = NULL;
|
||||||
pb = pb_next;
|
pb = pb_next;
|
||||||
}
|
}
|
||||||
spin_unlock_bh(&print_lock);
|
spin_unlock_bh(&print_lock);
|
||||||
|
@ -169,7 +169,7 @@ static int enable_bearer(struct tipc_bearer *tb_ptr)
|
|||||||
|
|
||||||
static void disable_bearer(struct tipc_bearer *tb_ptr)
|
static void disable_bearer(struct tipc_bearer *tb_ptr)
|
||||||
{
|
{
|
||||||
((struct eth_bearer *)tb_ptr->usr_handle)->bearer = 0;
|
((struct eth_bearer *)tb_ptr->usr_handle)->bearer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -285,7 +285,7 @@ void tipc_eth_media_stop(void)
|
|||||||
for (i = 0; i < MAX_ETH_BEARERS ; i++) {
|
for (i = 0; i < MAX_ETH_BEARERS ; i++) {
|
||||||
if (eth_bearers[i].bearer) {
|
if (eth_bearers[i].bearer) {
|
||||||
eth_bearers[i].bearer->blocked = 1;
|
eth_bearers[i].bearer->blocked = 1;
|
||||||
eth_bearers[i].bearer = 0;
|
eth_bearers[i].bearer = NULL;
|
||||||
}
|
}
|
||||||
if (eth_bearers[i].dev) {
|
if (eth_bearers[i].dev) {
|
||||||
dev_remove_pack(ð_bearers[i].tipc_packet_type);
|
dev_remove_pack(ð_bearers[i].tipc_packet_type);
|
||||||
|
@ -573,7 +573,7 @@ void tipc_link_wakeup_ports(struct link *l_ptr, int all)
|
|||||||
if (win <= 0)
|
if (win <= 0)
|
||||||
break;
|
break;
|
||||||
list_del_init(&p_ptr->wait_list);
|
list_del_init(&p_ptr->wait_list);
|
||||||
p_ptr->congested_link = 0;
|
p_ptr->congested_link = NULL;
|
||||||
assert(p_ptr->wakeup);
|
assert(p_ptr->wakeup);
|
||||||
spin_lock_bh(p_ptr->publ.lock);
|
spin_lock_bh(p_ptr->publ.lock);
|
||||||
p_ptr->publ.congested = 0;
|
p_ptr->publ.congested = 0;
|
||||||
@ -1355,7 +1355,7 @@ static int link_send_sections_long(struct port *sender,
|
|||||||
fragm_crs = 0;
|
fragm_crs = 0;
|
||||||
fragm_rest = 0;
|
fragm_rest = 0;
|
||||||
sect_rest = 0;
|
sect_rest = 0;
|
||||||
sect_crs = 0;
|
sect_crs = NULL;
|
||||||
curr_sect = -1;
|
curr_sect = -1;
|
||||||
|
|
||||||
/* Prepare reusable fragment header: */
|
/* Prepare reusable fragment header: */
|
||||||
@ -1549,7 +1549,7 @@ u32 tipc_link_push_packet(struct link *l_ptr)
|
|||||||
msg_dbg(buf_msg(buf), ">DEF-PROT>");
|
msg_dbg(buf_msg(buf), ">DEF-PROT>");
|
||||||
l_ptr->unacked_window = 0;
|
l_ptr->unacked_window = 0;
|
||||||
buf_discard(buf);
|
buf_discard(buf);
|
||||||
l_ptr->proto_msg_queue = 0;
|
l_ptr->proto_msg_queue = NULL;
|
||||||
return TIPC_OK;
|
return TIPC_OK;
|
||||||
} else {
|
} else {
|
||||||
msg_dbg(buf_msg(buf), "|>DEF-PROT>");
|
msg_dbg(buf_msg(buf), "|>DEF-PROT>");
|
||||||
@ -1860,7 +1860,7 @@ u32 tipc_link_defer_pkt(struct sk_buff **head,
|
|||||||
struct sk_buff **tail,
|
struct sk_buff **tail,
|
||||||
struct sk_buff *buf)
|
struct sk_buff *buf)
|
||||||
{
|
{
|
||||||
struct sk_buff *prev = 0;
|
struct sk_buff *prev = NULL;
|
||||||
struct sk_buff *crs = *head;
|
struct sk_buff *crs = *head;
|
||||||
u32 seq_no = msg_seqno(buf_msg(buf));
|
u32 seq_no = msg_seqno(buf_msg(buf));
|
||||||
|
|
||||||
@ -1953,7 +1953,7 @@ static void link_handle_out_of_seq_msg(struct link *l_ptr,
|
|||||||
void tipc_link_send_proto_msg(struct link *l_ptr, u32 msg_typ, int probe_msg,
|
void tipc_link_send_proto_msg(struct link *l_ptr, u32 msg_typ, int probe_msg,
|
||||||
u32 gap, u32 tolerance, u32 priority, u32 ack_mtu)
|
u32 gap, u32 tolerance, u32 priority, u32 ack_mtu)
|
||||||
{
|
{
|
||||||
struct sk_buff *buf = 0;
|
struct sk_buff *buf = NULL;
|
||||||
struct tipc_msg *msg = l_ptr->pmsg;
|
struct tipc_msg *msg = l_ptr->pmsg;
|
||||||
u32 msg_size = sizeof(l_ptr->proto_msg);
|
u32 msg_size = sizeof(l_ptr->proto_msg);
|
||||||
|
|
||||||
@ -2426,7 +2426,7 @@ static int link_recv_changeover_msg(struct link **l_ptr,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
exit:
|
exit:
|
||||||
*buf = 0;
|
*buf = NULL;
|
||||||
buf_discard(tunnel_buf);
|
buf_discard(tunnel_buf);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -2586,13 +2586,13 @@ static inline void incr_timer_cnt(struct sk_buff *buf)
|
|||||||
int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
|
int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
|
||||||
struct tipc_msg **m)
|
struct tipc_msg **m)
|
||||||
{
|
{
|
||||||
struct sk_buff *prev = 0;
|
struct sk_buff *prev = NULL;
|
||||||
struct sk_buff *fbuf = *fb;
|
struct sk_buff *fbuf = *fb;
|
||||||
struct tipc_msg *fragm = buf_msg(fbuf);
|
struct tipc_msg *fragm = buf_msg(fbuf);
|
||||||
struct sk_buff *pbuf = *pending;
|
struct sk_buff *pbuf = *pending;
|
||||||
u32 long_msg_seq_no = msg_long_msgno(fragm);
|
u32 long_msg_seq_no = msg_long_msgno(fragm);
|
||||||
|
|
||||||
*fb = 0;
|
*fb = NULL;
|
||||||
msg_dbg(fragm,"FRG<REC<");
|
msg_dbg(fragm,"FRG<REC<");
|
||||||
|
|
||||||
/* Is there an incomplete message waiting for this fragment? */
|
/* Is there an incomplete message waiting for this fragment? */
|
||||||
@ -2670,8 +2670,8 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
|
|||||||
|
|
||||||
static void link_check_defragm_bufs(struct link *l_ptr)
|
static void link_check_defragm_bufs(struct link *l_ptr)
|
||||||
{
|
{
|
||||||
struct sk_buff *prev = 0;
|
struct sk_buff *prev = NULL;
|
||||||
struct sk_buff *next = 0;
|
struct sk_buff *next = NULL;
|
||||||
struct sk_buff *buf = l_ptr->defragm_buf;
|
struct sk_buff *buf = l_ptr->defragm_buf;
|
||||||
|
|
||||||
if (!buf)
|
if (!buf)
|
||||||
@ -2750,19 +2750,19 @@ static struct link *link_find_link(const char *name, struct node **node)
|
|||||||
struct link *l_ptr;
|
struct link *l_ptr;
|
||||||
|
|
||||||
if (!link_name_validate(name, &link_name_parts))
|
if (!link_name_validate(name, &link_name_parts))
|
||||||
return 0;
|
return NULL;
|
||||||
|
|
||||||
b_ptr = tipc_bearer_find_interface(link_name_parts.if_local);
|
b_ptr = tipc_bearer_find_interface(link_name_parts.if_local);
|
||||||
if (!b_ptr)
|
if (!b_ptr)
|
||||||
return 0;
|
return NULL;
|
||||||
|
|
||||||
*node = tipc_node_find(link_name_parts.addr_peer);
|
*node = tipc_node_find(link_name_parts.addr_peer);
|
||||||
if (!*node)
|
if (!*node)
|
||||||
return 0;
|
return NULL;
|
||||||
|
|
||||||
l_ptr = (*node)->links[b_ptr->identity];
|
l_ptr = (*node)->links[b_ptr->identity];
|
||||||
if (!l_ptr || strcmp(l_ptr->name, name))
|
if (!l_ptr || strcmp(l_ptr->name, name))
|
||||||
return 0;
|
return NULL;
|
||||||
|
|
||||||
return l_ptr;
|
return l_ptr;
|
||||||
}
|
}
|
||||||
|
@ -168,8 +168,8 @@ void tipc_named_withdraw(struct publication *publ)
|
|||||||
void tipc_named_node_up(unsigned long node)
|
void tipc_named_node_up(unsigned long node)
|
||||||
{
|
{
|
||||||
struct publication *publ;
|
struct publication *publ;
|
||||||
struct distr_item *item = 0;
|
struct distr_item *item = NULL;
|
||||||
struct sk_buff *buf = 0;
|
struct sk_buff *buf = NULL;
|
||||||
u32 left = 0;
|
u32 left = 0;
|
||||||
u32 rest;
|
u32 rest;
|
||||||
u32 max_item_buf;
|
u32 max_item_buf;
|
||||||
@ -200,7 +200,7 @@ void tipc_named_node_up(unsigned long node)
|
|||||||
"<%u.%u.%u>\n", tipc_zone(node),
|
"<%u.%u.%u>\n", tipc_zone(node),
|
||||||
tipc_cluster(node), tipc_node(node));
|
tipc_cluster(node), tipc_node(node));
|
||||||
tipc_link_send(buf, node, node);
|
tipc_link_send(buf, node, node);
|
||||||
buf = 0;
|
buf = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exit:
|
exit:
|
||||||
|
@ -121,7 +121,7 @@ static struct publication *publ_create(u32 type, u32 lower, u32 upper,
|
|||||||
(struct publication *)kmalloc(sizeof(*publ), GFP_ATOMIC);
|
(struct publication *)kmalloc(sizeof(*publ), GFP_ATOMIC);
|
||||||
if (publ == NULL) {
|
if (publ == NULL) {
|
||||||
warn("Memory squeeze; failed to create publication\n");
|
warn("Memory squeeze; failed to create publication\n");
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(publ, 0, sizeof(*publ));
|
memset(publ, 0, sizeof(*publ));
|
||||||
@ -168,7 +168,7 @@ struct name_seq *tipc_nameseq_create(u32 type, struct hlist_head *seq_head)
|
|||||||
warn("Memory squeeze; failed to create name sequence\n");
|
warn("Memory squeeze; failed to create name sequence\n");
|
||||||
kfree(nseq);
|
kfree(nseq);
|
||||||
kfree(sseq);
|
kfree(sseq);
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(nseq, 0, sizeof(*nseq));
|
memset(nseq, 0, sizeof(*nseq));
|
||||||
@ -207,7 +207,7 @@ static inline struct sub_seq *nameseq_find_subseq(struct name_seq *nseq,
|
|||||||
else
|
else
|
||||||
return &sseqs[mid];
|
return &sseqs[mid];
|
||||||
}
|
}
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -263,7 +263,7 @@ struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq,
|
|||||||
|
|
||||||
if ((sseq->lower != lower) || (sseq->upper != upper)) {
|
if ((sseq->lower != lower) || (sseq->upper != upper)) {
|
||||||
warn("Overlapping publ <%u,%u,%u>\n", type, lower, upper);
|
warn("Overlapping publ <%u,%u,%u>\n", type, lower, upper);
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
u32 inspos;
|
u32 inspos;
|
||||||
@ -278,7 +278,7 @@ struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq,
|
|||||||
if ((inspos < nseq->first_free) &&
|
if ((inspos < nseq->first_free) &&
|
||||||
(upper >= nseq->sseqs[inspos].lower)) {
|
(upper >= nseq->sseqs[inspos].lower)) {
|
||||||
warn("Overlapping publ <%u,%u,%u>\n", type, lower, upper);
|
warn("Overlapping publ <%u,%u,%u>\n", type, lower, upper);
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ensure there is space for new sub-sequence */
|
/* Ensure there is space for new sub-sequence */
|
||||||
@ -294,7 +294,7 @@ struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq,
|
|||||||
nseq->alloc *= 2;
|
nseq->alloc *= 2;
|
||||||
} else {
|
} else {
|
||||||
warn("Memory squeeze; failed to create sub-sequence\n");
|
warn("Memory squeeze; failed to create sub-sequence\n");
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dbg("Have %u sseqs for type %u\n", nseq->alloc, type);
|
dbg("Have %u sseqs for type %u\n", nseq->alloc, type);
|
||||||
@ -319,7 +319,7 @@ struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq,
|
|||||||
|
|
||||||
publ = publ_create(type, lower, upper, scope, node, port, key);
|
publ = publ_create(type, lower, upper, scope, node, port, key);
|
||||||
if (!publ)
|
if (!publ)
|
||||||
return 0;
|
return NULL;
|
||||||
dbg("inserting publ %x, node=%x publ->node=%x, subscr->node=%x\n",
|
dbg("inserting publ %x, node=%x publ->node=%x, subscr->node=%x\n",
|
||||||
publ, node, publ->node, publ->subscr.node);
|
publ, node, publ->node, publ->subscr.node);
|
||||||
|
|
||||||
@ -394,7 +394,7 @@ struct publication *tipc_nameseq_remove_publ(struct name_seq *nseq, u32 inst,
|
|||||||
i, &nseq->sseqs[i], nseq->sseqs[i].lower,
|
i, &nseq->sseqs[i], nseq->sseqs[i].lower,
|
||||||
nseq->sseqs[i].upper);
|
nseq->sseqs[i].upper);
|
||||||
}
|
}
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
dbg("nameseq_remove: seq: %x, sseq %x, <%u,%u> key %u\n",
|
dbg("nameseq_remove: seq: %x, sseq %x, <%u,%u> key %u\n",
|
||||||
nseq, sseq, nseq->type, inst, key);
|
nseq, sseq, nseq->type, inst, key);
|
||||||
@ -413,7 +413,7 @@ struct publication *tipc_nameseq_remove_publ(struct name_seq *nseq, u32 inst,
|
|||||||
prev->zone_list_next = publ->zone_list_next;
|
prev->zone_list_next = publ->zone_list_next;
|
||||||
sseq->zone_list = publ->zone_list_next;
|
sseq->zone_list = publ->zone_list_next;
|
||||||
} else {
|
} else {
|
||||||
sseq->zone_list = 0;
|
sseq->zone_list = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_own_cluster(node)) {
|
if (in_own_cluster(node)) {
|
||||||
@ -431,7 +431,7 @@ struct publication *tipc_nameseq_remove_publ(struct name_seq *nseq, u32 inst,
|
|||||||
prev->cluster_list_next = publ->cluster_list_next;
|
prev->cluster_list_next = publ->cluster_list_next;
|
||||||
sseq->cluster_list = publ->cluster_list_next;
|
sseq->cluster_list = publ->cluster_list_next;
|
||||||
} else {
|
} else {
|
||||||
sseq->cluster_list = 0;
|
sseq->cluster_list = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -450,7 +450,7 @@ struct publication *tipc_nameseq_remove_publ(struct name_seq *nseq, u32 inst,
|
|||||||
prev->node_list_next = publ->node_list_next;
|
prev->node_list_next = publ->node_list_next;
|
||||||
sseq->node_list = publ->node_list_next;
|
sseq->node_list = publ->node_list_next;
|
||||||
} else {
|
} else {
|
||||||
sseq->node_list = 0;
|
sseq->node_list = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert(!publ->node || (publ->node == node));
|
assert(!publ->node || (publ->node == node));
|
||||||
@ -535,7 +535,7 @@ static struct name_seq *nametbl_find_seq(u32 type)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return NULL;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct publication *tipc_nametbl_insert_publ(u32 type, u32 lower, u32 upper,
|
struct publication *tipc_nametbl_insert_publ(u32 type, u32 lower, u32 upper,
|
||||||
@ -547,7 +547,7 @@ struct publication *tipc_nametbl_insert_publ(u32 type, u32 lower, u32 upper,
|
|||||||
if (lower > upper) {
|
if (lower > upper) {
|
||||||
warn("Failed to publish illegal <%u,%u,%u>\n",
|
warn("Failed to publish illegal <%u,%u,%u>\n",
|
||||||
type, lower, upper);
|
type, lower, upper);
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
dbg("Publishing <%u,%u,%u> from %x\n", type, lower, upper, node);
|
dbg("Publishing <%u,%u,%u> from %x\n", type, lower, upper, node);
|
||||||
@ -556,7 +556,7 @@ struct publication *tipc_nametbl_insert_publ(u32 type, u32 lower, u32 upper,
|
|||||||
dbg("tipc_nametbl_insert_publ: created %x\n", seq);
|
dbg("tipc_nametbl_insert_publ: created %x\n", seq);
|
||||||
}
|
}
|
||||||
if (!seq)
|
if (!seq)
|
||||||
return 0;
|
return NULL;
|
||||||
|
|
||||||
assert(seq->type == type);
|
assert(seq->type == type);
|
||||||
return tipc_nameseq_insert_publ(seq, type, lower, upper,
|
return tipc_nameseq_insert_publ(seq, type, lower, upper,
|
||||||
@ -570,7 +570,7 @@ struct publication *tipc_nametbl_remove_publ(u32 type, u32 lower,
|
|||||||
struct name_seq *seq = nametbl_find_seq(type);
|
struct name_seq *seq = nametbl_find_seq(type);
|
||||||
|
|
||||||
if (!seq)
|
if (!seq)
|
||||||
return 0;
|
return NULL;
|
||||||
|
|
||||||
dbg("Withdrawing <%u,%u> from %x\n", type, lower, node);
|
dbg("Withdrawing <%u,%u> from %x\n", type, lower, node);
|
||||||
publ = tipc_nameseq_remove_publ(seq, lower, node, ref, key);
|
publ = tipc_nameseq_remove_publ(seq, lower, node, ref, key);
|
||||||
@ -594,7 +594,7 @@ struct publication *tipc_nametbl_remove_publ(u32 type, u32 lower,
|
|||||||
u32 tipc_nametbl_translate(u32 type, u32 instance, u32 *destnode)
|
u32 tipc_nametbl_translate(u32 type, u32 instance, u32 *destnode)
|
||||||
{
|
{
|
||||||
struct sub_seq *sseq;
|
struct sub_seq *sseq;
|
||||||
struct publication *publ = 0;
|
struct publication *publ = NULL;
|
||||||
struct name_seq *seq;
|
struct name_seq *seq;
|
||||||
u32 ref;
|
u32 ref;
|
||||||
|
|
||||||
@ -740,12 +740,12 @@ struct publication *tipc_nametbl_publish(u32 type, u32 lower, u32 upper,
|
|||||||
if (table.local_publ_count >= tipc_max_publications) {
|
if (table.local_publ_count >= tipc_max_publications) {
|
||||||
warn("Failed publish: max %u local publication\n",
|
warn("Failed publish: max %u local publication\n",
|
||||||
tipc_max_publications);
|
tipc_max_publications);
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
if ((type < TIPC_RESERVED_TYPES) && !atomic_read(&rsv_publ_ok)) {
|
if ((type < TIPC_RESERVED_TYPES) && !atomic_read(&rsv_publ_ok)) {
|
||||||
warn("Failed to publish reserved name <%u,%u,%u>\n",
|
warn("Failed to publish reserved name <%u,%u,%u>\n",
|
||||||
type, lower, upper);
|
type, lower, upper);
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
write_lock_bh(&tipc_nametbl_lock);
|
write_lock_bh(&tipc_nametbl_lock);
|
||||||
|
@ -116,7 +116,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rwlock_t tipc_net_lock = RW_LOCK_UNLOCKED;
|
rwlock_t tipc_net_lock = RW_LOCK_UNLOCKED;
|
||||||
struct network tipc_net = { 0 };
|
struct network tipc_net = { NULL };
|
||||||
|
|
||||||
struct node *tipc_net_select_remote_node(u32 addr, u32 ref)
|
struct node *tipc_net_select_remote_node(u32 addr, u32 ref)
|
||||||
{
|
{
|
||||||
@ -181,7 +181,7 @@ static void net_stop(void)
|
|||||||
tipc_zone_delete(tipc_net.zones[z_num]);
|
tipc_zone_delete(tipc_net.zones[z_num]);
|
||||||
}
|
}
|
||||||
kfree(tipc_net.zones);
|
kfree(tipc_net.zones);
|
||||||
tipc_net.zones = 0;
|
tipc_net.zones = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void net_route_named_msg(struct sk_buff *buf)
|
static void net_route_named_msg(struct sk_buff *buf)
|
||||||
|
@ -155,7 +155,7 @@ static void node_select_active_links(struct node *n_ptr)
|
|||||||
u32 i;
|
u32 i;
|
||||||
u32 highest_prio = 0;
|
u32 highest_prio = 0;
|
||||||
|
|
||||||
active[0] = active[1] = 0;
|
active[0] = active[1] = NULL;
|
||||||
|
|
||||||
for (i = 0; i < MAX_BEARERS; i++) {
|
for (i = 0; i < MAX_BEARERS; i++) {
|
||||||
struct link *l_ptr = n_ptr->links[i];
|
struct link *l_ptr = n_ptr->links[i];
|
||||||
@ -240,7 +240,7 @@ struct node *tipc_node_attach_link(struct link *l_ptr)
|
|||||||
|
|
||||||
err("Attempt to create third link to %s\n",
|
err("Attempt to create third link to %s\n",
|
||||||
addr_string_fill(addr_string, n_ptr->addr));
|
addr_string_fill(addr_string, n_ptr->addr));
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!n_ptr->links[bearer_id]) {
|
if (!n_ptr->links[bearer_id]) {
|
||||||
@ -253,12 +253,12 @@ struct node *tipc_node_attach_link(struct link *l_ptr)
|
|||||||
l_ptr->b_ptr->publ.name,
|
l_ptr->b_ptr->publ.name,
|
||||||
addr_string_fill(addr_string, l_ptr->addr));
|
addr_string_fill(addr_string, l_ptr->addr));
|
||||||
}
|
}
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tipc_node_detach_link(struct node *n_ptr, struct link *l_ptr)
|
void tipc_node_detach_link(struct node *n_ptr, struct link *l_ptr)
|
||||||
{
|
{
|
||||||
n_ptr->links[l_ptr->b_ptr->identity] = 0;
|
n_ptr->links[l_ptr->b_ptr->identity] = NULL;
|
||||||
tipc_net.zones[tipc_zone(l_ptr->addr)]->links--;
|
tipc_net.zones[tipc_zone(l_ptr->addr)]->links--;
|
||||||
n_ptr->link_cnt--;
|
n_ptr->link_cnt--;
|
||||||
}
|
}
|
||||||
@ -424,7 +424,7 @@ static void node_lost_contact(struct node *n_ptr)
|
|||||||
|
|
||||||
/* Notify subscribers */
|
/* Notify subscribers */
|
||||||
list_for_each_entry_safe(ns, tns, &n_ptr->nsub, nodesub_list) {
|
list_for_each_entry_safe(ns, tns, &n_ptr->nsub, nodesub_list) {
|
||||||
ns->node = 0;
|
ns->node = NULL;
|
||||||
list_del_init(&ns->nodesub_list);
|
list_del_init(&ns->nodesub_list);
|
||||||
tipc_k_signal((Handler)ns->handle_node_down,
|
tipc_k_signal((Handler)ns->handle_node_down,
|
||||||
(unsigned long)ns->usr_handle);
|
(unsigned long)ns->usr_handle);
|
||||||
@ -443,7 +443,7 @@ struct node *tipc_node_select_next_hop(u32 addr, u32 selector)
|
|||||||
u32 router_addr;
|
u32 router_addr;
|
||||||
|
|
||||||
if (!tipc_addr_domain_valid(addr))
|
if (!tipc_addr_domain_valid(addr))
|
||||||
return 0;
|
return NULL;
|
||||||
|
|
||||||
/* Look for direct link to destination processsor */
|
/* Look for direct link to destination processsor */
|
||||||
n_ptr = tipc_node_find(addr);
|
n_ptr = tipc_node_find(addr);
|
||||||
@ -452,7 +452,7 @@ struct node *tipc_node_select_next_hop(u32 addr, u32 selector)
|
|||||||
|
|
||||||
/* Cluster local system nodes *must* have direct links */
|
/* Cluster local system nodes *must* have direct links */
|
||||||
if (!is_slave(addr) && in_own_cluster(addr))
|
if (!is_slave(addr) && in_own_cluster(addr))
|
||||||
return 0;
|
return NULL;
|
||||||
|
|
||||||
/* Look for cluster local router with direct link to node */
|
/* Look for cluster local router with direct link to node */
|
||||||
router_addr = tipc_node_select_router(n_ptr, selector);
|
router_addr = tipc_node_select_router(n_ptr, selector);
|
||||||
@ -462,7 +462,7 @@ struct node *tipc_node_select_next_hop(u32 addr, u32 selector)
|
|||||||
/* Slave nodes can only be accessed within own cluster via a
|
/* Slave nodes can only be accessed within own cluster via a
|
||||||
known router with direct link -- if no router was found,give up */
|
known router with direct link -- if no router was found,give up */
|
||||||
if (is_slave(addr))
|
if (is_slave(addr))
|
||||||
return 0;
|
return NULL;
|
||||||
|
|
||||||
/* Inter zone/cluster -- find any direct link to remote cluster */
|
/* Inter zone/cluster -- find any direct link to remote cluster */
|
||||||
addr = tipc_addr(tipc_zone(addr), tipc_cluster(addr), 0);
|
addr = tipc_addr(tipc_zone(addr), tipc_cluster(addr), 0);
|
||||||
@ -475,7 +475,7 @@ struct node *tipc_node_select_next_hop(u32 addr, u32 selector)
|
|||||||
if (router_addr)
|
if (router_addr)
|
||||||
return tipc_node_select(router_addr, selector);
|
return tipc_node_select(router_addr, selector);
|
||||||
|
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -121,7 +121,7 @@ static inline struct node *tipc_node_find(u32 addr)
|
|||||||
if (c_ptr)
|
if (c_ptr)
|
||||||
return c_ptr->nodes[tipc_node(addr)];
|
return c_ptr->nodes[tipc_node(addr)];
|
||||||
}
|
}
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline struct node *tipc_node_select(u32 addr, u32 selector)
|
static inline struct node *tipc_node_select(u32 addr, u32 selector)
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
void tipc_nodesub_subscribe(struct node_subscr *node_sub, u32 addr,
|
void tipc_nodesub_subscribe(struct node_subscr *node_sub, u32 addr,
|
||||||
void *usr_handle, net_ev_handler handle_down)
|
void *usr_handle, net_ev_handler handle_down)
|
||||||
{
|
{
|
||||||
node_sub->node = 0;
|
node_sub->node = NULL;
|
||||||
if (addr == tipc_own_addr)
|
if (addr == tipc_own_addr)
|
||||||
return;
|
return;
|
||||||
if (!tipc_addr_node_valid(addr)) {
|
if (!tipc_addr_node_valid(addr)) {
|
||||||
|
@ -54,8 +54,8 @@
|
|||||||
|
|
||||||
#define MAX_REJECT_SIZE 1024
|
#define MAX_REJECT_SIZE 1024
|
||||||
|
|
||||||
static struct sk_buff *msg_queue_head = 0;
|
static struct sk_buff *msg_queue_head = NULL;
|
||||||
static struct sk_buff *msg_queue_tail = 0;
|
static struct sk_buff *msg_queue_tail = NULL;
|
||||||
|
|
||||||
spinlock_t tipc_port_list_lock = SPIN_LOCK_UNLOCKED;
|
spinlock_t tipc_port_list_lock = SPIN_LOCK_UNLOCKED;
|
||||||
static spinlock_t queue_lock = SPIN_LOCK_UNLOCKED;
|
static spinlock_t queue_lock = SPIN_LOCK_UNLOCKED;
|
||||||
@ -258,11 +258,11 @@ u32 tipc_createport_raw(void *usr_handle,
|
|||||||
p_ptr->publ.usr_handle = usr_handle;
|
p_ptr->publ.usr_handle = usr_handle;
|
||||||
INIT_LIST_HEAD(&p_ptr->wait_list);
|
INIT_LIST_HEAD(&p_ptr->wait_list);
|
||||||
INIT_LIST_HEAD(&p_ptr->subscription.nodesub_list);
|
INIT_LIST_HEAD(&p_ptr->subscription.nodesub_list);
|
||||||
p_ptr->congested_link = 0;
|
p_ptr->congested_link = NULL;
|
||||||
p_ptr->max_pkt = MAX_PKT_DEFAULT;
|
p_ptr->max_pkt = MAX_PKT_DEFAULT;
|
||||||
p_ptr->dispatcher = dispatcher;
|
p_ptr->dispatcher = dispatcher;
|
||||||
p_ptr->wakeup = wakeup;
|
p_ptr->wakeup = wakeup;
|
||||||
p_ptr->user_port = 0;
|
p_ptr->user_port = NULL;
|
||||||
k_init_timer(&p_ptr->timer, (Handler)port_timeout, ref);
|
k_init_timer(&p_ptr->timer, (Handler)port_timeout, ref);
|
||||||
spin_lock_bh(&tipc_port_list_lock);
|
spin_lock_bh(&tipc_port_list_lock);
|
||||||
INIT_LIST_HEAD(&p_ptr->publications);
|
INIT_LIST_HEAD(&p_ptr->publications);
|
||||||
@ -276,9 +276,9 @@ u32 tipc_createport_raw(void *usr_handle,
|
|||||||
int tipc_deleteport(u32 ref)
|
int tipc_deleteport(u32 ref)
|
||||||
{
|
{
|
||||||
struct port *p_ptr;
|
struct port *p_ptr;
|
||||||
struct sk_buff *buf = 0;
|
struct sk_buff *buf = NULL;
|
||||||
|
|
||||||
tipc_withdraw(ref, 0, 0);
|
tipc_withdraw(ref, 0, NULL);
|
||||||
p_ptr = tipc_port_lock(ref);
|
p_ptr = tipc_port_lock(ref);
|
||||||
if (!p_ptr)
|
if (!p_ptr)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@ -329,7 +329,7 @@ void *tipc_get_handle(const u32 ref)
|
|||||||
|
|
||||||
p_ptr = tipc_port_lock(ref);
|
p_ptr = tipc_port_lock(ref);
|
||||||
if (!p_ptr)
|
if (!p_ptr)
|
||||||
return 0;
|
return NULL;
|
||||||
handle = p_ptr->publ.usr_handle;
|
handle = p_ptr->publ.usr_handle;
|
||||||
tipc_port_unlock(p_ptr);
|
tipc_port_unlock(p_ptr);
|
||||||
return handle;
|
return handle;
|
||||||
@ -475,7 +475,7 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err)
|
|||||||
|
|
||||||
/* send self-abort message when rejecting on a connected port */
|
/* send self-abort message when rejecting on a connected port */
|
||||||
if (msg_connected(msg)) {
|
if (msg_connected(msg)) {
|
||||||
struct sk_buff *abuf = 0;
|
struct sk_buff *abuf = NULL;
|
||||||
struct port *p_ptr = tipc_port_lock(msg_destport(msg));
|
struct port *p_ptr = tipc_port_lock(msg_destport(msg));
|
||||||
|
|
||||||
if (p_ptr) {
|
if (p_ptr) {
|
||||||
@ -510,7 +510,7 @@ int tipc_port_reject_sections(struct port *p_ptr, struct tipc_msg *hdr,
|
|||||||
static void port_timeout(unsigned long ref)
|
static void port_timeout(unsigned long ref)
|
||||||
{
|
{
|
||||||
struct port *p_ptr = tipc_port_lock(ref);
|
struct port *p_ptr = tipc_port_lock(ref);
|
||||||
struct sk_buff *buf = 0;
|
struct sk_buff *buf = NULL;
|
||||||
|
|
||||||
if (!p_ptr || !p_ptr->publ.connected)
|
if (!p_ptr || !p_ptr->publ.connected)
|
||||||
return;
|
return;
|
||||||
@ -540,7 +540,7 @@ static void port_timeout(unsigned long ref)
|
|||||||
static void port_handle_node_down(unsigned long ref)
|
static void port_handle_node_down(unsigned long ref)
|
||||||
{
|
{
|
||||||
struct port *p_ptr = tipc_port_lock(ref);
|
struct port *p_ptr = tipc_port_lock(ref);
|
||||||
struct sk_buff* buf = 0;
|
struct sk_buff* buf = NULL;
|
||||||
|
|
||||||
if (!p_ptr)
|
if (!p_ptr)
|
||||||
return;
|
return;
|
||||||
@ -555,7 +555,7 @@ static struct sk_buff *port_build_self_abort_msg(struct port *p_ptr, u32 err)
|
|||||||
u32 imp = msg_importance(&p_ptr->publ.phdr);
|
u32 imp = msg_importance(&p_ptr->publ.phdr);
|
||||||
|
|
||||||
if (!p_ptr->publ.connected)
|
if (!p_ptr->publ.connected)
|
||||||
return 0;
|
return NULL;
|
||||||
if (imp < TIPC_CRITICAL_IMPORTANCE)
|
if (imp < TIPC_CRITICAL_IMPORTANCE)
|
||||||
imp++;
|
imp++;
|
||||||
return port_build_proto_msg(p_ptr->publ.ref,
|
return port_build_proto_msg(p_ptr->publ.ref,
|
||||||
@ -575,7 +575,7 @@ static struct sk_buff *port_build_peer_abort_msg(struct port *p_ptr, u32 err)
|
|||||||
u32 imp = msg_importance(&p_ptr->publ.phdr);
|
u32 imp = msg_importance(&p_ptr->publ.phdr);
|
||||||
|
|
||||||
if (!p_ptr->publ.connected)
|
if (!p_ptr->publ.connected)
|
||||||
return 0;
|
return NULL;
|
||||||
if (imp < TIPC_CRITICAL_IMPORTANCE)
|
if (imp < TIPC_CRITICAL_IMPORTANCE)
|
||||||
imp++;
|
imp++;
|
||||||
return port_build_proto_msg(port_peerport(p_ptr),
|
return port_build_proto_msg(port_peerport(p_ptr),
|
||||||
@ -594,8 +594,8 @@ void tipc_port_recv_proto_msg(struct sk_buff *buf)
|
|||||||
struct tipc_msg *msg = buf_msg(buf);
|
struct tipc_msg *msg = buf_msg(buf);
|
||||||
struct port *p_ptr = tipc_port_lock(msg_destport(msg));
|
struct port *p_ptr = tipc_port_lock(msg_destport(msg));
|
||||||
u32 err = TIPC_OK;
|
u32 err = TIPC_OK;
|
||||||
struct sk_buff *r_buf = 0;
|
struct sk_buff *r_buf = NULL;
|
||||||
struct sk_buff *abort_buf = 0;
|
struct sk_buff *abort_buf = NULL;
|
||||||
|
|
||||||
msg_dbg(msg, "PORT<RECV<:");
|
msg_dbg(msg, "PORT<RECV<:");
|
||||||
|
|
||||||
@ -804,7 +804,7 @@ static void port_dispatcher_sigh(void *dummy)
|
|||||||
|
|
||||||
spin_lock_bh(&queue_lock);
|
spin_lock_bh(&queue_lock);
|
||||||
buf = msg_queue_head;
|
buf = msg_queue_head;
|
||||||
msg_queue_head = 0;
|
msg_queue_head = NULL;
|
||||||
spin_unlock_bh(&queue_lock);
|
spin_unlock_bh(&queue_lock);
|
||||||
|
|
||||||
while (buf) {
|
while (buf) {
|
||||||
@ -991,8 +991,8 @@ static void port_wakeup_sh(unsigned long ref)
|
|||||||
{
|
{
|
||||||
struct port *p_ptr;
|
struct port *p_ptr;
|
||||||
struct user_port *up_ptr;
|
struct user_port *up_ptr;
|
||||||
tipc_continue_event cb = 0;
|
tipc_continue_event cb = NULL;
|
||||||
void *uh = 0;
|
void *uh = NULL;
|
||||||
|
|
||||||
p_ptr = tipc_port_lock(ref);
|
p_ptr = tipc_port_lock(ref);
|
||||||
if (p_ptr) {
|
if (p_ptr) {
|
||||||
@ -1016,7 +1016,7 @@ static void port_wakeup(struct tipc_port *p_ptr)
|
|||||||
void tipc_acknowledge(u32 ref, u32 ack)
|
void tipc_acknowledge(u32 ref, u32 ack)
|
||||||
{
|
{
|
||||||
struct port *p_ptr;
|
struct port *p_ptr;
|
||||||
struct sk_buff *buf = 0;
|
struct sk_buff *buf = NULL;
|
||||||
|
|
||||||
p_ptr = tipc_port_lock(ref);
|
p_ptr = tipc_port_lock(ref);
|
||||||
if (!p_ptr)
|
if (!p_ptr)
|
||||||
@ -1062,7 +1062,7 @@ int tipc_createport(u32 user_ref,
|
|||||||
if (up_ptr == NULL) {
|
if (up_ptr == NULL) {
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
ref = tipc_createport_raw(0, port_dispatcher, port_wakeup, importance);
|
ref = tipc_createport_raw(NULL, port_dispatcher, port_wakeup, importance);
|
||||||
p_ptr = tipc_port_lock(ref);
|
p_ptr = tipc_port_lock(ref);
|
||||||
if (!p_ptr) {
|
if (!p_ptr) {
|
||||||
kfree(up_ptr);
|
kfree(up_ptr);
|
||||||
@ -1273,7 +1273,7 @@ int tipc_disconnect(u32 ref)
|
|||||||
int tipc_shutdown(u32 ref)
|
int tipc_shutdown(u32 ref)
|
||||||
{
|
{
|
||||||
struct port *p_ptr;
|
struct port *p_ptr;
|
||||||
struct sk_buff *buf = 0;
|
struct sk_buff *buf = NULL;
|
||||||
|
|
||||||
p_ptr = tipc_port_lock(ref);
|
p_ptr = tipc_port_lock(ref);
|
||||||
if (!p_ptr)
|
if (!p_ptr)
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
* because entry 0's reference field has the form XXXX|1--1.
|
* because entry 0's reference field has the form XXXX|1--1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct ref_table tipc_ref_table = { 0 };
|
struct ref_table tipc_ref_table = { NULL };
|
||||||
|
|
||||||
static rwlock_t ref_table_lock = RW_LOCK_UNLOCKED;
|
static rwlock_t ref_table_lock = RW_LOCK_UNLOCKED;
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ int tipc_ref_table_init(u32 requested_size, u32 start)
|
|||||||
write_lock_bh(&ref_table_lock);
|
write_lock_bh(&ref_table_lock);
|
||||||
index_mask = sz - 1;
|
index_mask = sz - 1;
|
||||||
for (i = sz - 1; i >= 0; i--) {
|
for (i = sz - 1; i >= 0; i--) {
|
||||||
table[i].object = 0;
|
table[i].object = NULL;
|
||||||
table[i].lock = SPIN_LOCK_UNLOCKED;
|
table[i].lock = SPIN_LOCK_UNLOCKED;
|
||||||
table[i].data.next_plus_upper = (start & ~index_mask) + i - 1;
|
table[i].data.next_plus_upper = (start & ~index_mask) + i - 1;
|
||||||
}
|
}
|
||||||
@ -108,7 +108,7 @@ void tipc_ref_table_stop(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
vfree(tipc_ref_table.entries);
|
vfree(tipc_ref_table.entries);
|
||||||
tipc_ref_table.entries = 0;
|
tipc_ref_table.entries = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -173,7 +173,7 @@ void tipc_ref_discard(u32 ref)
|
|||||||
assert(entry->data.reference == ref);
|
assert(entry->data.reference == ref);
|
||||||
|
|
||||||
/* mark entry as unused */
|
/* mark entry as unused */
|
||||||
entry->object = 0;
|
entry->object = NULL;
|
||||||
if (tipc_ref_table.first_free == 0)
|
if (tipc_ref_table.first_free == 0)
|
||||||
tipc_ref_table.first_free = index;
|
tipc_ref_table.first_free = index;
|
||||||
else
|
else
|
||||||
|
@ -92,7 +92,7 @@ static inline void *tipc_ref_lock(u32 ref)
|
|||||||
return r->object;
|
return r->object;
|
||||||
spin_unlock_bh(&r->lock);
|
spin_unlock_bh(&r->lock);
|
||||||
}
|
}
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -125,7 +125,7 @@ static inline void *tipc_ref_deref(u32 ref)
|
|||||||
if (likely(r->data.reference == ref))
|
if (likely(r->data.reference == ref))
|
||||||
return r->object;
|
return r->object;
|
||||||
}
|
}
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -178,7 +178,7 @@ static int tipc_create(struct socket *sock, int protocol)
|
|||||||
if (unlikely(protocol != 0))
|
if (unlikely(protocol != 0))
|
||||||
return -EPROTONOSUPPORT;
|
return -EPROTONOSUPPORT;
|
||||||
|
|
||||||
ref = tipc_createport_raw(0, &dispatch, &wakeupdispatch, TIPC_LOW_IMPORTANCE);
|
ref = tipc_createport_raw(NULL, &dispatch, &wakeupdispatch, TIPC_LOW_IMPORTANCE);
|
||||||
if (unlikely(!ref))
|
if (unlikely(!ref))
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
@ -265,7 +265,7 @@ static int release(struct socket *sock)
|
|||||||
sock_lock(tsock);
|
sock_lock(tsock);
|
||||||
buf = skb_dequeue(&sk->sk_receive_queue);
|
buf = skb_dequeue(&sk->sk_receive_queue);
|
||||||
if (!buf)
|
if (!buf)
|
||||||
tsock->p->usr_handle = 0;
|
tsock->p->usr_handle = NULL;
|
||||||
sock_unlock(tsock);
|
sock_unlock(tsock);
|
||||||
if (!buf)
|
if (!buf)
|
||||||
break;
|
break;
|
||||||
@ -319,7 +319,7 @@ static int bind(struct socket *sock, struct sockaddr *uaddr, int uaddr_len)
|
|||||||
return -ERESTARTSYS;
|
return -ERESTARTSYS;
|
||||||
|
|
||||||
if (unlikely(!uaddr_len)) {
|
if (unlikely(!uaddr_len)) {
|
||||||
res = tipc_withdraw(tsock->p->ref, 0, 0);
|
res = tipc_withdraw(tsock->p->ref, 0, NULL);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1226,7 +1226,7 @@ static int connect(struct socket *sock, struct sockaddr *dest, int destlen,
|
|||||||
{
|
{
|
||||||
struct tipc_sock *tsock = tipc_sk(sock->sk);
|
struct tipc_sock *tsock = tipc_sk(sock->sk);
|
||||||
struct sockaddr_tipc *dst = (struct sockaddr_tipc *)dest;
|
struct sockaddr_tipc *dst = (struct sockaddr_tipc *)dest;
|
||||||
struct msghdr m = {0,};
|
struct msghdr m = {NULL,};
|
||||||
struct sk_buff *buf;
|
struct sk_buff *buf;
|
||||||
struct tipc_msg *msg;
|
struct tipc_msg *msg;
|
||||||
int res;
|
int res;
|
||||||
@ -1251,7 +1251,7 @@ static int connect(struct socket *sock, struct sockaddr *dest, int destlen,
|
|||||||
/* Send a 'SYN-' to destination */
|
/* Send a 'SYN-' to destination */
|
||||||
|
|
||||||
m.msg_name = dest;
|
m.msg_name = dest;
|
||||||
if ((res = send_msg(0, sock, &m, 0)) < 0) {
|
if ((res = send_msg(NULL, sock, &m, 0)) < 0) {
|
||||||
sock->state = SS_DISCONNECTING;
|
sock->state = SS_DISCONNECTING;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -1367,9 +1367,9 @@ static int accept(struct socket *sock, struct socket *newsock, int flags)
|
|||||||
|
|
||||||
msg_dbg(msg,"<ACC<: ");
|
msg_dbg(msg,"<ACC<: ");
|
||||||
if (!msg_data_sz(msg)) {
|
if (!msg_data_sz(msg)) {
|
||||||
struct msghdr m = {0,};
|
struct msghdr m = {NULL,};
|
||||||
|
|
||||||
send_packet(0, newsock, &m, 0);
|
send_packet(NULL, newsock, &m, 0);
|
||||||
advance_queue(tsock);
|
advance_queue(tsock);
|
||||||
} else {
|
} else {
|
||||||
sock_lock(tsock);
|
sock_lock(tsock);
|
||||||
|
@ -381,7 +381,7 @@ static void subscr_named_msg_event(void *usr_handle,
|
|||||||
struct tipc_name_seq const *dest)
|
struct tipc_name_seq const *dest)
|
||||||
{
|
{
|
||||||
struct subscriber *subscriber;
|
struct subscriber *subscriber;
|
||||||
struct iovec msg_sect = {0, 0};
|
struct iovec msg_sect = {NULL, 0};
|
||||||
spinlock_t *subscriber_lock;
|
spinlock_t *subscriber_lock;
|
||||||
|
|
||||||
dbg("subscr_named_msg_event: orig = %x own = %x,\n",
|
dbg("subscr_named_msg_event: orig = %x own = %x,\n",
|
||||||
@ -413,13 +413,13 @@ static void subscr_named_msg_event(void *usr_handle,
|
|||||||
tipc_createport(topsrv.user_ref,
|
tipc_createport(topsrv.user_ref,
|
||||||
(void *)(unsigned long)subscriber->ref,
|
(void *)(unsigned long)subscriber->ref,
|
||||||
importance,
|
importance,
|
||||||
0,
|
NULL,
|
||||||
0,
|
NULL,
|
||||||
subscr_conn_shutdown_event,
|
subscr_conn_shutdown_event,
|
||||||
0,
|
NULL,
|
||||||
0,
|
NULL,
|
||||||
subscr_conn_msg_event,
|
subscr_conn_msg_event,
|
||||||
0,
|
NULL,
|
||||||
&subscriber->port_ref);
|
&subscriber->port_ref);
|
||||||
if (subscriber->port_ref == 0) {
|
if (subscriber->port_ref == 0) {
|
||||||
warn("Memory squeeze; failed to create subscription port\n");
|
warn("Memory squeeze; failed to create subscription port\n");
|
||||||
@ -461,22 +461,22 @@ int tipc_subscr_start(void)
|
|||||||
INIT_LIST_HEAD(&topsrv.subscriber_list);
|
INIT_LIST_HEAD(&topsrv.subscriber_list);
|
||||||
|
|
||||||
spin_lock_bh(&topsrv.lock);
|
spin_lock_bh(&topsrv.lock);
|
||||||
res = tipc_attach(&topsrv.user_ref, 0, 0);
|
res = tipc_attach(&topsrv.user_ref, NULL, NULL);
|
||||||
if (res) {
|
if (res) {
|
||||||
spin_unlock_bh(&topsrv.lock);
|
spin_unlock_bh(&topsrv.lock);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = tipc_createport(topsrv.user_ref,
|
res = tipc_createport(topsrv.user_ref,
|
||||||
0,
|
NULL,
|
||||||
TIPC_CRITICAL_IMPORTANCE,
|
TIPC_CRITICAL_IMPORTANCE,
|
||||||
0,
|
NULL,
|
||||||
0,
|
NULL,
|
||||||
0,
|
NULL,
|
||||||
0,
|
NULL,
|
||||||
subscr_named_msg_event,
|
subscr_named_msg_event,
|
||||||
0,
|
NULL,
|
||||||
0,
|
NULL,
|
||||||
&topsrv.setup_port);
|
&topsrv.setup_port);
|
||||||
if (res)
|
if (res)
|
||||||
goto failed;
|
goto failed;
|
||||||
|
@ -65,7 +65,7 @@ struct tipc_user {
|
|||||||
#define MAX_USERID 64
|
#define MAX_USERID 64
|
||||||
#define USER_LIST_SIZE ((MAX_USERID + 1) * sizeof(struct tipc_user))
|
#define USER_LIST_SIZE ((MAX_USERID + 1) * sizeof(struct tipc_user))
|
||||||
|
|
||||||
static struct tipc_user *users = 0;
|
static struct tipc_user *users = NULL;
|
||||||
static u32 next_free_user = MAX_USERID + 1;
|
static u32 next_free_user = MAX_USERID + 1;
|
||||||
static spinlock_t reg_lock = SPIN_LOCK_UNLOCKED;
|
static spinlock_t reg_lock = SPIN_LOCK_UNLOCKED;
|
||||||
|
|
||||||
@ -149,7 +149,7 @@ void tipc_reg_stop(void)
|
|||||||
reg_callback(&users[id]);
|
reg_callback(&users[id]);
|
||||||
}
|
}
|
||||||
kfree(users);
|
kfree(users);
|
||||||
users = 0;
|
users = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -44,11 +44,11 @@
|
|||||||
|
|
||||||
struct _zone *tipc_zone_create(u32 addr)
|
struct _zone *tipc_zone_create(u32 addr)
|
||||||
{
|
{
|
||||||
struct _zone *z_ptr = 0;
|
struct _zone *z_ptr = NULL;
|
||||||
u32 z_num;
|
u32 z_num;
|
||||||
|
|
||||||
if (!tipc_addr_domain_valid(addr))
|
if (!tipc_addr_domain_valid(addr))
|
||||||
return 0;
|
return NULL;
|
||||||
|
|
||||||
z_ptr = (struct _zone *)kmalloc(sizeof(*z_ptr), GFP_ATOMIC);
|
z_ptr = (struct _zone *)kmalloc(sizeof(*z_ptr), GFP_ATOMIC);
|
||||||
if (z_ptr != NULL) {
|
if (z_ptr != NULL) {
|
||||||
@ -114,10 +114,10 @@ struct node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref
|
|||||||
u32 c_num;
|
u32 c_num;
|
||||||
|
|
||||||
if (!z_ptr)
|
if (!z_ptr)
|
||||||
return 0;
|
return NULL;
|
||||||
c_ptr = z_ptr->clusters[tipc_cluster(addr)];
|
c_ptr = z_ptr->clusters[tipc_cluster(addr)];
|
||||||
if (!c_ptr)
|
if (!c_ptr)
|
||||||
return 0;
|
return NULL;
|
||||||
n_ptr = tipc_cltr_select_node(c_ptr, ref);
|
n_ptr = tipc_cltr_select_node(c_ptr, ref);
|
||||||
if (n_ptr)
|
if (n_ptr)
|
||||||
return n_ptr;
|
return n_ptr;
|
||||||
@ -126,12 +126,12 @@ struct node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref
|
|||||||
for (c_num = 1; c_num <= tipc_max_clusters; c_num++) {
|
for (c_num = 1; c_num <= tipc_max_clusters; c_num++) {
|
||||||
c_ptr = z_ptr->clusters[c_num];
|
c_ptr = z_ptr->clusters[c_num];
|
||||||
if (!c_ptr)
|
if (!c_ptr)
|
||||||
return 0;
|
return NULL;
|
||||||
n_ptr = tipc_cltr_select_node(c_ptr, ref);
|
n_ptr = tipc_cltr_select_node(c_ptr, ref);
|
||||||
if (n_ptr)
|
if (n_ptr)
|
||||||
return n_ptr;
|
return n_ptr;
|
||||||
}
|
}
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 tipc_zone_select_router(struct _zone *z_ptr, u32 addr, u32 ref)
|
u32 tipc_zone_select_router(struct _zone *z_ptr, u32 addr, u32 ref)
|
||||||
|
Loading…
Reference in New Issue
Block a user