diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 14:43:13 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 14:43:13 -0700 |
| commit | 951cc93a7493a81a47e20231441bc6cf17c98a37 (patch) | |
| tree | f53934f0f225e0215a85c8c59af4c6513e89e3f1 /drivers/net/declance.c | |
| parent | a7e1aabb28e8154ce987b622fd78d80a1ca39361 (diff) | |
| parent | 415b3334a21aa67806c52d1acf4e72e14f7f402f (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1287 commits)
icmp: Fix regression in nexthop resolution during replies.
net: Fix ppc64 BPF JIT dependencies.
acenic: include NET_SKB_PAD headroom to incoming skbs
ixgbe: convert to ndo_fix_features
ixgbe: only enable WoL for magic packet by default
ixgbe: remove ifdef check for non-existent define
ixgbe: Pass staterr instead of re-reading status and error bits from descriptor
ixgbe: Move interrupt related values out of ring and into q_vector
ixgbe: add structure for containing RX/TX rings to q_vector
ixgbe: inline the ixgbe_maybe_stop_tx function
ixgbe: Update ATR to use recorded TX queues instead of CPU for routing
igb: Fix for DH89xxCC near end loopback test
e1000: always call e1000_check_for_link() on e1000_ce4100 MACs.
netxen: add fw version compatibility check
be2net: request native mode each time the card is reset
ipv4: Constrain UFO fragment sizes to multiples of 8 bytes
virtio_net: Fix panic in virtnet_remove
ipv6: make fragment identifications less predictable
ipv6: unshare inetpeers
can: make function can_get_bittiming static
...
Diffstat (limited to 'drivers/net/declance.c')
| -rw-r--r-- | drivers/net/declance.c | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/drivers/net/declance.c b/drivers/net/declance.c index 219eb5ad5c12..d5598f6584a3 100644 --- a/drivers/net/declance.c +++ b/drivers/net/declance.c @@ -326,15 +326,18 @@ static void load_csrs(struct lance_private *lp) */ static void cp_to_buf(const int type, void *to, const void *from, int len) { - unsigned short *tp, *fp, clen; - unsigned char *rtp, *rfp; + unsigned short *tp; + const unsigned short *fp; + unsigned short clen; + unsigned char *rtp; + const unsigned char *rfp; if (type == PMAD_LANCE) { memcpy(to, from, len); } else if (type == PMAX_LANCE) { clen = len >> 1; - tp = (unsigned short *) to; - fp = (unsigned short *) from; + tp = to; + fp = from; while (clen--) { *tp++ = *fp++; @@ -342,8 +345,8 @@ static void cp_to_buf(const int type, void *to, const void *from, int len) } clen = len & 1; - rtp = (unsigned char *) tp; - rfp = (unsigned char *) fp; + rtp = tp; + rfp = fp; while (clen--) { *rtp++ = *rfp++; } @@ -352,8 +355,8 @@ static void cp_to_buf(const int type, void *to, const void *from, int len) * copy 16 Byte chunks */ clen = len >> 4; - tp = (unsigned short *) to; - fp = (unsigned short *) from; + tp = to; + fp = from; while (clen--) { *tp++ = *fp++; *tp++ = *fp++; @@ -382,15 +385,18 @@ static void cp_to_buf(const int type, void *to, const void *from, int len) static void cp_from_buf(const int type, void *to, const void *from, int len) { - unsigned short *tp, *fp, clen; - unsigned char *rtp, *rfp; + unsigned short *tp; + const unsigned short *fp; + unsigned short clen; + unsigned char *rtp; + const unsigned char *rfp; if (type == PMAD_LANCE) { memcpy(to, from, len); } else if (type == PMAX_LANCE) { clen = len >> 1; - tp = (unsigned short *) to; - fp = (unsigned short *) from; + tp = to; + fp = from; while (clen--) { *tp++ = *fp++; fp++; @@ -398,8 +404,8 @@ static void cp_from_buf(const int type, void *to, const void *from, int len) clen = len & 1; - rtp = (unsigned char *) tp; - rfp = (unsigned char *) fp; + rtp = tp; + rfp = fp; while (clen--) { *rtp++ = *rfp++; @@ -410,8 +416,8 @@ static void cp_from_buf(const int type, void *to, const void *from, int len) * copy 16 Byte chunks */ clen = len >> 4; - tp = (unsigned short *) to; - fp = (unsigned short *) from; + tp = to; + fp = from; while (clen--) { *tp++ = *fp++; *tp++ = *fp++; @@ -940,7 +946,6 @@ static void lance_load_multicast(struct net_device *dev) struct lance_private *lp = netdev_priv(dev); volatile u16 *ib = (volatile u16 *)dev->mem_start; struct netdev_hw_addr *ha; - char *addrs; u32 crc; /* set all multicast bits */ @@ -959,13 +964,7 @@ static void lance_load_multicast(struct net_device *dev) /* Add addresses */ netdev_for_each_mc_addr(ha, dev) { - addrs = ha->addr; - - /* multicast address? */ - if (!(*addrs & 1)) - continue; - - crc = ether_crc_le(ETH_ALEN, addrs); + crc = ether_crc_le(ETH_ALEN, ha->addr); crc = crc >> 26; *lib_ptr(ib, filter[crc >> 4], lp->type) |= 1 << (crc & 0xf); } |
