aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>2012-10-04 20:13:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-05 14:04:55 -0400
commit459a130838e819d5bc7efc572cba4cdd5c4f2dd2 (patch)
tree9dddd0de62be4de22e512fd8cc26705faad89778
parent32766ec8195f801935cce8954cf45389885afc38 (diff)
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 <yoshikawa.takuya@oss.ntt.co.jp> Acked-by: Grant Grundler <grundler@parisc-linux.org> 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/dec/tulip/de2104x.c7
-rw-r--r--drivers/net/ethernet/dec/tulip/tulip_core.c7
2 files changed, 4 insertions, 10 deletions
diff --git a/drivers/net/ethernet/dec/tulip/de2104x.c b/drivers/net/ethernet/dec/tulip/de2104x.c
index 61cc0934286..77335853ac3 100644
--- a/drivers/net/ethernet/dec/tulip/de2104x.c
+++ b/drivers/net/ethernet/dec/tulip/de2104x.c
@@ -661,9 +661,6 @@ static netdev_tx_t de_start_xmit (struct sk_buff *skb,
661 new frame, not around filling de->setup_frame. This is non-deterministic 661 new frame, not around filling de->setup_frame. This is non-deterministic
662 when re-entered but still correct. */ 662 when re-entered but still correct. */
663 663
664#undef set_bit_le
665#define set_bit_le(i,p) do { ((char *)(p))[(i)/8] |= (1<<((i)%8)); } while(0)
666
667static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev) 664static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
668{ 665{
669 struct de_private *de = netdev_priv(dev); 666 struct de_private *de = netdev_priv(dev);
@@ -673,12 +670,12 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
673 u16 *eaddrs; 670 u16 *eaddrs;
674 671
675 memset(hash_table, 0, sizeof(hash_table)); 672 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 */
677 /* This should work on big-endian machines as well. */ 674 /* This should work on big-endian machines as well. */
678 netdev_for_each_mc_addr(ha, dev) { 675 netdev_for_each_mc_addr(ha, dev) {
679 int index = ether_crc_le(ETH_ALEN, ha->addr) & 0x1ff; 676 int index = ether_crc_le(ETH_ALEN, ha->addr) & 0x1ff;
680 677
681 set_bit_le(index, hash_table); 678 __set_bit_le(index, hash_table);
682 } 679 }
683 680
684 for (i = 0; i < 32; i++) { 681 for (i = 0; i < 32; i++) {
diff --git a/drivers/net/ethernet/dec/tulip/tulip_core.c b/drivers/net/ethernet/dec/tulip/tulip_core.c
index c4f37aca226..885700a1997 100644
--- a/drivers/net/ethernet/dec/tulip/tulip_core.c
+++ b/drivers/net/ethernet/dec/tulip/tulip_core.c
@@ -1010,9 +1010,6 @@ static int private_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
1010 new frame, not around filling tp->setup_frame. This is non-deterministic 1010 new frame, not around filling tp->setup_frame. This is non-deterministic
1011 when re-entered but still correct. */ 1011 when re-entered but still correct. */
1012 1012
1013#undef set_bit_le
1014#define set_bit_le(i,p) do { ((char *)(p))[(i)/8] |= (1<<((i)%8)); } while(0)
1015
1016static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev) 1013static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
1017{ 1014{
1018 struct tulip_private *tp = netdev_priv(dev); 1015 struct tulip_private *tp = netdev_priv(dev);
@@ -1022,12 +1019,12 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
1022 u16 *eaddrs; 1019 u16 *eaddrs;
1023 1020
1024 memset(hash_table, 0, sizeof(hash_table)); 1021 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 */
1026 /* This should work on big-endian machines as well. */ 1023 /* This should work on big-endian machines as well. */
1027 netdev_for_each_mc_addr(ha, dev) { 1024 netdev_for_each_mc_addr(ha, dev) {
1028 int index = ether_crc_le(ETH_ALEN, ha->addr) & 0x1ff; 1025 int index = ether_crc_le(ETH_ALEN, ha->addr) & 0x1ff;
1029 1026
1030 set_bit_le(index, hash_table); 1027 __set_bit_le(index, hash_table);
1031 } 1028 }
1032 for (i = 0; i < 32; i++) { 1029 for (i = 0; i < 32; i++) {
1033 *setup_frm++ = hash_table[i]; 1030 *setup_frm++ = hash_table[i];