Re: [PATCH v5 3/5] netdev: ethernet dev_alloc_skb to netdev_alloc_skb

From: Geert Uytterhoeven
Date: Tue Feb 07 2012 - 15:04:12 EST


On Sun, Feb 5, 2012 at 13:50, Pradeep A. Dalvi <netdev@xxxxxxxxxxxxxxxx> wrote:
> diff --git a/drivers/net/ethernet/natsemi/sonic.c b/drivers/net/ethernet/natsemi/sonic.c
> index 26e25d7..0452e296 100644
> --- a/drivers/net/ethernet/natsemi/sonic.c
> +++ b/drivers/net/ethernet/natsemi/sonic.c
> @@ -51,7 +51,7 @@ static int sonic_open(struct net_device *dev)
> Â Â Â Â Â Â Â Âprintk("sonic_open: initializing sonic driver.\n");
>
> Â Â Â Âfor (i = 0; i < SONIC_NUM_RRS; i++) {
> - Â Â Â Â Â Â Â struct sk_buff *skb = dev_alloc_skb(SONIC_RBSIZE + 2);
> + Â Â Â Â Â Â Â struct sk_buff *skb = netdev_alloc_skb(dev, SONIC_RBSIZE + 2);
> Â Â Â Â Â Â Â Âif (skb == NULL) {
> Â Â Â Â Â Â Â Â Â Â Â Âwhile(i > 0) { /* free any that were allocated successfully */
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âi--;
> @@ -422,7 +422,7 @@ static void sonic_rx(struct net_device *dev)
> Â Â Â Â Â Â Â Âstatus = sonic_rda_get(dev, entry, SONIC_RD_STATUS);
> Â Â Â Â Â Â Â Âif (status & SONIC_RCR_PRX) {
> Â Â Â Â Â Â Â Â Â Â Â Â/* Malloc up new buffer. */
> - Â Â Â Â Â Â Â Â Â Â Â new_skb = dev_alloc_skb(SONIC_RBSIZE + 2);
> + Â Â Â Â Â Â Â Â Â Â Â new_skb = netdev_alloc_skb(SONIC_RBSIZE + 2);

drivers/net/ethernet/natsemi/sonic.c:425: error: too few arguments to
function 'netdev_alloc_skb'

cfr. m68k/defconfig http://kisskb.ellerman.id.au/kisskb/buildresult/5583743/

Your search-and-replace script (hmm, you haven't used a script, have
you?) forgot
to add the first "dev" parameter.

> Â Â Â Â Â Â Â Â Â Â Â Âif (new_skb == NULL) {
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âprintk(KERN_ERR "%s: Memory squeeze, dropping packet.\n", dev->name);
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âlp->stats.rx_dropped++;

Gr{oetje,eeting}s,

            Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
             Â Â -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/