diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-11-19 18:54:38 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-19 18:54:38 -0500 |
commit | b88ed5cc884e4c28d787cf0912b8635376f16a87 (patch) | |
tree | e2668a2e0c8565145a8f43139b5f407be2f29968 | |
parent | de339c2aa7fea18410b1abeab5674bfbd4073a63 (diff) |
net: ipg.c fix bracing on endian swapping
rxfd->frag_info is a __le64, IPG_RFI_FRAGLEN is a cpu-endian
constant and wants to be outside of the le64_to_cpu. Fixed
in multiple places.
Also an occurrence where le64_to_cpu was used instead of cpu_to_le64
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ipg.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c index 7373dafbb3f7..059369885be1 100644 --- a/drivers/net/ipg.c +++ b/drivers/net/ipg.c | |||
@@ -1112,7 +1112,7 @@ static void ipg_nic_rx_free_skb(struct net_device *dev) | |||
1112 | struct ipg_rx *rxfd = sp->rxd + entry; | 1112 | struct ipg_rx *rxfd = sp->rxd + entry; |
1113 | 1113 | ||
1114 | pci_unmap_single(sp->pdev, | 1114 | pci_unmap_single(sp->pdev, |
1115 | le64_to_cpu(rxfd->frag_info & ~IPG_RFI_FRAGLEN), | 1115 | le64_to_cpu(rxfd->frag_info) & ~IPG_RFI_FRAGLEN, |
1116 | sp->rx_buf_sz, PCI_DMA_FROMDEVICE); | 1116 | sp->rx_buf_sz, PCI_DMA_FROMDEVICE); |
1117 | dev_kfree_skb_irq(sp->rx_buff[entry]); | 1117 | dev_kfree_skb_irq(sp->rx_buff[entry]); |
1118 | sp->rx_buff[entry] = NULL; | 1118 | sp->rx_buff[entry] = NULL; |
@@ -1179,7 +1179,7 @@ static int ipg_nic_rx_check_error(struct net_device *dev) | |||
1179 | */ | 1179 | */ |
1180 | if (sp->rx_buff[entry]) { | 1180 | if (sp->rx_buff[entry]) { |
1181 | pci_unmap_single(sp->pdev, | 1181 | pci_unmap_single(sp->pdev, |
1182 | le64_to_cpu(rxfd->frag_info & ~IPG_RFI_FRAGLEN), | 1182 | le64_to_cpu(rxfd->frag_info) & ~IPG_RFI_FRAGLEN, |
1183 | sp->rx_buf_sz, PCI_DMA_FROMDEVICE); | 1183 | sp->rx_buf_sz, PCI_DMA_FROMDEVICE); |
1184 | 1184 | ||
1185 | dev_kfree_skb_irq(sp->rx_buff[entry]); | 1185 | dev_kfree_skb_irq(sp->rx_buff[entry]); |
@@ -1246,7 +1246,7 @@ static void ipg_nic_rx_with_start(struct net_device *dev, | |||
1246 | if (jumbo->found_start) | 1246 | if (jumbo->found_start) |
1247 | dev_kfree_skb_irq(jumbo->skb); | 1247 | dev_kfree_skb_irq(jumbo->skb); |
1248 | 1248 | ||
1249 | pci_unmap_single(pdev, le64_to_cpu(rxfd->frag_info & ~IPG_RFI_FRAGLEN), | 1249 | pci_unmap_single(pdev, le64_to_cpu(rxfd->frag_info) & ~IPG_RFI_FRAGLEN, |
1250 | sp->rx_buf_sz, PCI_DMA_FROMDEVICE); | 1250 | sp->rx_buf_sz, PCI_DMA_FROMDEVICE); |
1251 | 1251 | ||
1252 | skb_put(skb, sp->rxfrag_size); | 1252 | skb_put(skb, sp->rxfrag_size); |
@@ -1349,7 +1349,7 @@ static int ipg_nic_rx_jumbo(struct net_device *dev) | |||
1349 | unsigned int entry = curr % IPG_RFDLIST_LENGTH; | 1349 | unsigned int entry = curr % IPG_RFDLIST_LENGTH; |
1350 | struct ipg_rx *rxfd = sp->rxd + entry; | 1350 | struct ipg_rx *rxfd = sp->rxd + entry; |
1351 | 1351 | ||
1352 | if (!(rxfd->rfs & le64_to_cpu(IPG_RFS_RFDDONE))) | 1352 | if (!(rxfd->rfs & cpu_to_le64(IPG_RFS_RFDDONE))) |
1353 | break; | 1353 | break; |
1354 | 1354 | ||
1355 | switch (ipg_nic_rx_check_frame_type(dev)) { | 1355 | switch (ipg_nic_rx_check_frame_type(dev)) { |