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