Skip to content

Commit

Permalink
net: Fix build warnings after mac_header and transport_header became …
Browse files Browse the repository at this point in the history
…__u16.

net/core/skbuff.c: In function ‘__alloc_skb_head’:
net/core/skbuff.c:203:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]
net/core/skbuff.c: In function ‘__alloc_skb’:
net/core/skbuff.c:279:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]
net/core/skbuff.c:280:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]
net/core/skbuff.c: In function ‘build_skb’:
net/core/skbuff.c:348:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]
net/core/skbuff.c:349:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed May 28, 2013
1 parent 6c8b4e3 commit 06ecf24
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions net/core/skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ struct sk_buff *__alloc_skb_head(gfp_t gfp_mask, int node)
atomic_set(&skb->users, 1);

#ifdef NET_SKBUFF_DATA_USES_OFFSET
skb->mac_header = ~0U;
skb->mac_header = (__u16) ~0U;
#endif
out:
return skb;
Expand Down Expand Up @@ -276,8 +276,8 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask,
skb_reset_tail_pointer(skb);
skb->end = skb->tail + size;
#ifdef NET_SKBUFF_DATA_USES_OFFSET
skb->mac_header = ~0U;
skb->transport_header = ~0U;
skb->mac_header = (__u16) ~0U;
skb->transport_header = (__u16) ~0U;
#endif

/* make sure we initialize shinfo sequentially */
Expand Down Expand Up @@ -345,8 +345,8 @@ struct sk_buff *build_skb(void *data, unsigned int frag_size)
skb_reset_tail_pointer(skb);
skb->end = skb->tail + size;
#ifdef NET_SKBUFF_DATA_USES_OFFSET
skb->mac_header = ~0U;
skb->transport_header = ~0U;
skb->mac_header = (__u16) ~0U;
skb->transport_header = (__u16) ~0U;
#endif

/* make sure we initialize shinfo sequentially */
Expand Down

0 comments on commit 06ecf24

Please sign in to comment.