From 8b1c36b357153f491ddea5363fdd397109c3326f Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 30 Jan 2012 16:53:37 +0000 Subject: sfc: MTD: Leave the DEBUG macro alone no longer defines DEBUG so we do not need to un-define it here. Signed-off-by: Ben Hutchings diff --git a/drivers/net/ethernet/sfc/mtd.c b/drivers/net/ethernet/sfc/mtd.c index eff49da..79c1922 100644 --- a/drivers/net/ethernet/sfc/mtd.c +++ b/drivers/net/ethernet/sfc/mtd.c @@ -10,7 +10,6 @@ #include #include -#undef DEBUG /* has its own use for DEBUG */ #include #include #include -- cgit v0.10.2 From 06e63c57acbb1df7c35ebe846ae416a8b88dfafa Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 30 Jan 2012 16:55:05 +0000 Subject: 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 diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c index a33aef2..1dfda5e 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, /* Offset is always within one page, so we don't need to consider * the page order. */ - return ((__force unsigned long) buf->dma_addr & (PAGE_SIZE - 1)) + + return ((unsigned int) buf->dma_addr & (PAGE_SIZE - 1)) + efx->type->rx_buffer_hash_size; } static inline unsigned int efx_rx_buf_size(struct efx_nic *efx) -- cgit v0.10.2