aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ibmveth.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index 2802db23d3cb..44c9f993dcc4 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -212,8 +212,8 @@ static void ibmveth_replenish_buffer_pool(struct ibmveth_adapter *adapter, struc
212 break; 212 break;
213 } 213 }
214 214
215 free_index = pool->consumer_index++ % pool->size; 215 free_index = pool->consumer_index;
216 pool->consumer_index = free_index; 216 pool->consumer_index = (pool->consumer_index + 1) % pool->size;
217 index = pool->free_map[free_index]; 217 index = pool->free_map[free_index];
218 218
219 ibmveth_assert(index != IBM_VETH_INVALID_MAP); 219 ibmveth_assert(index != IBM_VETH_INVALID_MAP);
@@ -329,8 +329,10 @@ static void ibmveth_remove_buffer_from_pool(struct ibmveth_adapter *adapter, u64
329 adapter->rx_buff_pool[pool].buff_size, 329 adapter->rx_buff_pool[pool].buff_size,
330 DMA_FROM_DEVICE); 330 DMA_FROM_DEVICE);
331 331
332 free_index = adapter->rx_buff_pool[pool].producer_index++ % adapter->rx_buff_pool[pool].size; 332 free_index = adapter->rx_buff_pool[pool].producer_index;
333 adapter->rx_buff_pool[pool].producer_index = free_index; 333 adapter->rx_buff_pool[pool].producer_index
334 = (adapter->rx_buff_pool[pool].producer_index + 1)
335 % adapter->rx_buff_pool[pool].size;
334 adapter->rx_buff_pool[pool].free_map[free_index] = index; 336 adapter->rx_buff_pool[pool].free_map[free_index] = index;
335 337
336 mb(); 338 mb();