aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2012-01-30 11:55:05 -0500
committerBen Hutchings <bhutchings@solarflare.com>2012-01-30 11:58:45 -0500
commit06e63c57acbb1df7c35ebe846ae416a8b88dfafa (patch)
tree8f94c0c1d4c2347dc0dc5099440d3dc3b19e203f /drivers/net
parent8b1c36b357153f491ddea5363fdd397109c3326f (diff)
sfc: Use a more sensible cast in efx_rx_buf_offset()
This function returns the page offset of the buffer, which can be calculated based on either its DMA address or its virtual address. It used to use the virtual address and we would cast that to unsigned long, as anything smaller would result in a compiler warning. Now that it's using the DMA address we should use unsigned int, matching the return type. It is also unnecessary to use __force. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/sfc/rx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c
index a33aef25ead9..1dfda5e27919 100644
--- a/drivers/net/ethernet/sfc/rx.c
+++ b/drivers/net/ethernet/sfc/rx.c
@@ -98,7 +98,7 @@ static inline unsigned int efx_rx_buf_offset(struct efx_nic *efx,
98 /* Offset is always within one page, so we don't need to consider 98 /* Offset is always within one page, so we don't need to consider
99 * the page order. 99 * the page order.
100 */ 100 */
101 return ((__force unsigned long) buf->dma_addr & (PAGE_SIZE - 1)) + 101 return ((unsigned int) buf->dma_addr & (PAGE_SIZE - 1)) +
102 efx->type->rx_buffer_hash_size; 102 efx->type->rx_buffer_hash_size;
103} 103}
104static inline unsigned int efx_rx_buf_size(struct efx_nic *efx) 104static inline unsigned int efx_rx_buf_size(struct efx_nic *efx)