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/subscr.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/subscr.c')
-rw-r--r-- | net/tipc/subscr.c | 28 |
1 files changed, 14 insertions, 14 deletions
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; |