All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: "'Hayes Wang'" <hayeswang@realtek.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: "nic_swsd@realtek.com" <nic_swsd@realtek.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: RE: [PATCH net-next] r8152: simply the arguments
Date: Thu, 16 Mar 2017 14:28:07 +0000	[thread overview]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6DCFFB29DA@AcuExch.aculab.com> (raw)
In-Reply-To: <1394712342-15778-253-Taiwan-albertk@realtek.com>

From: Hayes Wang
> Sent: 16 March 2017 06:28
> Replace &tp->napi with napi and tp->netdev with netdev.
> 
> Signed-off-by: Hayes Wang <hayeswang@realtek.com>
> ---
>  drivers/net/usb/r8152.c | 44 +++++++++++++++++++++++++++-----------------
>  1 file changed, 27 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index 227e1fd..e480e9f 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
> @@ -1761,6 +1761,7 @@ static int rx_bottom(struct r8152 *tp, int budget)
>  	unsigned long flags;
>  	struct list_head *cursor, *next, rx_queue;
>  	int ret = 0, work_done = 0;
> +	struct napi_struct *napi = &tp->napi;
> 
>  	if (!skb_queue_empty(&tp->rx_queue)) {
>  		while (work_done < budget) {
> @@ -1773,7 +1774,7 @@ static int rx_bottom(struct r8152 *tp, int budget)
>  				break;
> 
>  			pkt_len = skb->len;
> -			napi_gro_receive(&tp->napi, skb);
> +			napi_gro_receive(napi, skb);
...

I'm not sure this makes the code any more readable.
It isn't even needed to shorten any long lines.

If you are really lucky the compiler will optimise it away.
Otherwise it will generate another local variable and possibly
a register spill to stack.

	David
 

  parent reply	other threads:[~2017-03-16 14:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16  6:27 [PATCH net-next] r8152: simply the arguments Hayes Wang
2017-03-16  6:32 ` [PATCH v2 " Hayes Wang
2017-03-16 17:14   ` David Miller
2017-03-16 17:14     ` David Miller
2017-03-16 14:28 ` David Laight [this message]
2017-03-17  2:59   ` [PATCH " Hayes Wang
2017-03-17 11:08     ` David Laight

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=063D6719AE5E284EB5DD2968C1650D6DCFFB29DA@AcuExch.aculab.com \
    --to=david.laight@aculab.com \
    --cc=hayeswang@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.