Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1fa347f authored by Roel Kluin's avatar Roel Kluin Committed by David S. Miller
Browse files

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: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b4ced2b7
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -2802,13 +2802,13 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
dma_error:
	dev_err(&pdev->dev, "TX DMA map failed\n");
	buffer_info->dma = 0;
	if (count)
		count--;

	while (count >= 0) {
		count--;
		i--;
		if (i < 0)
	while (count--) {
		if (i==0)
			i += tx_ring->count;
		i--;
		buffer_info = &tx_ring->buffer_info[i];
		e1000_unmap_and_free_tx_resource(adapter, buffer_info);
	}
+5 −5
Original line number Diff line number Diff line
@@ -3962,13 +3962,13 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
dma_error:
	dev_err(&pdev->dev, "TX DMA map failed\n");
	buffer_info->dma = 0;
	if (count)
		count--;

	while (count >= 0) {
		count--;
		i--;
		if (i < 0)
	while (count--) {
		if (i==0)
			i += tx_ring->count;
		i--;
		buffer_info = &tx_ring->buffer_info[i];
		e1000_put_txbuf(adapter, buffer_info);;
	}
+5 −5
Original line number Diff line number Diff line
@@ -2163,14 +2163,14 @@ dma_error:
	buffer_info->length = 0;
	buffer_info->next_to_watch = 0;
	buffer_info->mapped_as_page = false;
	if (count)
		count--;

	/* clear timestamp and dma mappings for remaining portion of packet */
	while (count >= 0) {
		count--;
		i--;
		if (i < 0)
	while (count--) {
		if (i==0)
			i += tx_ring->count;
		i--;
		buffer_info = &tx_ring->buffer_info[i];
		igbvf_put_txbuf(adapter, buffer_info);
	}
+5 −5
Original line number Diff line number Diff line
@@ -1363,13 +1363,13 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb,
dma_error:
	dev_err(&pdev->dev, "TX DMA map failed\n");
	buffer_info->dma = 0;
	if (count)
		count--;

	while (count >= 0) {
		count--;
		i--;
		if (i < 0)
	while (count--) {
		if (i==0)
			i += tx_ring->count;
		i--;
		buffer_info = &tx_ring->buffer_info[i];
		ixgb_unmap_and_free_tx_resource(adapter, buffer_info);
	}
+5 −5
Original line number Diff line number Diff line
@@ -5167,14 +5167,14 @@ dma_error:
	tx_buffer_info->dma = 0;
	tx_buffer_info->time_stamp = 0;
	tx_buffer_info->next_to_watch = 0;
	if (count)
		count--;

	/* clear timestamp and dma mappings for remaining portion of packet */
	while (count >= 0) {
		count--;
		i--;
		if (i < 0)
	while (count--) {
		if (i==0)
			i += tx_ring->count;
		i--;
		tx_buffer_info = &tx_ring->tx_buffer_info[i];
		ixgbe_unmap_and_free_tx_resource(adapter, tx_buffer_info);
	}