netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH-2.6.28] net: ipg.c fix bracing on endian swapping
@ 2008-11-17 21:42 Harvey Harrison
  2008-11-19 23:54 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Harvey Harrison @ 2008-11-17 21:42 UTC (permalink / raw)
  To: David Miller; +Cc: linux-netdev, Jeff Garzik

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>
---
 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 7373daf..0593698 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)
 		struct ipg_rx *rxfd = sp->rxd + entry;
 
 		pci_unmap_single(sp->pdev,
-			le64_to_cpu(rxfd->frag_info & ~IPG_RFI_FRAGLEN),
+			le64_to_cpu(rxfd->frag_info) & ~IPG_RFI_FRAGLEN,
 			sp->rx_buf_sz, PCI_DMA_FROMDEVICE);
 		dev_kfree_skb_irq(sp->rx_buff[entry]);
 		sp->rx_buff[entry] = NULL;
@@ -1179,7 +1179,7 @@ static int ipg_nic_rx_check_error(struct net_device *dev)
 		 */
 		if (sp->rx_buff[entry]) {
 			pci_unmap_single(sp->pdev,
-				le64_to_cpu(rxfd->frag_info & ~IPG_RFI_FRAGLEN),
+				le64_to_cpu(rxfd->frag_info) & ~IPG_RFI_FRAGLEN,
 				sp->rx_buf_sz, PCI_DMA_FROMDEVICE);
 
 			dev_kfree_skb_irq(sp->rx_buff[entry]);
@@ -1246,7 +1246,7 @@ static void ipg_nic_rx_with_start(struct net_device *dev,
 	if (jumbo->found_start)
 		dev_kfree_skb_irq(jumbo->skb);
 
-	pci_unmap_single(pdev, le64_to_cpu(rxfd->frag_info & ~IPG_RFI_FRAGLEN),
+	pci_unmap_single(pdev, le64_to_cpu(rxfd->frag_info) & ~IPG_RFI_FRAGLEN,
 			 sp->rx_buf_sz, PCI_DMA_FROMDEVICE);
 
 	skb_put(skb, sp->rxfrag_size);
@@ -1349,7 +1349,7 @@ static int ipg_nic_rx_jumbo(struct net_device *dev)
 		unsigned int entry = curr % IPG_RFDLIST_LENGTH;
 		struct ipg_rx *rxfd = sp->rxd + entry;
 
-		if (!(rxfd->rfs & le64_to_cpu(IPG_RFS_RFDDONE)))
+		if (!(rxfd->rfs & cpu_to_le64(IPG_RFS_RFDDONE)))
 			break;
 
 		switch (ipg_nic_rx_check_frame_type(dev)) {
-- 
1.6.0.4.994.g16bd3e




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH-2.6.28] net: ipg.c fix bracing on endian swapping
  2008-11-17 21:42 [PATCH-2.6.28] net: ipg.c fix bracing on endian swapping Harvey Harrison
@ 2008-11-19 23:54 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2008-11-19 23:54 UTC (permalink / raw)
  To: harvey.harrison; +Cc: netdev, jeff

From: Harvey Harrison <harvey.harrison@gmail.com>
Date: Mon, 17 Nov 2008 13:42:09 -0800

> 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>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-11-19 23:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-17 21:42 [PATCH-2.6.28] net: ipg.c fix bracing on endian swapping Harvey Harrison
2008-11-19 23:54 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).