Skip to content

Commit 459a130

Browse files
Takuya Yoshikawatorvalds
Takuya Yoshikawa
authored andcommitted
drivers/net/ethernet/dec/tulip: Use standard __set_bit_le() function
To introduce generic set_bit_le() later, we remove our own definition and use a proper non-atomic bitops function: __set_bit_le(). Signed-off-by: Takuya Yoshikawa <[email protected]> Acked-by: Grant Grundler <[email protected]> Cc: David Miller <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 32766ec commit 459a130

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

drivers/net/ethernet/dec/tulip/de2104x.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -661,9 +661,6 @@ static netdev_tx_t de_start_xmit (struct sk_buff *skb,
661661
new frame, not around filling de->setup_frame. This is non-deterministic
662662
when re-entered but still correct. */
663663

664-
#undef set_bit_le
665-
#define set_bit_le(i,p) do { ((char *)(p))[(i)/8] |= (1<<((i)%8)); } while(0)
666-
667664
static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
668665
{
669666
struct de_private *de = netdev_priv(dev);
@@ -673,12 +670,12 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
673670
u16 *eaddrs;
674671

675672
memset(hash_table, 0, sizeof(hash_table));
676-
set_bit_le(255, hash_table); /* Broadcast entry */
673+
__set_bit_le(255, hash_table); /* Broadcast entry */
677674
/* This should work on big-endian machines as well. */
678675
netdev_for_each_mc_addr(ha, dev) {
679676
int index = ether_crc_le(ETH_ALEN, ha->addr) & 0x1ff;
680677

681-
set_bit_le(index, hash_table);
678+
__set_bit_le(index, hash_table);
682679
}
683680

684681
for (i = 0; i < 32; i++) {

drivers/net/ethernet/dec/tulip/tulip_core.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -1010,9 +1010,6 @@ static int private_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
10101010
new frame, not around filling tp->setup_frame. This is non-deterministic
10111011
when re-entered but still correct. */
10121012

1013-
#undef set_bit_le
1014-
#define set_bit_le(i,p) do { ((char *)(p))[(i)/8] |= (1<<((i)%8)); } while(0)
1015-
10161013
static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
10171014
{
10181015
struct tulip_private *tp = netdev_priv(dev);
@@ -1022,12 +1019,12 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
10221019
u16 *eaddrs;
10231020

10241021
memset(hash_table, 0, sizeof(hash_table));
1025-
set_bit_le(255, hash_table); /* Broadcast entry */
1022+
__set_bit_le(255, hash_table); /* Broadcast entry */
10261023
/* This should work on big-endian machines as well. */
10271024
netdev_for_each_mc_addr(ha, dev) {
10281025
int index = ether_crc_le(ETH_ALEN, ha->addr) & 0x1ff;
10291026

1030-
set_bit_le(index, hash_table);
1027+
__set_bit_le(index, hash_table);
10311028
}
10321029
for (i = 0; i < 32; i++) {
10331030
*setup_frm++ = hash_table[i];

0 commit comments

Comments
 (0)