netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petko Manolov <petkan@mip-labs.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "David S. Miller" <davem@davemloft.net>,
	"xypron.glpk@gmx.de" <xypron.glpk@gmx.de>,
	linux-usb@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, oneukum@suse.com,
	linux@roeck-us.net
Subject: Re: [PATCH] net: pegasus: remove unused variables and labels
Date: Fri, 20 May 2016 12:32:23 +0300	[thread overview]
Message-ID: <20160520093223.GJ21813@p310> (raw)
In-Reply-To: <1463732595-3149399-1-git-send-email-arnd@arndb.de>

Guys, come on.  This code is not dead.  This code is executed every time an 
ethernet packet is received.  It takes care of various error statistics. More 
importantly, it sends the actual (reported by the adapter) packet length to the 
network layer along with the packet.

This patch removes skb_put() and netif_rx() calls and effectively kills the RX 
path.  Not to mention that the driver was not even compiled before sending the 
patch upstream.

The only sensible, although cosmetic, change would be to replace:

	if (!count || count < 4)

with

	if (count < 4)

even though GCC takes care and it optimizes away "!count" condition.

Please revert this patch before Linus pulls from the network tree.


		Petko



On 16-05-20 10:22:30, Arnd Bergmann wrote:
> The latest dead-code removal was slightly incomplete and
> left a few things behind that we now get compiler warnings
> for:
> 
> drivers/net/usb/pegasus.c: In function 'read_bulk_callback':
> drivers/net/usb/pegasus.c:475:1: error: label 'goon' defined but not used [-Werror=unused-label]
> drivers/net/usb/pegasus.c:446:8: error: unused variable 'pkt_len' [-Werror=unused-variable]
> drivers/net/usb/pegasus.c:445:6: error: unused variable 'buf' [-Werror=unused-variable]
> drivers/net/usb/pegasus.c:443:17: error: unused variable 'count' [-Werror=unused-variable]
> 
> This removes them as well.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: e00be9e4d0ff ("net: pegasus: remove dead coding")
> ---
>  drivers/net/usb/pegasus.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c
> index 1903d2e2b62d..df6d90ab7ca7 100644
> --- a/drivers/net/usb/pegasus.c
> +++ b/drivers/net/usb/pegasus.c
> @@ -440,10 +440,8 @@ static void read_bulk_callback(struct urb *urb)
>  {
>  	pegasus_t *pegasus = urb->context;
>  	struct net_device *net;
> -	int rx_status, count = urb->actual_length;
> +	int rx_status;
>  	int status = urb->status;
> -	u8 *buf = urb->transfer_buffer;
> -	__u16 pkt_len;
>  
>  	if (!pegasus)
>  		return;
> @@ -472,7 +470,6 @@ static void read_bulk_callback(struct urb *urb)
>  		netif_dbg(pegasus, rx_err, net, "RX status %d\n", status);
>  	}
>  
> -goon:
>  	usb_fill_bulk_urb(pegasus->rx_urb, pegasus->usb,
>  			  usb_rcvbulkpipe(pegasus->usb, 1),
>  			  pegasus->rx_skb->data, PEGASUS_MTU,
> -- 
> 2.7.0
> 
> 

  reply	other threads:[~2016-05-20  9:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-20  8:22 [PATCH] net: pegasus: remove unused variables and labels Arnd Bergmann
2016-05-20  9:32 ` Petko Manolov [this message]
2016-05-20  9:58   ` Arnd Bergmann
2016-05-20 16:40 ` David Miller

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=20160520093223.GJ21813@p310 \
    --to=petkan@mip-labs.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=netdev@vger.kernel.org \
    --cc=oneukum@suse.com \
    --cc=xypron.glpk@gmx.de \
    /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).