Skip to contentSkip to conversation

staging: gdm724x: fix sparse warnings in file gdm_lte.c

PATCH Greg KH 1 participant 1 message Feb 3, 2017 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Greg KH

author
#1 lore raw
Quoted 26 lines · Javier Rodriguez

drivers/staging/gdm724x/gdm_lte.c:201:33: warning: incorrect type in assignment (different base types)
drivers/staging/gdm724x/gdm_lte.c:201:33: expected unsigned int [unsigned] [addressable] [usertype] ph_len
drivers/staging/gdm724x/gdm_lte.c:201:33: got restricted __be16 [usertype] payload_len
drivers/staging/gdm724x/gdm_lte.c:311:39: warning: incorrect type in assignment (different base types)
drivers/staging/gdm724x/gdm_lte.c:311:39: expected restricted __sum16 [addressable] [assigned] [usertype] icmp6_cksum
drivers/staging/gdm724x/gdm_lte.c:311:39: got int

---
 drivers/staging/gdm724x/gdm_lte.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/gdm724x/gdm_lte.c +1 -1
index a182757..86b2b4f 100644
@@ -198,7 +198,7 @@ static int icmp6_checksum(struct ipv6hdr *ipv6, u16 *ptr, int len)
 	memset(&pseudo_header, 0, sizeof(pseudo_header));
 	memcpy(&pseudo_header.ph.ph_src, &ipv6->saddr.in6_u.u6_addr8, 16);
 	memcpy(&pseudo_header.ph.ph_dst, &ipv6->daddr.in6_u.u6_addr8, 16);
-	pseudo_header.ph.ph_len = ipv6->payload_len;
+	pseudo_header.ph.ph_len = be16_to_cpu(ipv6->payload_len);
 	pseudo_header.ph.ph_nxt = ipv6->nexthdr;
 
 	w = (u16 *)&pseudo_header;

drivers/staging/gdm724x/gdm_lte.c static int gdm_lte_emulate_ndp(struct sk_buff *skb_in, u32 nic_type) · line 311

Quoted 5 lines
drivers/staging/gdm724x/gdm_lte.c +1 -1
@@ -308,7 +308,7 @@ static int gdm_lte_emulate_ndp(struct sk_buff *skb_in, u32 nic_type)
 		memcpy(icmp_na + sizeof(struct icmp6hdr), &na,
 		       sizeof(struct neighbour_advertisement));
 
-		icmp6_out.icmp6_cksum = icmp6_checksum(&ipv6_out,
+		icmp6_out.icmp6_cksum = (__force __sum16) icmp6_checksum(&ipv6_out,

That feels really wrong, are you sure this is correct?

thanks,

greg k-h