Skip to contentSkip to conversation

net: ip_sockglue.c add static, annotate ports' endianness

PATCH Applied Harvey Harrison 2 participants 2 messages Nov 18, 2008 – Nov 20, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ip_sockglue.c add static, annotate ports' endianness

Fixes sparse warnings:
net/ipv4/ip_sockglue.c:146:15: warning: incorrect type in assignment (different base types)
net/ipv4/ip_sockglue.c:146:15: expected restricted __be16 [assigned] [usertype] sin_port
net/ipv4/ip_sockglue.c:146:15: got unsigned short [unsigned] [short] [usertype] <noident>
net/ipv4/ip_sockglue.c:130:6: warning: symbol 'ip_cmsg_recv_dstaddr' was not declared. Should it be static?

---
These are new warnings between next-20081117 and next-20081118

 net/ipv4/ip_sockglue.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
net/ipv4/ip_sockglue.c +2 -2
index 624b534..43c0585 100644
@@ -127,11 +127,11 @@ static void ip_cmsg_recv_security(struct msghdr *msg, struct sk_buff *skb)
 	security_release_secctx(secdata, seclen);
 }
 
-void ip_cmsg_recv_dstaddr(struct msghdr *msg, struct sk_buff *skb)
+static void ip_cmsg_recv_dstaddr(struct msghdr *msg, struct sk_buff *skb)
 {
 	struct sockaddr_in sin;
 	struct iphdr *iph = ip_hdr(skb);
-	u16 *ports = (u16 *) skb_transport_header(skb);
+	__be16 *ports = (__be16 *)skb_transport_header(skb);
 
 	if (skb_transport_offset(skb) + 4 > skb->len)
 		return;
Signature · 1 line
1.6.0.4.994.g16bd3e
maintainer Applied
#1 lore raw

From: Harvey Harrison <[email protected]>
Date: Tue, 18 Nov 2008 12:24:01 -0800

Quoted 9 lines

Fixes sparse warnings:
net/ipv4/ip_sockglue.c:146:15: warning: incorrect type in assignment (different base types)
net/ipv4/ip_sockglue.c:146:15: expected restricted __be16 [assigned] [usertype] sin_port
net/ipv4/ip_sockglue.c:146:15: got unsigned short [unsigned] [short] [usertype] <noident>
net/ipv4/ip_sockglue.c:130:6: warning: symbol 'ip_cmsg_recv_dstaddr' was not declared. Should it be static?

---
These are new warnings between next-20081117 and next-20081118

Applied, thanks.