aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/tile/tilegx.c
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2013-09-09 14:11:54 -0400
committerDavid S. Miller <davem@davemloft.net>2013-09-11 16:57:45 -0400
commit444fa88ac35aa1bf9b7c23945444bc67f631033b (patch)
treeaab780afb379eeea762585db713efa67f74c117c /drivers/net/ethernet/tile/tilegx.c
parent04f0888da20ea4f5842725c265c1940b708dc3e2 (diff)
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: Chris Metcalf <cmetcalf@tilera.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/tile/tilegx.c')
-rw-r--r--drivers/net/ethernet/tile/tilegx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/tile/tilegx.c b/drivers/net/ethernet/tile/tilegx.c
index 949076f4e6ae..13e6fff8ca23 100644
--- a/drivers/net/ethernet/tile/tilegx.c
+++ b/drivers/net/ethernet/tile/tilegx.c
@@ -1734,7 +1734,8 @@ static void tso_headers_prepare(struct sk_buff *skb, unsigned char *headers,
1734 unsigned int data_len = skb->len - sh_len; 1734 unsigned int data_len = skb->len - sh_len;
1735 unsigned char *data = skb->data; 1735 unsigned char *data = skb->data;
1736 unsigned int ih_off, th_off, p_len; 1736 unsigned int ih_off, th_off, p_len;
1737 unsigned int isum_seed, tsum_seed, id, seq; 1737 unsigned int isum_seed, tsum_seed, seq;
1738 unsigned int uninitialized_var(id);
1738 int is_ipv6; 1739 int is_ipv6;
1739 long f_id = -1; /* id of the current fragment */ 1740 long f_id = -1; /* id of the current fragment */
1740 long f_size = skb_headlen(skb) - sh_len; /* current fragment size */ 1741 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 } else { 1782 } else {
1782 ih = (struct iphdr *)(buf + ih_off); 1783 ih = (struct iphdr *)(buf + ih_off);
1783 ih->tot_len = htons(sh_len + p_len - ih_off); 1784 ih->tot_len = htons(sh_len + p_len - ih_off);
1784 ih->id = htons(id); 1785 ih->id = htons(id++);
1785 ih->check = csum_long(isum_seed + ih->tot_len + 1786 ih->check = csum_long(isum_seed + ih->tot_len +
1786 ih->id) ^ 0xffff; 1787 ih->id) ^ 0xffff;
1787 } 1788 }
@@ -1818,7 +1819,6 @@ static void tso_headers_prepare(struct sk_buff *skb, unsigned char *headers,
1818 slot++; 1819 slot++;
1819 } 1820 }
1820 1821
1821 id++;
1822 seq += p_len; 1822 seq += p_len;
1823 1823
1824 /* The last segment may be less than gso_size. */ 1824 /* The last segment may be less than gso_size. */