netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spidernet: Use pci_dma_mapping_error()
@ 2006-09-27 19:02 Olof Johansson
  2006-09-27 21:57 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Olof Johansson @ 2006-09-27 19:02 UTC (permalink / raw)
  To: Utz Bacher, Jens Osterkamp, jgarzik; +Cc: arnd, netdev

A driver shouldn't compare to DMA_ERROR_CODE directly, use
pci_dma_mapping_error() instead.


Signed-off-by: Olof Johansson <olof@lixom.net>

Index: linux-2.6/drivers/net/spider_net.c
===================================================================
--- linux-2.6.orig/drivers/net/spider_net.c
+++ linux-2.6/drivers/net/spider_net.c
@@ -317,7 +317,7 @@ spider_net_init_chain(struct spider_net_
 				     SPIDER_NET_DESCR_SIZE,
 				     direction);
 
-		if (buf == DMA_ERROR_CODE)
+		if (pci_dma_mapping_error(buf))
 			goto iommu_error;
 
 		descr->bus_addr = buf;
@@ -420,7 +420,7 @@ spider_net_prepare_rx_descr(struct spide
 	buf = pci_map_single(card->pdev, descr->skb->data,
 			SPIDER_NET_MAX_FRAME, PCI_DMA_FROMDEVICE);
 	descr->buf_addr = buf;
-	if (buf == DMA_ERROR_CODE) {
+	if (pci_dma_mapping_error(buf)) {
 		dev_kfree_skb_any(descr->skb);
 		if (netif_msg_rx_err(card) && net_ratelimit())
 			pr_err("Could not iommu-map rx buffer\n");
@@ -649,7 +649,7 @@ spider_net_prepare_tx_descr(struct spide
 	dma_addr_t buf;
 
 	buf = pci_map_single(card->pdev, skb->data, skb->len, PCI_DMA_TODEVICE);
-	if (buf == DMA_ERROR_CODE) {
+	if (pci_dma_mapping_error(buf)) {
 		if (netif_msg_tx_err(card) && net_ratelimit())
 			pr_err("could not iommu-map packet (%p, %i). "
 				  "Dropping packet\n", skb->data, skb->len);

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

* Re: [PATCH] spidernet: Use pci_dma_mapping_error()
  2006-09-27 19:02 [PATCH] spidernet: Use pci_dma_mapping_error() Olof Johansson
@ 2006-09-27 21:57 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2006-09-27 21:57 UTC (permalink / raw)
  To: Olof Johansson; +Cc: Utz Bacher, Jens Osterkamp, arnd, netdev

applied


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

end of thread, other threads:[~2006-09-27 21:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-27 19:02 [PATCH] spidernet: Use pci_dma_mapping_error() Olof Johansson
2006-09-27 21:57 ` Jeff Garzik

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