提交 40682432 编写于 作者: Y Ying Xue 提交者: David S. Miller

tipc: silence sparse warnings

Eliminate below sparse warnings:

net/tipc/link.c:1210:37: warning: cast removes address space of expression
net/tipc/link.c:1218:59: warning: incorrect type in argument 2 (different address spaces)
net/tipc/link.c:1218:59:    expected void const [noderef] <asn:1>*from
net/tipc/link.c:1218:59:    got unsigned char const [usertype] *[assigned] sect_crs
net/tipc/socket.c:341:49: warning: Using plain integer as NULL pointer
net/tipc/socket.c:1371:36: warning: Using plain integer as NULL pointer
net/tipc/socket.c:1694:57: warning: Using plain integer as NULL pointer
Signed-off-by: NYing Xue <ying.xue@windriver.com>
Signed-off-by: NAndreas Bofjäll <andreas.bofjall@ericsson.com>
Reviewed-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 9446b87a
...@@ -1160,7 +1160,7 @@ static int link_send_sections_long(struct tipc_port *sender, ...@@ -1160,7 +1160,7 @@ static int link_send_sections_long(struct tipc_port *sender,
struct tipc_msg fragm_hdr; struct tipc_msg fragm_hdr;
struct sk_buff *buf, *buf_chain, *prev; struct sk_buff *buf, *buf_chain, *prev;
u32 fragm_crs, fragm_rest, hsz, sect_rest; u32 fragm_crs, fragm_rest, hsz, sect_rest;
const unchar *sect_crs; const unchar __user *sect_crs;
int curr_sect; int curr_sect;
u32 fragm_no; u32 fragm_no;
int res = 0; int res = 0;
...@@ -1202,7 +1202,7 @@ static int link_send_sections_long(struct tipc_port *sender, ...@@ -1202,7 +1202,7 @@ static int link_send_sections_long(struct tipc_port *sender,
if (!sect_rest) { if (!sect_rest) {
sect_rest = msg_sect[++curr_sect].iov_len; sect_rest = msg_sect[++curr_sect].iov_len;
sect_crs = (const unchar *)msg_sect[curr_sect].iov_base; sect_crs = msg_sect[curr_sect].iov_base;
} }
if (sect_rest < fragm_rest) if (sect_rest < fragm_rest)
......
...@@ -338,7 +338,7 @@ static int release(struct socket *sock) ...@@ -338,7 +338,7 @@ static int release(struct socket *sock)
buf = __skb_dequeue(&sk->sk_receive_queue); buf = __skb_dequeue(&sk->sk_receive_queue);
if (buf == NULL) if (buf == NULL)
break; break;
if (TIPC_SKB_CB(buf)->handle != 0) if (TIPC_SKB_CB(buf)->handle != NULL)
kfree_skb(buf); kfree_skb(buf);
else { else {
if ((sock->state == SS_CONNECTING) || if ((sock->state == SS_CONNECTING) ||
...@@ -1364,7 +1364,7 @@ static u32 filter_rcv(struct sock *sk, struct sk_buff *buf) ...@@ -1364,7 +1364,7 @@ static u32 filter_rcv(struct sock *sk, struct sk_buff *buf)
return TIPC_ERR_OVERLOAD; return TIPC_ERR_OVERLOAD;
/* Enqueue message */ /* Enqueue message */
TIPC_SKB_CB(buf)->handle = 0; TIPC_SKB_CB(buf)->handle = NULL;
__skb_queue_tail(&sk->sk_receive_queue, buf); __skb_queue_tail(&sk->sk_receive_queue, buf);
skb_set_owner_r(buf, sk); skb_set_owner_r(buf, sk);
...@@ -1687,7 +1687,7 @@ static int shutdown(struct socket *sock, int how) ...@@ -1687,7 +1687,7 @@ static int shutdown(struct socket *sock, int how)
/* Disconnect and send a 'FIN+' or 'FIN-' message to peer */ /* Disconnect and send a 'FIN+' or 'FIN-' message to peer */
buf = __skb_dequeue(&sk->sk_receive_queue); buf = __skb_dequeue(&sk->sk_receive_queue);
if (buf) { if (buf) {
if (TIPC_SKB_CB(buf)->handle != 0) { if (TIPC_SKB_CB(buf)->handle != NULL) {
kfree_skb(buf); kfree_skb(buf);
goto restart; goto restart;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册