diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2006-03-21 01:36:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-21 01:36:47 -0500 |
commit | 1fc54d8f49c1270c584803437fb7c0ac543588c1 (patch) | |
tree | 13bccf49154e57986a7e218e38d243912aaea6d1 /net/tipc/port.c | |
parent | edb2c34fb2683ff21c8a6bcc3e41c07a53601761 (diff) |
[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>
Diffstat (limited to 'net/tipc/port.c')
-rw-r--r-- | net/tipc/port.c | 40 |
1 files changed, 20 insertions, 20 deletions
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 | ||
57 | static struct sk_buff *msg_queue_head = 0; | 57 | static struct sk_buff *msg_queue_head = NULL; |
58 | static struct sk_buff *msg_queue_tail = 0; | 58 | static struct sk_buff *msg_queue_tail = NULL; |
59 | 59 | ||
60 | spinlock_t tipc_port_list_lock = SPIN_LOCK_UNLOCKED; | 60 | spinlock_t tipc_port_list_lock = SPIN_LOCK_UNLOCKED; |
61 | static spinlock_t queue_lock = SPIN_LOCK_UNLOCKED; | 61 | static 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, | |||
276 | int tipc_deleteport(u32 ref) | 276 | int 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, | |||
510 | static void port_timeout(unsigned long ref) | 510 | static 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) | |||
540 | static void port_handle_node_down(unsigned long ref) | 540 | static 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) | |||
1016 | void tipc_acknowledge(u32 ref, u32 ack) | 1016 | void 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) | |||
1273 | int tipc_shutdown(u32 ref) | 1273 | int 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) |