aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2012-10-04 20:13:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-05 14:04:54 -0400
commit32766ec8195f801935cce8954cf45389885afc38 (patch)
tree2ad37df039977436df564e03a51710dad4ba5975
parent52e842432f36d5b15227d0ee0d2aa3d2bc3cc0b2 (diff)
drivers/net/ethernet/sfc: use standard __{clear,set}_bit_le() functions
There are now standard functions for dealing with little-endian bit arrays, so use them instead of our own implementations. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp> Cc: David Miller <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/net/ethernet/sfc/efx.c4
-rw-r--r--drivers/net/ethernet/sfc/net_driver.h12
-rw-r--r--drivers/net/ethernet/sfc/nic.c4
3 files changed, 4 insertions, 16 deletions
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 96bd980e828..4f86d0cd516 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -2019,14 +2019,14 @@ static void efx_set_rx_mode(struct net_device *net_dev)
2019 netdev_for_each_mc_addr(ha, net_dev) { 2019 netdev_for_each_mc_addr(ha, net_dev) {
2020 crc = ether_crc_le(ETH_ALEN, ha->addr); 2020 crc = ether_crc_le(ETH_ALEN, ha->addr);
2021 bit = crc & (EFX_MCAST_HASH_ENTRIES - 1); 2021 bit = crc & (EFX_MCAST_HASH_ENTRIES - 1);
2022 set_bit_le(bit, mc_hash->byte); 2022 __set_bit_le(bit, mc_hash);
2023 } 2023 }
2024 2024
2025 /* Broadcast packets go through the multicast hash filter. 2025 /* Broadcast packets go through the multicast hash filter.
2026 * ether_crc_le() of the broadcast address is 0xbe2612ff 2026 * ether_crc_le() of the broadcast address is 0xbe2612ff
2027 * so we always add bit 0xff to the mask. 2027 * so we always add bit 0xff to the mask.
2028 */ 2028 */
2029 set_bit_le(0xff, mc_hash->byte); 2029 __set_bit_le(0xff, mc_hash);
2030 } 2030 }
2031 2031
2032 if (efx->port_enabled) 2032 if (efx->port_enabled)
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index c1a010cda89..576a3109116 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -1101,18 +1101,6 @@ static inline struct efx_rx_buffer *efx_rx_buffer(struct efx_rx_queue *rx_queue,
1101 return &rx_queue->buffer[index]; 1101 return &rx_queue->buffer[index];
1102} 1102}
1103 1103
1104/* Set bit in a little-endian bitfield */
1105static inline void set_bit_le(unsigned nr, unsigned char *addr)
1106{
1107 addr[nr / 8] |= (1 << (nr % 8));
1108}
1109
1110/* Clear bit in a little-endian bitfield */
1111static inline void clear_bit_le(unsigned nr, unsigned char *addr)
1112{
1113 addr[nr / 8] &= ~(1 << (nr % 8));
1114}
1115
1116 1104
1117/** 1105/**
1118 * EFX_MAX_FRAME_LEN - calculate maximum frame length 1106 * EFX_MAX_FRAME_LEN - calculate maximum frame length
diff --git a/drivers/net/ethernet/sfc/nic.c b/drivers/net/ethernet/sfc/nic.c
index cdff40b6572..aab7cacb2e3 100644
--- a/drivers/net/ethernet/sfc/nic.c
+++ b/drivers/net/ethernet/sfc/nic.c
@@ -472,9 +472,9 @@ void efx_nic_init_tx(struct efx_tx_queue *tx_queue)
472 472
473 efx_reado(efx, &reg, FR_AA_TX_CHKSM_CFG); 473 efx_reado(efx, &reg, FR_AA_TX_CHKSM_CFG);
474 if (tx_queue->queue & EFX_TXQ_TYPE_OFFLOAD) 474 if (tx_queue->queue & EFX_TXQ_TYPE_OFFLOAD)
475 clear_bit_le(tx_queue->queue, (void *)&reg); 475 __clear_bit_le(tx_queue->queue, &reg);
476 else 476 else
477 set_bit_le(tx_queue->queue, (void *)&reg); 477 __set_bit_le(tx_queue->queue, &reg);
478 efx_writeo(efx, &reg, FR_AA_TX_CHKSM_CFG); 478 efx_writeo(efx, &reg, FR_AA_TX_CHKSM_CFG);
479 } 479 }
480 480