aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/tipc/bcast.c2
-rw-r--r--net/tipc/bearer.c20
-rw-r--r--net/tipc/cluster.c12
-rw-r--r--net/tipc/cluster.h2
-rw-r--r--net/tipc/config.c4
-rw-r--r--net/tipc/dbg.c4
-rw-r--r--net/tipc/eth_media.c4
-rw-r--r--net/tipc/link.c28
-rw-r--r--net/tipc/name_distr.c6
-rw-r--r--net/tipc/name_table.c36
-rw-r--r--net/tipc/net.c4
-rw-r--r--net/tipc/node.c18
-rw-r--r--net/tipc/node.h2
-rw-r--r--net/tipc/node_subscr.c2
-rw-r--r--net/tipc/port.c40
-rw-r--r--net/tipc/ref.c8
-rw-r--r--net/tipc/ref.h4
-rw-r--r--net/tipc/socket.c14
-rw-r--r--net/tipc/subscr.c28
-rw-r--r--net/tipc/user_reg.c4
-rw-r--r--net/tipc/zone.c12
21 files changed, 127 insertions, 127 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index a7b04f397c12..a926cec24119 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -271,7 +271,7 @@ static void bclink_send_nack(struct node *n_ptr)
271 msg_set_bcgap_to(msg, n_ptr->bclink.gap_to); 271 msg_set_bcgap_to(msg, n_ptr->bclink.gap_to);
272 msg_set_bcast_tag(msg, tipc_own_tag); 272 msg_set_bcast_tag(msg, tipc_own_tag);
273 273
274 if (tipc_bearer_send(&bcbearer->bearer, buf, 0)) { 274 if (tipc_bearer_send(&bcbearer->bearer, buf, NULL)) {
275 bcl->stats.sent_nacks++; 275 bcl->stats.sent_nacks++;
276 buf_discard(buf); 276 buf_discard(buf);
277 } else { 277 } else {
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index 64dcb0f3a8b2..e213a8e54855 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -45,10 +45,10 @@
45 45
46#define MAX_ADDR_STR 32 46#define MAX_ADDR_STR 32
47 47
48static struct media *media_list = 0; 48static struct media *media_list = NULL;
49static u32 media_count = 0; 49static u32 media_count = 0;
50 50
51struct bearer *tipc_bearers = 0; 51struct bearer *tipc_bearers = NULL;
52 52
53/** 53/**
54 * media_name_valid - validate media name 54 * media_name_valid - validate media name
@@ -79,7 +79,7 @@ static struct media *media_find(const char *name)
79 if (!strcmp(m_ptr->name, name)) 79 if (!strcmp(m_ptr->name, name))
80 return m_ptr; 80 return m_ptr;
81 } 81 }
82 return 0; 82 return NULL;
83} 83}
84 84
85/** 85/**
@@ -287,7 +287,7 @@ static struct bearer *bearer_find(const char *name)
287 if (b_ptr->active && (!strcmp(b_ptr->publ.name, name))) 287 if (b_ptr->active && (!strcmp(b_ptr->publ.name, name)))
288 return b_ptr; 288 return b_ptr;
289 } 289 }
290 return 0; 290 return NULL;
291} 291}
292 292
293/** 293/**
@@ -307,7 +307,7 @@ struct bearer *tipc_bearer_find_interface(const char *if_name)
307 if (!strcmp(b_if_name, if_name)) 307 if (!strcmp(b_if_name, if_name))
308 return b_ptr; 308 return b_ptr;
309 } 309 }
310 return 0; 310 return NULL;
311} 311}
312 312
313/** 313/**
@@ -569,7 +569,7 @@ failed:
569 569
570int tipc_block_bearer(const char *name) 570int tipc_block_bearer(const char *name)
571{ 571{
572 struct bearer *b_ptr = 0; 572 struct bearer *b_ptr = NULL;
573 struct link *l_ptr; 573 struct link *l_ptr;
574 struct link *temp_l_ptr; 574 struct link *temp_l_ptr;
575 575
@@ -666,8 +666,8 @@ int tipc_bearer_init(void)
666 } else { 666 } else {
667 kfree(tipc_bearers); 667 kfree(tipc_bearers);
668 kfree(media_list); 668 kfree(media_list);
669 tipc_bearers = 0; 669 tipc_bearers = NULL;
670 media_list = 0; 670 media_list = NULL;
671 res = -ENOMEM; 671 res = -ENOMEM;
672 } 672 }
673 write_unlock_bh(&tipc_net_lock); 673 write_unlock_bh(&tipc_net_lock);
@@ -691,8 +691,8 @@ void tipc_bearer_stop(void)
691 } 691 }
692 kfree(tipc_bearers); 692 kfree(tipc_bearers);
693 kfree(media_list); 693 kfree(media_list);
694 tipc_bearers = 0; 694 tipc_bearers = NULL;
695 media_list = 0; 695 media_list = NULL;
696 media_count = 0; 696 media_count = 0;
697} 697}
698 698
diff --git a/net/tipc/cluster.c b/net/tipc/cluster.c
index ab974ca19371..9fe45a4837df 100644
--- a/net/tipc/cluster.c
+++ b/net/tipc/cluster.c
@@ -48,7 +48,7 @@ void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf,
48 u32 lower, u32 upper); 48 u32 lower, u32 upper);
49struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest); 49struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest);
50 50
51struct node **tipc_local_nodes = 0; 51struct node **tipc_local_nodes = NULL;
52struct node_map tipc_cltr_bcast_nodes = {0,{0,}}; 52struct node_map tipc_cltr_bcast_nodes = {0,{0,}};
53u32 tipc_highest_allowed_slave = 0; 53u32 tipc_highest_allowed_slave = 0;
54 54
@@ -61,7 +61,7 @@ struct cluster *tipc_cltr_create(u32 addr)
61 61
62 c_ptr = (struct cluster *)kmalloc(sizeof(*c_ptr), GFP_ATOMIC); 62 c_ptr = (struct cluster *)kmalloc(sizeof(*c_ptr), GFP_ATOMIC);
63 if (c_ptr == NULL) 63 if (c_ptr == NULL)
64 return 0; 64 return NULL;
65 memset(c_ptr, 0, sizeof(*c_ptr)); 65 memset(c_ptr, 0, sizeof(*c_ptr));
66 66
67 c_ptr->addr = tipc_addr(tipc_zone(addr), tipc_cluster(addr), 0); 67 c_ptr->addr = tipc_addr(tipc_zone(addr), tipc_cluster(addr), 0);
@@ -73,7 +73,7 @@ struct cluster *tipc_cltr_create(u32 addr)
73 c_ptr->nodes = (struct node **)kmalloc(alloc, GFP_ATOMIC); 73 c_ptr->nodes = (struct node **)kmalloc(alloc, GFP_ATOMIC);
74 if (c_ptr->nodes == NULL) { 74 if (c_ptr->nodes == NULL) {
75 kfree(c_ptr); 75 kfree(c_ptr);
76 return 0; 76 return NULL;
77 } 77 }
78 memset(c_ptr->nodes, 0, alloc); 78 memset(c_ptr->nodes, 0, alloc);
79 if (in_own_cluster(addr)) 79 if (in_own_cluster(addr))
@@ -91,7 +91,7 @@ struct cluster *tipc_cltr_create(u32 addr)
91 } 91 }
92 else { 92 else {
93 kfree(c_ptr); 93 kfree(c_ptr);
94 c_ptr = 0; 94 c_ptr = NULL;
95 } 95 }
96 96
97 return c_ptr; 97 return c_ptr;
@@ -204,7 +204,7 @@ struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector)
204 204
205 assert(!in_own_cluster(c_ptr->addr)); 205 assert(!in_own_cluster(c_ptr->addr));
206 if (!c_ptr->highest_node) 206 if (!c_ptr->highest_node)
207 return 0; 207 return NULL;
208 208
209 /* Start entry must be random */ 209 /* Start entry must be random */
210 while (mask > c_ptr->highest_node) { 210 while (mask > c_ptr->highest_node) {
@@ -222,7 +222,7 @@ struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector)
222 if (tipc_node_has_active_links(c_ptr->nodes[n_num])) 222 if (tipc_node_has_active_links(c_ptr->nodes[n_num]))
223 return c_ptr->nodes[n_num]; 223 return c_ptr->nodes[n_num];
224 } 224 }
225 return 0; 225 return NULL;
226} 226}
227 227
228/* 228/*
diff --git a/net/tipc/cluster.h b/net/tipc/cluster.h
index 9963642e1058..1b4cd309495a 100644
--- a/net/tipc/cluster.h
+++ b/net/tipc/cluster.h
@@ -86,7 +86,7 @@ static inline struct cluster *tipc_cltr_find(u32 addr)
86 86
87 if (z_ptr) 87 if (z_ptr)
88 return z_ptr->clusters[1]; 88 return z_ptr->clusters[1];
89 return 0; 89 return NULL;
90} 90}
91 91
92#endif 92#endif
diff --git a/net/tipc/config.c b/net/tipc/config.c
index 3c8e6740e5ae..48b5de2dbe60 100644
--- a/net/tipc/config.c
+++ b/net/tipc/config.c
@@ -683,11 +683,11 @@ int tipc_cfg_init(void)
683 memset(&mng, 0, sizeof(mng)); 683 memset(&mng, 0, sizeof(mng));
684 INIT_LIST_HEAD(&mng.link_subscribers); 684 INIT_LIST_HEAD(&mng.link_subscribers);
685 685
686 res = tipc_attach(&mng.user_ref, 0, 0); 686 res = tipc_attach(&mng.user_ref, NULL, NULL);
687 if (res) 687 if (res)
688 goto failed; 688 goto failed;
689 689
690 res = tipc_createport(mng.user_ref, 0, TIPC_CRITICAL_IMPORTANCE, 690 res = tipc_createport(mng.user_ref, NULL, TIPC_CRITICAL_IMPORTANCE,
691 NULL, NULL, NULL, 691 NULL, NULL, NULL,
692 NULL, cfg_named_msg_event, NULL, 692 NULL, cfg_named_msg_event, NULL,
693 NULL, &mng.port_ref); 693 NULL, &mng.port_ref);
diff --git a/net/tipc/dbg.c b/net/tipc/dbg.c
index 4f4beefa7830..26ef95d5fe38 100644
--- a/net/tipc/dbg.c
+++ b/net/tipc/dbg.c
@@ -81,7 +81,7 @@ void tipc_printbuf_init(struct print_buf *pb, char *raw, u32 sz)
81 81
82 pb->crs = pb->buf = raw; 82 pb->crs = pb->buf = raw;
83 pb->size = sz; 83 pb->size = sz;
84 pb->next = 0; 84 pb->next = NULL;
85 pb->buf[0] = 0; 85 pb->buf[0] = 0;
86 pb->buf[sz-1] = ~0; 86 pb->buf[sz-1] = ~0;
87} 87}
@@ -216,7 +216,7 @@ void tipc_printf(struct print_buf *pb, const char *fmt, ...)
216 } 216 }
217 } 217 }
218 pb_next = pb->next; 218 pb_next = pb->next;
219 pb->next = 0; 219 pb->next = NULL;
220 pb = pb_next; 220 pb = pb_next;
221 } 221 }
222 spin_unlock_bh(&print_lock); 222 spin_unlock_bh(&print_lock);
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index 1f8d83b9c8b4..7a252785f727 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
@@ -169,7 +169,7 @@ static int enable_bearer(struct tipc_bearer *tb_ptr)
169 169
170static void disable_bearer(struct tipc_bearer *tb_ptr) 170static void disable_bearer(struct tipc_bearer *tb_ptr)
171{ 171{
172 ((struct eth_bearer *)tb_ptr->usr_handle)->bearer = 0; 172 ((struct eth_bearer *)tb_ptr->usr_handle)->bearer = NULL;
173} 173}
174 174
175/** 175/**
@@ -285,7 +285,7 @@ void tipc_eth_media_stop(void)
285 for (i = 0; i < MAX_ETH_BEARERS ; i++) { 285 for (i = 0; i < MAX_ETH_BEARERS ; i++) {
286 if (eth_bearers[i].bearer) { 286 if (eth_bearers[i].bearer) {
287 eth_bearers[i].bearer->blocked = 1; 287 eth_bearers[i].bearer->blocked = 1;
288 eth_bearers[i].bearer = 0; 288 eth_bearers[i].bearer = NULL;
289 } 289 }
290 if (eth_bearers[i].dev) { 290 if (eth_bearers[i].dev) {
291 dev_remove_pack(&eth_bearers[i].tipc_packet_type); 291 dev_remove_pack(&eth_bearers[i].tipc_packet_type);
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 511872afa459..bbdca3beaaf9 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -573,7 +573,7 @@ void tipc_link_wakeup_ports(struct link *l_ptr, int all)
573 if (win <= 0) 573 if (win <= 0)
574 break; 574 break;
575 list_del_init(&p_ptr->wait_list); 575 list_del_init(&p_ptr->wait_list);
576 p_ptr->congested_link = 0; 576 p_ptr->congested_link = NULL;
577 assert(p_ptr->wakeup); 577 assert(p_ptr->wakeup);
578 spin_lock_bh(p_ptr->publ.lock); 578 spin_lock_bh(p_ptr->publ.lock);
579 p_ptr->publ.congested = 0; 579 p_ptr->publ.congested = 0;
@@ -1355,7 +1355,7 @@ again:
1355 fragm_crs = 0; 1355 fragm_crs = 0;
1356 fragm_rest = 0; 1356 fragm_rest = 0;
1357 sect_rest = 0; 1357 sect_rest = 0;
1358 sect_crs = 0; 1358 sect_crs = NULL;
1359 curr_sect = -1; 1359 curr_sect = -1;
1360 1360
1361 /* Prepare reusable fragment header: */ 1361 /* Prepare reusable fragment header: */
@@ -1549,7 +1549,7 @@ u32 tipc_link_push_packet(struct link *l_ptr)
1549 msg_dbg(buf_msg(buf), ">DEF-PROT>"); 1549 msg_dbg(buf_msg(buf), ">DEF-PROT>");
1550 l_ptr->unacked_window = 0; 1550 l_ptr->unacked_window = 0;
1551 buf_discard(buf); 1551 buf_discard(buf);
1552 l_ptr->proto_msg_queue = 0; 1552 l_ptr->proto_msg_queue = NULL;
1553 return TIPC_OK; 1553 return TIPC_OK;
1554 } else { 1554 } else {
1555 msg_dbg(buf_msg(buf), "|>DEF-PROT>"); 1555 msg_dbg(buf_msg(buf), "|>DEF-PROT>");
@@ -1860,7 +1860,7 @@ u32 tipc_link_defer_pkt(struct sk_buff **head,
1860 struct sk_buff **tail, 1860 struct sk_buff **tail,
1861 struct sk_buff *buf) 1861 struct sk_buff *buf)
1862{ 1862{
1863 struct sk_buff *prev = 0; 1863 struct sk_buff *prev = NULL;
1864 struct sk_buff *crs = *head; 1864 struct sk_buff *crs = *head;
1865 u32 seq_no = msg_seqno(buf_msg(buf)); 1865 u32 seq_no = msg_seqno(buf_msg(buf));
1866 1866
@@ -1953,7 +1953,7 @@ static void link_handle_out_of_seq_msg(struct link *l_ptr,
1953void tipc_link_send_proto_msg(struct link *l_ptr, u32 msg_typ, int probe_msg, 1953void tipc_link_send_proto_msg(struct link *l_ptr, u32 msg_typ, int probe_msg,
1954 u32 gap, u32 tolerance, u32 priority, u32 ack_mtu) 1954 u32 gap, u32 tolerance, u32 priority, u32 ack_mtu)
1955{ 1955{
1956 struct sk_buff *buf = 0; 1956 struct sk_buff *buf = NULL;
1957 struct tipc_msg *msg = l_ptr->pmsg; 1957 struct tipc_msg *msg = l_ptr->pmsg;
1958 u32 msg_size = sizeof(l_ptr->proto_msg); 1958 u32 msg_size = sizeof(l_ptr->proto_msg);
1959 1959
@@ -2426,7 +2426,7 @@ static int link_recv_changeover_msg(struct link **l_ptr,
2426 } 2426 }
2427 } 2427 }
2428exit: 2428exit:
2429 *buf = 0; 2429 *buf = NULL;
2430 buf_discard(tunnel_buf); 2430 buf_discard(tunnel_buf);
2431 return 0; 2431 return 0;
2432} 2432}
@@ -2586,13 +2586,13 @@ static inline void incr_timer_cnt(struct sk_buff *buf)
2586int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb, 2586int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
2587 struct tipc_msg **m) 2587 struct tipc_msg **m)
2588{ 2588{
2589 struct sk_buff *prev = 0; 2589 struct sk_buff *prev = NULL;
2590 struct sk_buff *fbuf = *fb; 2590 struct sk_buff *fbuf = *fb;
2591 struct tipc_msg *fragm = buf_msg(fbuf); 2591 struct tipc_msg *fragm = buf_msg(fbuf);
2592 struct sk_buff *pbuf = *pending; 2592 struct sk_buff *pbuf = *pending;
2593 u32 long_msg_seq_no = msg_long_msgno(fragm); 2593 u32 long_msg_seq_no = msg_long_msgno(fragm);
2594 2594
2595 *fb = 0; 2595 *fb = NULL;
2596 msg_dbg(fragm,"FRG<REC<"); 2596 msg_dbg(fragm,"FRG<REC<");
2597 2597
2598 /* Is there an incomplete message waiting for this fragment? */ 2598 /* 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,
2670 2670
2671static void link_check_defragm_bufs(struct link *l_ptr) 2671static void link_check_defragm_bufs(struct link *l_ptr)
2672{ 2672{
2673 struct sk_buff *prev = 0; 2673 struct sk_buff *prev = NULL;
2674 struct sk_buff *next = 0; 2674 struct sk_buff *next = NULL;
2675 struct sk_buff *buf = l_ptr->defragm_buf; 2675 struct sk_buff *buf = l_ptr->defragm_buf;
2676 2676
2677 if (!buf) 2677 if (!buf)
@@ -2750,19 +2750,19 @@ static struct link *link_find_link(const char *name, struct node **node)
2750 struct link *l_ptr; 2750 struct link *l_ptr;
2751 2751
2752 if (!link_name_validate(name, &link_name_parts)) 2752 if (!link_name_validate(name, &link_name_parts))
2753 return 0; 2753 return NULL;
2754 2754
2755 b_ptr = tipc_bearer_find_interface(link_name_parts.if_local); 2755 b_ptr = tipc_bearer_find_interface(link_name_parts.if_local);
2756 if (!b_ptr) 2756 if (!b_ptr)
2757 return 0; 2757 return NULL;
2758 2758
2759 *node = tipc_node_find(link_name_parts.addr_peer); 2759 *node = tipc_node_find(link_name_parts.addr_peer);
2760 if (!*node) 2760 if (!*node)
2761 return 0; 2761 return NULL;
2762 2762
2763 l_ptr = (*node)->links[b_ptr->identity]; 2763 l_ptr = (*node)->links[b_ptr->identity];
2764 if (!l_ptr || strcmp(l_ptr->name, name)) 2764 if (!l_ptr || strcmp(l_ptr->name, name))
2765 return 0; 2765 return NULL;
2766 2766
2767 return l_ptr; 2767 return l_ptr;
2768} 2768}
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index 830f90999041..953307a9df1d 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -168,8 +168,8 @@ void tipc_named_withdraw(struct publication *publ)
168void tipc_named_node_up(unsigned long node) 168void tipc_named_node_up(unsigned long node)
169{ 169{
170 struct publication *publ; 170 struct publication *publ;
171 struct distr_item *item = 0; 171 struct distr_item *item = NULL;
172 struct sk_buff *buf = 0; 172 struct sk_buff *buf = NULL;
173 u32 left = 0; 173 u32 left = 0;
174 u32 rest; 174 u32 rest;
175 u32 max_item_buf; 175 u32 max_item_buf;
@@ -200,7 +200,7 @@ void tipc_named_node_up(unsigned long node)
200 "<%u.%u.%u>\n", tipc_zone(node), 200 "<%u.%u.%u>\n", tipc_zone(node),
201 tipc_cluster(node), tipc_node(node)); 201 tipc_cluster(node), tipc_node(node));
202 tipc_link_send(buf, node, node); 202 tipc_link_send(buf, node, node);
203 buf = 0; 203 buf = NULL;
204 } 204 }
205 } 205 }
206exit: 206exit:
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index 3f4b23bd08f7..a865954bd95c 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -121,7 +121,7 @@ static struct publication *publ_create(u32 type, u32 lower, u32 upper,
121 (struct publication *)kmalloc(sizeof(*publ), GFP_ATOMIC); 121 (struct publication *)kmalloc(sizeof(*publ), GFP_ATOMIC);
122 if (publ == NULL) { 122 if (publ == NULL) {
123 warn("Memory squeeze; failed to create publication\n"); 123 warn("Memory squeeze; failed to create publication\n");
124 return 0; 124 return NULL;
125 } 125 }
126 126
127 memset(publ, 0, sizeof(*publ)); 127 memset(publ, 0, sizeof(*publ));
@@ -168,7 +168,7 @@ struct name_seq *tipc_nameseq_create(u32 type, struct hlist_head *seq_head)
168 warn("Memory squeeze; failed to create name sequence\n"); 168 warn("Memory squeeze; failed to create name sequence\n");
169 kfree(nseq); 169 kfree(nseq);
170 kfree(sseq); 170 kfree(sseq);
171 return 0; 171 return NULL;
172 } 172 }
173 173
174 memset(nseq, 0, sizeof(*nseq)); 174 memset(nseq, 0, sizeof(*nseq));
@@ -207,7 +207,7 @@ static inline struct sub_seq *nameseq_find_subseq(struct name_seq *nseq,
207 else 207 else
208 return &sseqs[mid]; 208 return &sseqs[mid];
209 } 209 }
210 return 0; 210 return NULL;
211} 211}
212 212
213/** 213/**
@@ -263,7 +263,7 @@ struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq,
263 263
264 if ((sseq->lower != lower) || (sseq->upper != upper)) { 264 if ((sseq->lower != lower) || (sseq->upper != upper)) {
265 warn("Overlapping publ <%u,%u,%u>\n", type, lower, upper); 265 warn("Overlapping publ <%u,%u,%u>\n", type, lower, upper);
266 return 0; 266 return NULL;
267 } 267 }
268 } else { 268 } else {
269 u32 inspos; 269 u32 inspos;
@@ -278,7 +278,7 @@ struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq,
278 if ((inspos < nseq->first_free) && 278 if ((inspos < nseq->first_free) &&
279 (upper >= nseq->sseqs[inspos].lower)) { 279 (upper >= nseq->sseqs[inspos].lower)) {
280 warn("Overlapping publ <%u,%u,%u>\n", type, lower, upper); 280 warn("Overlapping publ <%u,%u,%u>\n", type, lower, upper);
281 return 0; 281 return NULL;
282 } 282 }
283 283
284 /* Ensure there is space for new sub-sequence */ 284 /* Ensure there is space for new sub-sequence */
@@ -294,7 +294,7 @@ struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq,
294 nseq->alloc *= 2; 294 nseq->alloc *= 2;
295 } else { 295 } else {
296 warn("Memory squeeze; failed to create sub-sequence\n"); 296 warn("Memory squeeze; failed to create sub-sequence\n");
297 return 0; 297 return NULL;
298 } 298 }
299 } 299 }
300 dbg("Have %u sseqs for type %u\n", nseq->alloc, type); 300 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,
319 319
320 publ = publ_create(type, lower, upper, scope, node, port, key); 320 publ = publ_create(type, lower, upper, scope, node, port, key);
321 if (!publ) 321 if (!publ)
322 return 0; 322 return NULL;
323 dbg("inserting publ %x, node=%x publ->node=%x, subscr->node=%x\n", 323 dbg("inserting publ %x, node=%x publ->node=%x, subscr->node=%x\n",
324 publ, node, publ->node, publ->subscr.node); 324 publ, node, publ->node, publ->subscr.node);
325 325
@@ -394,7 +394,7 @@ struct publication *tipc_nameseq_remove_publ(struct name_seq *nseq, u32 inst,
394 i, &nseq->sseqs[i], nseq->sseqs[i].lower, 394 i, &nseq->sseqs[i], nseq->sseqs[i].lower,
395 nseq->sseqs[i].upper); 395 nseq->sseqs[i].upper);
396 } 396 }
397 return 0; 397 return NULL;
398 } 398 }
399 dbg("nameseq_remove: seq: %x, sseq %x, <%u,%u> key %u\n", 399 dbg("nameseq_remove: seq: %x, sseq %x, <%u,%u> key %u\n",
400 nseq, sseq, nseq->type, inst, key); 400 nseq, sseq, nseq->type, inst, key);
@@ -413,7 +413,7 @@ struct publication *tipc_nameseq_remove_publ(struct name_seq *nseq, u32 inst,
413 prev->zone_list_next = publ->zone_list_next; 413 prev->zone_list_next = publ->zone_list_next;
414 sseq->zone_list = publ->zone_list_next; 414 sseq->zone_list = publ->zone_list_next;
415 } else { 415 } else {
416 sseq->zone_list = 0; 416 sseq->zone_list = NULL;
417 } 417 }
418 418
419 if (in_own_cluster(node)) { 419 if (in_own_cluster(node)) {
@@ -431,7 +431,7 @@ struct publication *tipc_nameseq_remove_publ(struct name_seq *nseq, u32 inst,
431 prev->cluster_list_next = publ->cluster_list_next; 431 prev->cluster_list_next = publ->cluster_list_next;
432 sseq->cluster_list = publ->cluster_list_next; 432 sseq->cluster_list = publ->cluster_list_next;
433 } else { 433 } else {
434 sseq->cluster_list = 0; 434 sseq->cluster_list = NULL;
435 } 435 }
436 } 436 }
437 437
@@ -450,7 +450,7 @@ struct publication *tipc_nameseq_remove_publ(struct name_seq *nseq, u32 inst,
450 prev->node_list_next = publ->node_list_next; 450 prev->node_list_next = publ->node_list_next;
451 sseq->node_list = publ->node_list_next; 451 sseq->node_list = publ->node_list_next;
452 } else { 452 } else {
453 sseq->node_list = 0; 453 sseq->node_list = NULL;
454 } 454 }
455 } 455 }
456 assert(!publ->node || (publ->node == node)); 456 assert(!publ->node || (publ->node == node));
@@ -535,7 +535,7 @@ static struct name_seq *nametbl_find_seq(u32 type)
535 } 535 }
536 } 536 }
537 537
538 return 0; 538 return NULL;
539}; 539};
540 540
541struct publication *tipc_nametbl_insert_publ(u32 type, u32 lower, u32 upper, 541struct 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,
547 if (lower > upper) { 547 if (lower > upper) {
548 warn("Failed to publish illegal <%u,%u,%u>\n", 548 warn("Failed to publish illegal <%u,%u,%u>\n",
549 type, lower, upper); 549 type, lower, upper);
550 return 0; 550 return NULL;
551 } 551 }
552 552
553 dbg("Publishing <%u,%u,%u> from %x\n", type, lower, upper, node); 553 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,
556 dbg("tipc_nametbl_insert_publ: created %x\n", seq); 556 dbg("tipc_nametbl_insert_publ: created %x\n", seq);
557 } 557 }
558 if (!seq) 558 if (!seq)
559 return 0; 559 return NULL;
560 560
561 assert(seq->type == type); 561 assert(seq->type == type);
562 return tipc_nameseq_insert_publ(seq, type, lower, upper, 562 return tipc_nameseq_insert_publ(seq, type, lower, upper,
@@ -570,7 +570,7 @@ struct publication *tipc_nametbl_remove_publ(u32 type, u32 lower,
570 struct name_seq *seq = nametbl_find_seq(type); 570 struct name_seq *seq = nametbl_find_seq(type);
571 571
572 if (!seq) 572 if (!seq)
573 return 0; 573 return NULL;
574 574
575 dbg("Withdrawing <%u,%u> from %x\n", type, lower, node); 575 dbg("Withdrawing <%u,%u> from %x\n", type, lower, node);
576 publ = tipc_nameseq_remove_publ(seq, lower, node, ref, key); 576 publ = tipc_nameseq_remove_publ(seq, lower, node, ref, key);
@@ -594,7 +594,7 @@ struct publication *tipc_nametbl_remove_publ(u32 type, u32 lower,
594u32 tipc_nametbl_translate(u32 type, u32 instance, u32 *destnode) 594u32 tipc_nametbl_translate(u32 type, u32 instance, u32 *destnode)
595{ 595{
596 struct sub_seq *sseq; 596 struct sub_seq *sseq;
597 struct publication *publ = 0; 597 struct publication *publ = NULL;
598 struct name_seq *seq; 598 struct name_seq *seq;
599 u32 ref; 599 u32 ref;
600 600
@@ -740,12 +740,12 @@ struct publication *tipc_nametbl_publish(u32 type, u32 lower, u32 upper,
740 if (table.local_publ_count >= tipc_max_publications) { 740 if (table.local_publ_count >= tipc_max_publications) {
741 warn("Failed publish: max %u local publication\n", 741 warn("Failed publish: max %u local publication\n",
742 tipc_max_publications); 742 tipc_max_publications);
743 return 0; 743 return NULL;
744 } 744 }
745 if ((type < TIPC_RESERVED_TYPES) && !atomic_read(&rsv_publ_ok)) { 745 if ((type < TIPC_RESERVED_TYPES) && !atomic_read(&rsv_publ_ok)) {
746 warn("Failed to publish reserved name <%u,%u,%u>\n", 746 warn("Failed to publish reserved name <%u,%u,%u>\n",
747 type, lower, upper); 747 type, lower, upper);
748 return 0; 748 return NULL;
749 } 749 }
750 750
751 write_lock_bh(&tipc_nametbl_lock); 751 write_lock_bh(&tipc_nametbl_lock);
diff --git a/net/tipc/net.c b/net/tipc/net.c
index 074891ad4f09..cd0328601bba 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -116,7 +116,7 @@
116*/ 116*/
117 117
118rwlock_t tipc_net_lock = RW_LOCK_UNLOCKED; 118rwlock_t tipc_net_lock = RW_LOCK_UNLOCKED;
119struct network tipc_net = { 0 }; 119struct network tipc_net = { NULL };
120 120
121struct node *tipc_net_select_remote_node(u32 addr, u32 ref) 121struct node *tipc_net_select_remote_node(u32 addr, u32 ref)
122{ 122{
@@ -181,7 +181,7 @@ static void net_stop(void)
181 tipc_zone_delete(tipc_net.zones[z_num]); 181 tipc_zone_delete(tipc_net.zones[z_num]);
182 } 182 }
183 kfree(tipc_net.zones); 183 kfree(tipc_net.zones);
184 tipc_net.zones = 0; 184 tipc_net.zones = NULL;
185} 185}
186 186
187static void net_route_named_msg(struct sk_buff *buf) 187static void net_route_named_msg(struct sk_buff *buf)
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 6d65010e5fa1..9f23845d11b2 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -155,7 +155,7 @@ static void node_select_active_links(struct node *n_ptr)
155 u32 i; 155 u32 i;
156 u32 highest_prio = 0; 156 u32 highest_prio = 0;
157 157
158 active[0] = active[1] = 0; 158 active[0] = active[1] = NULL;
159 159
160 for (i = 0; i < MAX_BEARERS; i++) { 160 for (i = 0; i < MAX_BEARERS; i++) {
161 struct link *l_ptr = n_ptr->links[i]; 161 struct link *l_ptr = n_ptr->links[i];
@@ -240,7 +240,7 @@ struct node *tipc_node_attach_link(struct link *l_ptr)
240 240
241 err("Attempt to create third link to %s\n", 241 err("Attempt to create third link to %s\n",
242 addr_string_fill(addr_string, n_ptr->addr)); 242 addr_string_fill(addr_string, n_ptr->addr));
243 return 0; 243 return NULL;
244 } 244 }
245 245
246 if (!n_ptr->links[bearer_id]) { 246 if (!n_ptr->links[bearer_id]) {
@@ -253,12 +253,12 @@ struct node *tipc_node_attach_link(struct link *l_ptr)
253 l_ptr->b_ptr->publ.name, 253 l_ptr->b_ptr->publ.name,
254 addr_string_fill(addr_string, l_ptr->addr)); 254 addr_string_fill(addr_string, l_ptr->addr));
255 } 255 }
256 return 0; 256 return NULL;
257} 257}
258 258
259void tipc_node_detach_link(struct node *n_ptr, struct link *l_ptr) 259void tipc_node_detach_link(struct node *n_ptr, struct link *l_ptr)
260{ 260{
261 n_ptr->links[l_ptr->b_ptr->identity] = 0; 261 n_ptr->links[l_ptr->b_ptr->identity] = NULL;
262 tipc_net.zones[tipc_zone(l_ptr->addr)]->links--; 262 tipc_net.zones[tipc_zone(l_ptr->addr)]->links--;
263 n_ptr->link_cnt--; 263 n_ptr->link_cnt--;
264} 264}
@@ -424,7 +424,7 @@ static void node_lost_contact(struct node *n_ptr)
424 424
425 /* Notify subscribers */ 425 /* Notify subscribers */
426 list_for_each_entry_safe(ns, tns, &n_ptr->nsub, nodesub_list) { 426 list_for_each_entry_safe(ns, tns, &n_ptr->nsub, nodesub_list) {
427 ns->node = 0; 427 ns->node = NULL;
428 list_del_init(&ns->nodesub_list); 428 list_del_init(&ns->nodesub_list);
429 tipc_k_signal((Handler)ns->handle_node_down, 429 tipc_k_signal((Handler)ns->handle_node_down,
430 (unsigned long)ns->usr_handle); 430 (unsigned long)ns->usr_handle);
@@ -443,7 +443,7 @@ struct node *tipc_node_select_next_hop(u32 addr, u32 selector)
443 u32 router_addr; 443 u32 router_addr;
444 444
445 if (!tipc_addr_domain_valid(addr)) 445 if (!tipc_addr_domain_valid(addr))
446 return 0; 446 return NULL;
447 447
448 /* Look for direct link to destination processsor */ 448 /* Look for direct link to destination processsor */
449 n_ptr = tipc_node_find(addr); 449 n_ptr = tipc_node_find(addr);
@@ -452,7 +452,7 @@ struct node *tipc_node_select_next_hop(u32 addr, u32 selector)
452 452
453 /* Cluster local system nodes *must* have direct links */ 453 /* Cluster local system nodes *must* have direct links */
454 if (!is_slave(addr) && in_own_cluster(addr)) 454 if (!is_slave(addr) && in_own_cluster(addr))
455 return 0; 455 return NULL;
456 456
457 /* Look for cluster local router with direct link to node */ 457 /* Look for cluster local router with direct link to node */
458 router_addr = tipc_node_select_router(n_ptr, selector); 458 router_addr = tipc_node_select_router(n_ptr, selector);
@@ -462,7 +462,7 @@ struct node *tipc_node_select_next_hop(u32 addr, u32 selector)
462 /* Slave nodes can only be accessed within own cluster via a 462 /* Slave nodes can only be accessed within own cluster via a
463 known router with direct link -- if no router was found,give up */ 463 known router with direct link -- if no router was found,give up */
464 if (is_slave(addr)) 464 if (is_slave(addr))
465 return 0; 465 return NULL;
466 466
467 /* Inter zone/cluster -- find any direct link to remote cluster */ 467 /* Inter zone/cluster -- find any direct link to remote cluster */
468 addr = tipc_addr(tipc_zone(addr), tipc_cluster(addr), 0); 468 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)
475 if (router_addr) 475 if (router_addr)
476 return tipc_node_select(router_addr, selector); 476 return tipc_node_select(router_addr, selector);
477 477
478 return 0; 478 return NULL;
479} 479}
480 480
481/** 481/**
diff --git a/net/tipc/node.h b/net/tipc/node.h
index 29f7ae6992d4..781126e084ae 100644
--- a/net/tipc/node.h
+++ b/net/tipc/node.h
@@ -121,7 +121,7 @@ static inline struct node *tipc_node_find(u32 addr)
121 if (c_ptr) 121 if (c_ptr)
122 return c_ptr->nodes[tipc_node(addr)]; 122 return c_ptr->nodes[tipc_node(addr)];
123 } 123 }
124 return 0; 124 return NULL;
125} 125}
126 126
127static inline struct node *tipc_node_select(u32 addr, u32 selector) 127static inline struct node *tipc_node_select(u32 addr, u32 selector)
diff --git a/net/tipc/node_subscr.c b/net/tipc/node_subscr.c
index afeea121d8be..cff4068cc755 100644
--- a/net/tipc/node_subscr.c
+++ b/net/tipc/node_subscr.c
@@ -47,7 +47,7 @@
47void tipc_nodesub_subscribe(struct node_subscr *node_sub, u32 addr, 47void tipc_nodesub_subscribe(struct node_subscr *node_sub, u32 addr,
48 void *usr_handle, net_ev_handler handle_down) 48 void *usr_handle, net_ev_handler handle_down)
49{ 49{
50 node_sub->node = 0; 50 node_sub->node = NULL;
51 if (addr == tipc_own_addr) 51 if (addr == tipc_own_addr)
52 return; 52 return;
53 if (!tipc_addr_node_valid(addr)) { 53 if (!tipc_addr_node_valid(addr)) {
diff --git a/net/tipc/port.c b/net/tipc/port.c
index 72aae52bfec1..294375cd9bda 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -54,8 +54,8 @@
54 54
55#define MAX_REJECT_SIZE 1024 55#define MAX_REJECT_SIZE 1024
56 56
57static struct sk_buff *msg_queue_head = 0; 57static struct sk_buff *msg_queue_head = NULL;
58static struct sk_buff *msg_queue_tail = 0; 58static struct sk_buff *msg_queue_tail = NULL;
59 59
60spinlock_t tipc_port_list_lock = SPIN_LOCK_UNLOCKED; 60spinlock_t tipc_port_list_lock = SPIN_LOCK_UNLOCKED;
61static spinlock_t queue_lock = SPIN_LOCK_UNLOCKED; 61static spinlock_t queue_lock = SPIN_LOCK_UNLOCKED;
@@ -258,11 +258,11 @@ u32 tipc_createport_raw(void *usr_handle,
258 p_ptr->publ.usr_handle = usr_handle; 258 p_ptr->publ.usr_handle = usr_handle;
259 INIT_LIST_HEAD(&p_ptr->wait_list); 259 INIT_LIST_HEAD(&p_ptr->wait_list);
260 INIT_LIST_HEAD(&p_ptr->subscription.nodesub_list); 260 INIT_LIST_HEAD(&p_ptr->subscription.nodesub_list);
261 p_ptr->congested_link = 0; 261 p_ptr->congested_link = NULL;
262 p_ptr->max_pkt = MAX_PKT_DEFAULT; 262 p_ptr->max_pkt = MAX_PKT_DEFAULT;
263 p_ptr->dispatcher = dispatcher; 263 p_ptr->dispatcher = dispatcher;
264 p_ptr->wakeup = wakeup; 264 p_ptr->wakeup = wakeup;
265 p_ptr->user_port = 0; 265 p_ptr->user_port = NULL;
266 k_init_timer(&p_ptr->timer, (Handler)port_timeout, ref); 266 k_init_timer(&p_ptr->timer, (Handler)port_timeout, ref);
267 spin_lock_bh(&tipc_port_list_lock); 267 spin_lock_bh(&tipc_port_list_lock);
268 INIT_LIST_HEAD(&p_ptr->publications); 268 INIT_LIST_HEAD(&p_ptr->publications);
@@ -276,9 +276,9 @@ u32 tipc_createport_raw(void *usr_handle,
276int tipc_deleteport(u32 ref) 276int tipc_deleteport(u32 ref)
277{ 277{
278 struct port *p_ptr; 278 struct port *p_ptr;
279 struct sk_buff *buf = 0; 279 struct sk_buff *buf = NULL;
280 280
281 tipc_withdraw(ref, 0, 0); 281 tipc_withdraw(ref, 0, NULL);
282 p_ptr = tipc_port_lock(ref); 282 p_ptr = tipc_port_lock(ref);
283 if (!p_ptr) 283 if (!p_ptr)
284 return -EINVAL; 284 return -EINVAL;
@@ -329,7 +329,7 @@ void *tipc_get_handle(const u32 ref)
329 329
330 p_ptr = tipc_port_lock(ref); 330 p_ptr = tipc_port_lock(ref);
331 if (!p_ptr) 331 if (!p_ptr)
332 return 0; 332 return NULL;
333 handle = p_ptr->publ.usr_handle; 333 handle = p_ptr->publ.usr_handle;
334 tipc_port_unlock(p_ptr); 334 tipc_port_unlock(p_ptr);
335 return handle; 335 return handle;
@@ -475,7 +475,7 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err)
475 475
476 /* send self-abort message when rejecting on a connected port */ 476 /* send self-abort message when rejecting on a connected port */
477 if (msg_connected(msg)) { 477 if (msg_connected(msg)) {
478 struct sk_buff *abuf = 0; 478 struct sk_buff *abuf = NULL;
479 struct port *p_ptr = tipc_port_lock(msg_destport(msg)); 479 struct port *p_ptr = tipc_port_lock(msg_destport(msg));
480 480
481 if (p_ptr) { 481 if (p_ptr) {
@@ -510,7 +510,7 @@ int tipc_port_reject_sections(struct port *p_ptr, struct tipc_msg *hdr,
510static void port_timeout(unsigned long ref) 510static void port_timeout(unsigned long ref)
511{ 511{
512 struct port *p_ptr = tipc_port_lock(ref); 512 struct port *p_ptr = tipc_port_lock(ref);
513 struct sk_buff *buf = 0; 513 struct sk_buff *buf = NULL;
514 514
515 if (!p_ptr || !p_ptr->publ.connected) 515 if (!p_ptr || !p_ptr->publ.connected)
516 return; 516 return;
@@ -540,7 +540,7 @@ static void port_timeout(unsigned long ref)
540static void port_handle_node_down(unsigned long ref) 540static void port_handle_node_down(unsigned long ref)
541{ 541{
542 struct port *p_ptr = tipc_port_lock(ref); 542 struct port *p_ptr = tipc_port_lock(ref);
543 struct sk_buff* buf = 0; 543 struct sk_buff* buf = NULL;
544 544
545 if (!p_ptr) 545 if (!p_ptr)
546 return; 546 return;
@@ -555,7 +555,7 @@ static struct sk_buff *port_build_self_abort_msg(struct port *p_ptr, u32 err)
555 u32 imp = msg_importance(&p_ptr->publ.phdr); 555 u32 imp = msg_importance(&p_ptr->publ.phdr);
556 556
557 if (!p_ptr->publ.connected) 557 if (!p_ptr->publ.connected)
558 return 0; 558 return NULL;
559 if (imp < TIPC_CRITICAL_IMPORTANCE) 559 if (imp < TIPC_CRITICAL_IMPORTANCE)
560 imp++; 560 imp++;
561 return port_build_proto_msg(p_ptr->publ.ref, 561 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)
575 u32 imp = msg_importance(&p_ptr->publ.phdr); 575 u32 imp = msg_importance(&p_ptr->publ.phdr);
576 576
577 if (!p_ptr->publ.connected) 577 if (!p_ptr->publ.connected)
578 return 0; 578 return NULL;
579 if (imp < TIPC_CRITICAL_IMPORTANCE) 579 if (imp < TIPC_CRITICAL_IMPORTANCE)
580 imp++; 580 imp++;
581 return port_build_proto_msg(port_peerport(p_ptr), 581 return port_build_proto_msg(port_peerport(p_ptr),
@@ -594,8 +594,8 @@ void tipc_port_recv_proto_msg(struct sk_buff *buf)
594 struct tipc_msg *msg = buf_msg(buf); 594 struct tipc_msg *msg = buf_msg(buf);
595 struct port *p_ptr = tipc_port_lock(msg_destport(msg)); 595 struct port *p_ptr = tipc_port_lock(msg_destport(msg));
596 u32 err = TIPC_OK; 596 u32 err = TIPC_OK;
597 struct sk_buff *r_buf = 0; 597 struct sk_buff *r_buf = NULL;
598 struct sk_buff *abort_buf = 0; 598 struct sk_buff *abort_buf = NULL;
599 599
600 msg_dbg(msg, "PORT<RECV<:"); 600 msg_dbg(msg, "PORT<RECV<:");
601 601
@@ -804,7 +804,7 @@ static void port_dispatcher_sigh(void *dummy)
804 804
805 spin_lock_bh(&queue_lock); 805 spin_lock_bh(&queue_lock);
806 buf = msg_queue_head; 806 buf = msg_queue_head;
807 msg_queue_head = 0; 807 msg_queue_head = NULL;
808 spin_unlock_bh(&queue_lock); 808 spin_unlock_bh(&queue_lock);
809 809
810 while (buf) { 810 while (buf) {
@@ -991,8 +991,8 @@ static void port_wakeup_sh(unsigned long ref)
991{ 991{
992 struct port *p_ptr; 992 struct port *p_ptr;
993 struct user_port *up_ptr; 993 struct user_port *up_ptr;
994 tipc_continue_event cb = 0; 994 tipc_continue_event cb = NULL;
995 void *uh = 0; 995 void *uh = NULL;
996 996
997 p_ptr = tipc_port_lock(ref); 997 p_ptr = tipc_port_lock(ref);
998 if (p_ptr) { 998 if (p_ptr) {
@@ -1016,7 +1016,7 @@ static void port_wakeup(struct tipc_port *p_ptr)
1016void tipc_acknowledge(u32 ref, u32 ack) 1016void tipc_acknowledge(u32 ref, u32 ack)
1017{ 1017{
1018 struct port *p_ptr; 1018 struct port *p_ptr;
1019 struct sk_buff *buf = 0; 1019 struct sk_buff *buf = NULL;
1020 1020
1021 p_ptr = tipc_port_lock(ref); 1021 p_ptr = tipc_port_lock(ref);
1022 if (!p_ptr) 1022 if (!p_ptr)
@@ -1062,7 +1062,7 @@ int tipc_createport(u32 user_ref,
1062 if (up_ptr == NULL) { 1062 if (up_ptr == NULL) {
1063 return -ENOMEM; 1063 return -ENOMEM;
1064 } 1064 }
1065 ref = tipc_createport_raw(0, port_dispatcher, port_wakeup, importance); 1065 ref = tipc_createport_raw(NULL, port_dispatcher, port_wakeup, importance);
1066 p_ptr = tipc_port_lock(ref); 1066 p_ptr = tipc_port_lock(ref);
1067 if (!p_ptr) { 1067 if (!p_ptr) {
1068 kfree(up_ptr); 1068 kfree(up_ptr);
@@ -1273,7 +1273,7 @@ int tipc_disconnect(u32 ref)
1273int tipc_shutdown(u32 ref) 1273int tipc_shutdown(u32 ref)
1274{ 1274{
1275 struct port *p_ptr; 1275 struct port *p_ptr;
1276 struct sk_buff *buf = 0; 1276 struct sk_buff *buf = NULL;
1277 1277
1278 p_ptr = tipc_port_lock(ref); 1278 p_ptr = tipc_port_lock(ref);
1279 if (!p_ptr) 1279 if (!p_ptr)
diff --git a/net/tipc/ref.c b/net/tipc/ref.c
index 5a13c2defe4a..33bbf5095094 100644
--- a/net/tipc/ref.c
+++ b/net/tipc/ref.c
@@ -61,7 +61,7 @@
61 * because entry 0's reference field has the form XXXX|1--1. 61 * because entry 0's reference field has the form XXXX|1--1.
62 */ 62 */
63 63
64struct ref_table tipc_ref_table = { 0 }; 64struct ref_table tipc_ref_table = { NULL };
65 65
66static rwlock_t ref_table_lock = RW_LOCK_UNLOCKED; 66static rwlock_t ref_table_lock = RW_LOCK_UNLOCKED;
67 67
@@ -86,7 +86,7 @@ int tipc_ref_table_init(u32 requested_size, u32 start)
86 write_lock_bh(&ref_table_lock); 86 write_lock_bh(&ref_table_lock);
87 index_mask = sz - 1; 87 index_mask = sz - 1;
88 for (i = sz - 1; i >= 0; i--) { 88 for (i = sz - 1; i >= 0; i--) {
89 table[i].object = 0; 89 table[i].object = NULL;
90 table[i].lock = SPIN_LOCK_UNLOCKED; 90 table[i].lock = SPIN_LOCK_UNLOCKED;
91 table[i].data.next_plus_upper = (start & ~index_mask) + i - 1; 91 table[i].data.next_plus_upper = (start & ~index_mask) + i - 1;
92 } 92 }
@@ -108,7 +108,7 @@ void tipc_ref_table_stop(void)
108 return; 108 return;
109 109
110 vfree(tipc_ref_table.entries); 110 vfree(tipc_ref_table.entries);
111 tipc_ref_table.entries = 0; 111 tipc_ref_table.entries = NULL;
112} 112}
113 113
114/** 114/**
@@ -173,7 +173,7 @@ void tipc_ref_discard(u32 ref)
173 assert(entry->data.reference == ref); 173 assert(entry->data.reference == ref);
174 174
175 /* mark entry as unused */ 175 /* mark entry as unused */
176 entry->object = 0; 176 entry->object = NULL;
177 if (tipc_ref_table.first_free == 0) 177 if (tipc_ref_table.first_free == 0)
178 tipc_ref_table.first_free = index; 178 tipc_ref_table.first_free = index;
179 else 179 else
diff --git a/net/tipc/ref.h b/net/tipc/ref.h
index 4f8f9f40dcac..6d20006be45b 100644
--- a/net/tipc/ref.h
+++ b/net/tipc/ref.h
@@ -92,7 +92,7 @@ static inline void *tipc_ref_lock(u32 ref)
92 return r->object; 92 return r->object;
93 spin_unlock_bh(&r->lock); 93 spin_unlock_bh(&r->lock);
94 } 94 }
95 return 0; 95 return NULL;
96} 96}
97 97
98/** 98/**
@@ -125,7 +125,7 @@ static inline void *tipc_ref_deref(u32 ref)
125 if (likely(r->data.reference == ref)) 125 if (likely(r->data.reference == ref))
126 return r->object; 126 return r->object;
127 } 127 }
128 return 0; 128 return NULL;
129} 129}
130 130
131#endif 131#endif
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 67253bfcd702..d1347d7da147 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -178,7 +178,7 @@ static int tipc_create(struct socket *sock, int protocol)
178 if (unlikely(protocol != 0)) 178 if (unlikely(protocol != 0))
179 return -EPROTONOSUPPORT; 179 return -EPROTONOSUPPORT;
180 180
181 ref = tipc_createport_raw(0, &dispatch, &wakeupdispatch, TIPC_LOW_IMPORTANCE); 181 ref = tipc_createport_raw(NULL, &dispatch, &wakeupdispatch, TIPC_LOW_IMPORTANCE);
182 if (unlikely(!ref)) 182 if (unlikely(!ref))
183 return -ENOMEM; 183 return -ENOMEM;
184 184
@@ -265,7 +265,7 @@ static int release(struct socket *sock)
265 sock_lock(tsock); 265 sock_lock(tsock);
266 buf = skb_dequeue(&sk->sk_receive_queue); 266 buf = skb_dequeue(&sk->sk_receive_queue);
267 if (!buf) 267 if (!buf)
268 tsock->p->usr_handle = 0; 268 tsock->p->usr_handle = NULL;
269 sock_unlock(tsock); 269 sock_unlock(tsock);
270 if (!buf) 270 if (!buf)
271 break; 271 break;
@@ -319,7 +319,7 @@ static int bind(struct socket *sock, struct sockaddr *uaddr, int uaddr_len)
319 return -ERESTARTSYS; 319 return -ERESTARTSYS;
320 320
321 if (unlikely(!uaddr_len)) { 321 if (unlikely(!uaddr_len)) {
322 res = tipc_withdraw(tsock->p->ref, 0, 0); 322 res = tipc_withdraw(tsock->p->ref, 0, NULL);
323 goto exit; 323 goto exit;
324 } 324 }
325 325
@@ -1226,7 +1226,7 @@ static int connect(struct socket *sock, struct sockaddr *dest, int destlen,
1226{ 1226{
1227 struct tipc_sock *tsock = tipc_sk(sock->sk); 1227 struct tipc_sock *tsock = tipc_sk(sock->sk);
1228 struct sockaddr_tipc *dst = (struct sockaddr_tipc *)dest; 1228 struct sockaddr_tipc *dst = (struct sockaddr_tipc *)dest;
1229 struct msghdr m = {0,}; 1229 struct msghdr m = {NULL,};
1230 struct sk_buff *buf; 1230 struct sk_buff *buf;
1231 struct tipc_msg *msg; 1231 struct tipc_msg *msg;
1232 int res; 1232 int res;
@@ -1251,7 +1251,7 @@ static int connect(struct socket *sock, struct sockaddr *dest, int destlen,
1251 /* Send a 'SYN-' to destination */ 1251 /* Send a 'SYN-' to destination */
1252 1252
1253 m.msg_name = dest; 1253 m.msg_name = dest;
1254 if ((res = send_msg(0, sock, &m, 0)) < 0) { 1254 if ((res = send_msg(NULL, sock, &m, 0)) < 0) {
1255 sock->state = SS_DISCONNECTING; 1255 sock->state = SS_DISCONNECTING;
1256 return res; 1256 return res;
1257 } 1257 }
@@ -1367,9 +1367,9 @@ static int accept(struct socket *sock, struct socket *newsock, int flags)
1367 1367
1368 msg_dbg(msg,"<ACC<: "); 1368 msg_dbg(msg,"<ACC<: ");
1369 if (!msg_data_sz(msg)) { 1369 if (!msg_data_sz(msg)) {
1370 struct msghdr m = {0,}; 1370 struct msghdr m = {NULL,};
1371 1371
1372 send_packet(0, newsock, &m, 0); 1372 send_packet(NULL, newsock, &m, 0);
1373 advance_queue(tsock); 1373 advance_queue(tsock);
1374 } else { 1374 } else {
1375 sock_lock(tsock); 1375 sock_lock(tsock);
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c
index 5ff38b9f3194..3ec4e2b4e750 100644
--- a/net/tipc/subscr.c
+++ b/net/tipc/subscr.c
@@ -381,7 +381,7 @@ static void subscr_named_msg_event(void *usr_handle,
381 struct tipc_name_seq const *dest) 381 struct tipc_name_seq const *dest)
382{ 382{
383 struct subscriber *subscriber; 383 struct subscriber *subscriber;
384 struct iovec msg_sect = {0, 0}; 384 struct iovec msg_sect = {NULL, 0};
385 spinlock_t *subscriber_lock; 385 spinlock_t *subscriber_lock;
386 386
387 dbg("subscr_named_msg_event: orig = %x own = %x,\n", 387 dbg("subscr_named_msg_event: orig = %x own = %x,\n",
@@ -413,13 +413,13 @@ static void subscr_named_msg_event(void *usr_handle,
413 tipc_createport(topsrv.user_ref, 413 tipc_createport(topsrv.user_ref,
414 (void *)(unsigned long)subscriber->ref, 414 (void *)(unsigned long)subscriber->ref,
415 importance, 415 importance,
416 0, 416 NULL,
417 0, 417 NULL,
418 subscr_conn_shutdown_event, 418 subscr_conn_shutdown_event,
419 0, 419 NULL,
420 0, 420 NULL,
421 subscr_conn_msg_event, 421 subscr_conn_msg_event,
422 0, 422 NULL,
423 &subscriber->port_ref); 423 &subscriber->port_ref);
424 if (subscriber->port_ref == 0) { 424 if (subscriber->port_ref == 0) {
425 warn("Memory squeeze; failed to create subscription port\n"); 425 warn("Memory squeeze; failed to create subscription port\n");
@@ -461,22 +461,22 @@ int tipc_subscr_start(void)
461 INIT_LIST_HEAD(&topsrv.subscriber_list); 461 INIT_LIST_HEAD(&topsrv.subscriber_list);
462 462
463 spin_lock_bh(&topsrv.lock); 463 spin_lock_bh(&topsrv.lock);
464 res = tipc_attach(&topsrv.user_ref, 0, 0); 464 res = tipc_attach(&topsrv.user_ref, NULL, NULL);
465 if (res) { 465 if (res) {
466 spin_unlock_bh(&topsrv.lock); 466 spin_unlock_bh(&topsrv.lock);
467 return res; 467 return res;
468 } 468 }
469 469
470 res = tipc_createport(topsrv.user_ref, 470 res = tipc_createport(topsrv.user_ref,
471 0, 471 NULL,
472 TIPC_CRITICAL_IMPORTANCE, 472 TIPC_CRITICAL_IMPORTANCE,
473 0, 473 NULL,
474 0, 474 NULL,
475 0, 475 NULL,
476 0, 476 NULL,
477 subscr_named_msg_event, 477 subscr_named_msg_event,
478 0, 478 NULL,
479 0, 479 NULL,
480 &topsrv.setup_port); 480 &topsrv.setup_port);
481 if (res) 481 if (res)
482 goto failed; 482 goto failed;
diff --git a/net/tipc/user_reg.c b/net/tipc/user_reg.c
index 106200d76587..3f3f933976e9 100644
--- a/net/tipc/user_reg.c
+++ b/net/tipc/user_reg.c
@@ -65,7 +65,7 @@ struct tipc_user {
65#define MAX_USERID 64 65#define MAX_USERID 64
66#define USER_LIST_SIZE ((MAX_USERID + 1) * sizeof(struct tipc_user)) 66#define USER_LIST_SIZE ((MAX_USERID + 1) * sizeof(struct tipc_user))
67 67
68static struct tipc_user *users = 0; 68static struct tipc_user *users = NULL;
69static u32 next_free_user = MAX_USERID + 1; 69static u32 next_free_user = MAX_USERID + 1;
70static spinlock_t reg_lock = SPIN_LOCK_UNLOCKED; 70static spinlock_t reg_lock = SPIN_LOCK_UNLOCKED;
71 71
@@ -149,7 +149,7 @@ void tipc_reg_stop(void)
149 reg_callback(&users[id]); 149 reg_callback(&users[id]);
150 } 150 }
151 kfree(users); 151 kfree(users);
152 users = 0; 152 users = NULL;
153} 153}
154 154
155/** 155/**
diff --git a/net/tipc/zone.c b/net/tipc/zone.c
index 7c11f7f83a21..2803e1b4f170 100644
--- a/net/tipc/zone.c
+++ b/net/tipc/zone.c
@@ -44,11 +44,11 @@
44 44
45struct _zone *tipc_zone_create(u32 addr) 45struct _zone *tipc_zone_create(u32 addr)
46{ 46{
47 struct _zone *z_ptr = 0; 47 struct _zone *z_ptr = NULL;
48 u32 z_num; 48 u32 z_num;
49 49
50 if (!tipc_addr_domain_valid(addr)) 50 if (!tipc_addr_domain_valid(addr))
51 return 0; 51 return NULL;
52 52
53 z_ptr = (struct _zone *)kmalloc(sizeof(*z_ptr), GFP_ATOMIC); 53 z_ptr = (struct _zone *)kmalloc(sizeof(*z_ptr), GFP_ATOMIC);
54 if (z_ptr != NULL) { 54 if (z_ptr != NULL) {
@@ -114,10 +114,10 @@ struct node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref
114 u32 c_num; 114 u32 c_num;
115 115
116 if (!z_ptr) 116 if (!z_ptr)
117 return 0; 117 return NULL;
118 c_ptr = z_ptr->clusters[tipc_cluster(addr)]; 118 c_ptr = z_ptr->clusters[tipc_cluster(addr)];
119 if (!c_ptr) 119 if (!c_ptr)
120 return 0; 120 return NULL;
121 n_ptr = tipc_cltr_select_node(c_ptr, ref); 121 n_ptr = tipc_cltr_select_node(c_ptr, ref);
122 if (n_ptr) 122 if (n_ptr)
123 return n_ptr; 123 return n_ptr;
@@ -126,12 +126,12 @@ struct node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref
126 for (c_num = 1; c_num <= tipc_max_clusters; c_num++) { 126 for (c_num = 1; c_num <= tipc_max_clusters; c_num++) {
127 c_ptr = z_ptr->clusters[c_num]; 127 c_ptr = z_ptr->clusters[c_num];
128 if (!c_ptr) 128 if (!c_ptr)
129 return 0; 129 return NULL;
130 n_ptr = tipc_cltr_select_node(c_ptr, ref); 130 n_ptr = tipc_cltr_select_node(c_ptr, ref);
131 if (n_ptr) 131 if (n_ptr)
132 return n_ptr; 132 return n_ptr;
133 } 133 }
134 return 0; 134 return NULL;
135} 135}
136 136
137u32 tipc_zone_select_router(struct _zone *z_ptr, u32 addr, u32 ref) 137u32 tipc_zone_select_router(struct _zone *z_ptr, u32 addr, u32 ref)