netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: sonic.adi@gmail.com
Cc: netdev@vger.kernel.org, uclinux-dist-devel@blackfin.uclinux.org
Subject: Re: [PATCH] netdev:bfin_mac: reclaim and free tx skb as soon as possible after transfer
Date: Wed, 02 Jun 2010 07:02:33 -0700 (PDT)	[thread overview]
Message-ID: <20100602.070233.37574714.davem@davemloft.net> (raw)
In-Reply-To: <1275383974.1010.5.camel@eight.analog.com>

From: sonic zhang <sonic.adi@gmail.com>
Date: Tue, 1 Jun 2010 17:19:34 +0800

> @@ -1485,6 +1506,10 @@ static int __devinit bfin_mac_probe(struct platform_device *pdev)
>  	ndev->netdev_ops = &bfin_mac_netdev_ops;
>  	ndev->ethtool_ops = &bfin_mac_ethtool_ops;
>  
> +	init_timer(&lp->tx_reclaim_timer);
> +	lp->tx_reclaim_timer.data = (unsigned long)(lp);

Putting parenthesis around "lp" is excessive, please don't do this.

> +	lp->tx_reclaim_timer.function = (void *)tx_reclaim_skb;
> +
>  	spin_lock_init(&lp->lock);

Do not cast the function pointer to "void *" like this, it's ugly and entirely
not necessary.

Instead have a wrapper function that uses the correct types as specified
for timer functions, that calls the existing function.

  reply	other threads:[~2010-06-02 14:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-01  9:19 [PATCH] netdev:bfin_mac: reclaim and free tx skb as soon as possible after transfer sonic zhang
2010-06-02 14:02 ` David Miller [this message]
2010-06-03  3:21   ` Sonic Zhang

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=20100602.070233.37574714.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=sonic.adi@gmail.com \
    --cc=uclinux-dist-devel@blackfin.uclinux.org \
    /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).