Commit 444fa88a authored by Chris Metcalf's avatar Chris Metcalf Committed by David S. Miller

net: tilegx driver: avoid compiler warning

The "id" variable was being incremented in common code, but only
initialized and used in IPv4 code.  We move the increment to the IPv4
code too, and then legitimately use the uninitialized_var() macro to
avoid the gcc 4.6 warning that 'id' may be used uninitialized.
Note that gcc 4.7 does not warn.
Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 04f0888d
...@@ -1734,7 +1734,8 @@ static void tso_headers_prepare(struct sk_buff *skb, unsigned char *headers, ...@@ -1734,7 +1734,8 @@ static void tso_headers_prepare(struct sk_buff *skb, unsigned char *headers,
unsigned int data_len = skb->len - sh_len; unsigned int data_len = skb->len - sh_len;
unsigned char *data = skb->data; unsigned char *data = skb->data;
unsigned int ih_off, th_off, p_len; unsigned int ih_off, th_off, p_len;
unsigned int isum_seed, tsum_seed, id, seq; unsigned int isum_seed, tsum_seed, seq;
unsigned int uninitialized_var(id);
int is_ipv6; int is_ipv6;
long f_id = -1; /* id of the current fragment */ long f_id = -1; /* id of the current fragment */
long f_size = skb_headlen(skb) - sh_len; /* current fragment size */ long f_size = skb_headlen(skb) - sh_len; /* current fragment size */
...@@ -1781,7 +1782,7 @@ static void tso_headers_prepare(struct sk_buff *skb, unsigned char *headers, ...@@ -1781,7 +1782,7 @@ static void tso_headers_prepare(struct sk_buff *skb, unsigned char *headers,
} else { } else {
ih = (struct iphdr *)(buf + ih_off); ih = (struct iphdr *)(buf + ih_off);
ih->tot_len = htons(sh_len + p_len - ih_off); ih->tot_len = htons(sh_len + p_len - ih_off);
ih->id = htons(id); ih->id = htons(id++);
ih->check = csum_long(isum_seed + ih->tot_len + ih->check = csum_long(isum_seed + ih->tot_len +
ih->id) ^ 0xffff; ih->id) ^ 0xffff;
} }
...@@ -1818,7 +1819,6 @@ static void tso_headers_prepare(struct sk_buff *skb, unsigned char *headers, ...@@ -1818,7 +1819,6 @@ static void tso_headers_prepare(struct sk_buff *skb, unsigned char *headers,
slot++; slot++;
} }
id++;
seq += p_len; seq += p_len;
/* The last segment may be less than gso_size. */ /* The last segment may be less than gso_size. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment