netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Gary Zambrano <zambrano@broadcom.com>
Cc: netdev@vger.kernel.org
Subject: [PATCH 4/4] b44: use netdev_alloc_skb
Date: Mon, 04 Jun 2007 13:25:40 -0700	[thread overview]
Message-ID: <20070604202712.537466404@linux-foundation.org> (raw)
In-Reply-To: 20070604202536.503165465@linux-foundation.org

[-- Attachment #1: b44-netdev_alloc.patch --]
[-- Type: text/plain, Size: 1313 bytes --]

Use netdev_alloc_skb rather than dev_alloc_skb when allocating
receive buffers.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

---
 drivers/net/b44.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- a/drivers/net/b44.c	2007-06-04 12:49:11.000000000 -0700
+++ b/drivers/net/b44.c	2007-06-04 12:49:26.000000000 -0700
@@ -653,7 +653,7 @@ static int b44_alloc_rx_skb(struct b44 *
 		src_map = &bp->rx_buffers[src_idx];
 	dest_idx = dest_idx_unmasked & (B44_RX_RING_SIZE - 1);
 	map = &bp->rx_buffers[dest_idx];
-	skb = dev_alloc_skb(RX_PKT_BUF_SZ);
+	skb = netdev_alloc_skb(bp->dev, RX_PKT_BUF_SZ);
 	if (skb == NULL)
 		return -ENOMEM;
 
@@ -669,7 +669,7 @@ static int b44_alloc_rx_skb(struct b44 *
 		if (!dma_mapping_error(mapping))
 			pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE);
 		dev_kfree_skb_any(skb);
-		skb = __dev_alloc_skb(RX_PKT_BUF_SZ,GFP_DMA);
+		skb = __netdev_alloc_skb(bp->dev, RX_PKT_BUF_SZ, GFP_ATOMIC|GFP_DMA);
 		if (skb == NULL)
 			return -ENOMEM;
 		mapping = pci_map_single(bp->pdev, skb->data,
@@ -684,7 +684,6 @@ static int b44_alloc_rx_skb(struct b44 *
 		}
 	}
 
-	skb->dev = bp->dev;
 	rh = (struct rx_header *) skb->data;
 	skb_reserve(skb, RX_PKT_OFFSET);
 

-- 
Stephen Hemminger <shemminger@linux-foundation.org>


  parent reply	other threads:[~2007-06-04 20:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-04 20:25 [PATCH 0/4] b44 driver improvements Stephen Hemminger
2007-06-04 20:25 ` [PATCH 1/4] b44: timer power saving Stephen Hemminger
2007-06-06 19:01   ` Michael Buesch
2007-06-06 21:04     ` Stephen Hemminger
2007-06-07  8:37       ` Michael Buesch
2007-06-13 19:53   ` Jeff Garzik
2007-06-04 20:25 ` [PATCH 2/4] b44: tx bounce sizing Stephen Hemminger
2007-06-04 20:25 ` [PATCH 3/4] b44: packet offset is constant Stephen Hemminger
2007-06-04 20:25 ` Stephen Hemminger [this message]
2007-06-04 21:17 ` [PATCH 0/4] b44 driver improvements Jeff Garzik
2007-06-04 21:17 ` John W. Linville

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070604202712.537466404@linux-foundation.org \
    --to=shemminger@linux-foundation.org \
    --cc=netdev@vger.kernel.org \
    --cc=zambrano@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).