Skip to content

Commit

Permalink
fix endian lossage in forcedeth
Browse files Browse the repository at this point in the history
a) if you initialize something with le32_to_cpu(...), then |= it
with host-endian and feed to cpu_to_le32(), it's most definitely
*not* __le32.  As sparse would've told you...

b) the whole sequence is |= cpu_to_le32(host-endian constant)

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Al Viro authored and Jeff Garzik committed Apr 4, 2008
1 parent e28e3a6 commit 30ecce9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/net/forcedeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -2112,9 +2112,8 @@ static inline void nv_tx_flip_ownership(struct net_device *dev)

np->tx_pkts_in_progress--;
if (np->tx_change_owner) {
__le32 flaglen = le32_to_cpu(np->tx_change_owner->first_tx_desc->flaglen);
flaglen |= NV_TX2_VALID;
np->tx_change_owner->first_tx_desc->flaglen = cpu_to_le32(flaglen);
np->tx_change_owner->first_tx_desc->flaglen |=
cpu_to_le32(NV_TX2_VALID);
np->tx_pkts_in_progress++;

np->tx_change_owner = np->tx_change_owner->next_tx_ctx;
Expand Down

0 comments on commit 30ecce9

Please sign in to comment.