DORMANTno replies

[PATCH 2.6.9 2/3] hp100: use inline for comple usage of dev->priv

From: Stephen Hemminger <hidden>
Date: 2004-10-19 21:18:18

Make a separate function for the one more complex usage of netdev_priv.

Signed-off-by: Stephen Hemminger <redacted>

diff -Nru a/drivers/net/hp100.c b/drivers/net/hp100.c
--- a/drivers/net/hp100.c	2004-10-18 15:57:57 -07:00
+++ b/drivers/net/hp100.c	2004-10-18 15:57:57 -07:00
@@ -284,6 +284,12 @@
 	return ((u_long) ptr) + lp->whatever_offset;
 }
 
+static inline u_int pdl_map_data(struct hp100_private *lp, void *data)
+{
+	return pci_map_single(lp->pci_dev, data, 
+			      MAX_ETHER_SIZE, PCI_DMA_FROMDEVICE);
+}
+
 /* TODO: This function should not really be needed in a good design... */
 static void wait(void)
 {
@@ -1273,7 +1279,8 @@
 		/* Conversion to new PCI API : map skbuf data to PCI bus.
 		 * Doc says it's OK for EISA as well - Jean II */
 		ringptr->pdl[0] = 0x00020000;	/* Write PDH */
-		ringptr->pdl[3] = ((u_int) pci_map_single(((struct hp100_private *) (dev->priv))->pci_dev, ringptr->skb->data, MAX_ETHER_SIZE, PCI_DMA_FROMDEVICE));
+		ringptr->pdl[3] = pdl_map_data(netdev_priv(dev), 
+					       ringptr->skb->data);
 		ringptr->pdl[4] = MAX_ETHER_SIZE;	/* Length of Data */
 
 #ifdef HP100_DEBUG_BM
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help