aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2010-01-19 09:21:45 -0500
committerDavid S. Miller <davem@davemloft.net>2010-01-20 19:21:22 -0500
commitc1fa347f20f17f14a4a1575727fa24340e8a9117 (patch)
tree520a4cc063e0f64030ddae6744970c7fcb0785db /drivers/net
parentb4ced2b768ab6c580148d1163c82a655fe147edc (diff)
e1000/e1000e/igb/igbvf/ixgb/ixgbe: Fix tests of unsigned in *_tx_map()
The variable count and i are unsigned so the (<|>=)0 tests do not work. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/e1000/e1000_main.c10
-rw-r--r--drivers/net/e1000e/netdev.c10
-rw-r--r--drivers/net/igbvf/netdev.c10
-rw-r--r--drivers/net/ixgb/ixgb_main.c10
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c10
5 files changed, 25 insertions, 25 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 7e855f9bbd97..b3f67b41627f 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2802,13 +2802,13 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
2802dma_error: 2802dma_error:
2803 dev_err(&pdev->dev, "TX DMA map failed\n"); 2803 dev_err(&pdev->dev, "TX DMA map failed\n");
2804 buffer_info->dma = 0; 2804 buffer_info->dma = 0;
2805 count--; 2805 if (count)
2806
2807 while (count >= 0) {
2808 count--; 2806 count--;
2809 i--; 2807
2810 if (i < 0) 2808 while (count--) {
2809 if (i==0)
2811 i += tx_ring->count; 2810 i += tx_ring->count;
2811 i--;
2812 buffer_info = &tx_ring->buffer_info[i]; 2812 buffer_info = &tx_ring->buffer_info[i];
2813 e1000_unmap_and_free_tx_resource(adapter, buffer_info); 2813 e1000_unmap_and_free_tx_resource(adapter, buffer_info);
2814 } 2814 }
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index c45965a256b6..f91f247ed6af 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -3962,13 +3962,13 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
3962dma_error: 3962dma_error:
3963 dev_err(&pdev->dev, "TX DMA map failed\n"); 3963 dev_err(&pdev->dev, "TX DMA map failed\n");
3964 buffer_info->dma = 0; 3964 buffer_info->dma = 0;
3965 count--; 3965 if (count)
3966
3967 while (count >= 0) {
3968 count--; 3966 count--;
3969 i--; 3967
3970 if (i < 0) 3968 while (count--) {
3969 if (i==0)
3971 i += tx_ring->count; 3970 i += tx_ring->count;
3971 i--;
3972 buffer_info = &tx_ring->buffer_info[i]; 3972 buffer_info = &tx_ring->buffer_info[i];
3973 e1000_put_txbuf(adapter, buffer_info);; 3973 e1000_put_txbuf(adapter, buffer_info);;
3974 } 3974 }
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
index 0dbd0320023a..10e038adba0f 100644
--- a/drivers/net/igbvf/netdev.c
+++ b/drivers/net/igbvf/netdev.c
@@ -2163,14 +2163,14 @@ dma_error:
2163 buffer_info->length = 0; 2163 buffer_info->length = 0;
2164 buffer_info->next_to_watch = 0; 2164 buffer_info->next_to_watch = 0;
2165 buffer_info->mapped_as_page = false; 2165 buffer_info->mapped_as_page = false;
2166 count--; 2166 if (count)
2167 count--;
2167 2168
2168 /* clear timestamp and dma mappings for remaining portion of packet */ 2169 /* clear timestamp and dma mappings for remaining portion of packet */
2169 while (count >= 0) { 2170 while (count--) {
2170 count--; 2171 if (i==0)
2171 i--;
2172 if (i < 0)
2173 i += tx_ring->count; 2172 i += tx_ring->count;
2173 i--;
2174 buffer_info = &tx_ring->buffer_info[i]; 2174 buffer_info = &tx_ring->buffer_info[i];
2175 igbvf_put_txbuf(adapter, buffer_info); 2175 igbvf_put_txbuf(adapter, buffer_info);
2176 } 2176 }
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index bcd0f01d5feb..593d1a4f217c 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1363,13 +1363,13 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb,
1363dma_error: 1363dma_error:
1364 dev_err(&pdev->dev, "TX DMA map failed\n"); 1364 dev_err(&pdev->dev, "TX DMA map failed\n");
1365 buffer_info->dma = 0; 1365 buffer_info->dma = 0;
1366 count--; 1366 if (count)
1367
1368 while (count >= 0) {
1369 count--; 1367 count--;
1370 i--; 1368
1371 if (i < 0) 1369 while (count--) {
1370 if (i==0)
1372 i += tx_ring->count; 1371 i += tx_ring->count;
1372 i--;
1373 buffer_info = &tx_ring->buffer_info[i]; 1373 buffer_info = &tx_ring->buffer_info[i];
1374 ixgb_unmap_and_free_tx_resource(adapter, buffer_info); 1374 ixgb_unmap_and_free_tx_resource(adapter, buffer_info);
1375 } 1375 }
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 9c9202f40b10..6d61add27a06 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -5167,14 +5167,14 @@ dma_error:
5167 tx_buffer_info->dma = 0; 5167 tx_buffer_info->dma = 0;
5168 tx_buffer_info->time_stamp = 0; 5168 tx_buffer_info->time_stamp = 0;
5169 tx_buffer_info->next_to_watch = 0; 5169 tx_buffer_info->next_to_watch = 0;
5170 count--; 5170 if (count)
5171 count--;
5171 5172
5172 /* clear timestamp and dma mappings for remaining portion of packet */ 5173 /* clear timestamp and dma mappings for remaining portion of packet */
5173 while (count >= 0) { 5174 while (count--) {
5174 count--; 5175 if (i==0)
5175 i--;
5176 if (i < 0)
5177 i += tx_ring->count; 5176 i += tx_ring->count;
5177 i--;
5178 tx_buffer_info = &tx_ring->tx_buffer_info[i]; 5178 tx_buffer_info = &tx_ring->tx_buffer_info[i];
5179 ixgbe_unmap_and_free_tx_resource(adapter, tx_buffer_info); 5179 ixgbe_unmap_and_free_tx_resource(adapter, tx_buffer_info);
5180 } 5180 }