]> Pileus Git - ~andy/linux/commitdiff
drivers/net/ethernet/sfc: use standard __{clear,set}_bit_le() functions
authorBen Hutchings <bhutchings@solarflare.com>
Fri, 5 Oct 2012 00:13:03 +0000 (17:13 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 5 Oct 2012 18:04:54 +0000 (03:04 +0900)
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>
drivers/net/ethernet/sfc/efx.c
drivers/net/ethernet/sfc/net_driver.h
drivers/net/ethernet/sfc/nic.c

index 96bd980e828da5d28b0bed6329cb85e3655d598f..4f86d0cd516a3db2b4eff785d59d1f1a7c07a978 100644 (file)
@@ -2019,14 +2019,14 @@ static void efx_set_rx_mode(struct net_device *net_dev)
                netdev_for_each_mc_addr(ha, net_dev) {
                        crc = ether_crc_le(ETH_ALEN, ha->addr);
                        bit = crc & (EFX_MCAST_HASH_ENTRIES - 1);
-                       set_bit_le(bit, mc_hash->byte);
+                       __set_bit_le(bit, mc_hash);
                }
 
                /* Broadcast packets go through the multicast hash filter.
                 * ether_crc_le() of the broadcast address is 0xbe2612ff
                 * so we always add bit 0xff to the mask.
                 */
-               set_bit_le(0xff, mc_hash->byte);
+               __set_bit_le(0xff, mc_hash);
        }
 
        if (efx->port_enabled)
index c1a010cda89b92f20afc5657354a42bc592f8568..576a31091165492879ee22edbfd00eee4972047a 100644 (file)
@@ -1101,18 +1101,6 @@ static inline struct efx_rx_buffer *efx_rx_buffer(struct efx_rx_queue *rx_queue,
        return &rx_queue->buffer[index];
 }
 
-/* Set bit in a little-endian bitfield */
-static inline void set_bit_le(unsigned nr, unsigned char *addr)
-{
-       addr[nr / 8] |= (1 << (nr % 8));
-}
-
-/* Clear bit in a little-endian bitfield */
-static inline void clear_bit_le(unsigned nr, unsigned char *addr)
-{
-       addr[nr / 8] &= ~(1 << (nr % 8));
-}
-
 
 /**
  * EFX_MAX_FRAME_LEN - calculate maximum frame length
index cdff40b65729ad79a8a744933ca9453958305162..aab7cacb2e34a87203d199be8df72c20020b0e0b 100644 (file)
@@ -472,9 +472,9 @@ void efx_nic_init_tx(struct efx_tx_queue *tx_queue)
 
                efx_reado(efx, &reg, FR_AA_TX_CHKSM_CFG);
                if (tx_queue->queue & EFX_TXQ_TYPE_OFFLOAD)
-                       clear_bit_le(tx_queue->queue, (void *)&reg);
+                       __clear_bit_le(tx_queue->queue, &reg);
                else
-                       set_bit_le(tx_queue->queue, (void *)&reg);
+                       __set_bit_le(tx_queue->queue, &reg);
                efx_writeo(efx, &reg, FR_AA_TX_CHKSM_CFG);
        }