net: jme.c rxdesc.flags is __le16, other missing endian swaps

This is the minimal patch to fix endian mismatches. These are
probably bugs on big-endian arches, noops on little endian.

jme_rxsum_ok could be improved to directly take a __le16 and
change all of the masks/sets to be in little-endian, but
has not been done here to keep the patch small.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Harvey Harrison and committed by David S. Miller 31c221c4 9d6ada9f

+10 -11
+10 -11
drivers/net/jme.c
··· 912 912 skb_put(skb, framesize); 913 913 skb->protocol = eth_type_trans(skb, jme->dev); 914 914 915 - if (jme_rxsum_ok(jme, rxdesc->descwb.flags)) 915 + if (jme_rxsum_ok(jme, le16_to_cpu(rxdesc->descwb.flags))) 916 916 skb->ip_summed = CHECKSUM_UNNECESSARY; 917 917 else 918 918 skb->ip_summed = CHECKSUM_NONE; 919 919 920 - if (rxdesc->descwb.flags & RXWBFLAG_TAGON) { 920 + if (rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_TAGON)) { 921 921 if (jme->vlgrp) { 922 922 jme->jme_vlan_rx(skb, jme->vlgrp, 923 - le32_to_cpu(rxdesc->descwb.vlan)); 923 + le16_to_cpu(rxdesc->descwb.vlan)); 924 924 NET_STAT(jme).rx_bytes += 4; 925 925 } 926 926 } else { 927 927 jme->jme_rx(skb); 928 928 } 929 929 930 - if ((le16_to_cpu(rxdesc->descwb.flags) & RXWBFLAG_DEST) == 931 - RXWBFLAG_DEST_MUL) 930 + if ((rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_DEST)) == 931 + cpu_to_le16(RXWBFLAG_DEST_MUL)) 932 932 ++(NET_STAT(jme).multicast); 933 933 934 934 jme->dev->last_rx = jiffies; ··· 961 961 rxdesc = rxring->desc; 962 962 rxdesc += i; 963 963 964 - if ((rxdesc->descwb.flags & RXWBFLAG_OWN) || 964 + if ((rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_OWN)) || 965 965 !(rxdesc->descwb.desccnt & RXWBDCNT_WBCPL)) 966 966 goto out; 967 967 ··· 1763 1763 } 1764 1764 1765 1765 static int 1766 - jme_tx_tso(struct sk_buff *skb, 1767 - u16 *mss, u8 *flags) 1766 + jme_tx_tso(struct sk_buff *skb, __le16 *mss, u8 *flags) 1768 1767 { 1769 - *mss = skb_shinfo(skb)->gso_size << TXDESC_MSS_SHIFT; 1768 + *mss = cpu_to_le16(skb_shinfo(skb)->gso_size << TXDESC_MSS_SHIFT); 1770 1769 if (*mss) { 1771 1770 *flags |= TXFLAG_LSEN; 1772 1771 ··· 1825 1826 } 1826 1827 1827 1828 static inline void 1828 - jme_tx_vlan(struct sk_buff *skb, u16 *vlan, u8 *flags) 1829 + jme_tx_vlan(struct sk_buff *skb, __le16 *vlan, u8 *flags) 1829 1830 { 1830 1831 if (vlan_tx_tag_present(skb)) { 1831 1832 *flags |= TXFLAG_TAGON; 1832 - *vlan = vlan_tx_tag_get(skb); 1833 + *vlan = cpu_to_le16(vlan_tx_tag_get(skb)); 1833 1834 } 1834 1835 } 1835 1836