netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petko Manolov <petkan@mip-labs.com>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Petko Manolov <petkan@nucleusys.com>,
	Oliver Neukum <oneukum@suse.com>,
	Guenter Roeck <linux@roeck-us.net>,
	linux-usb@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] net: pegasus: simplify logical constraint
Date: Thu, 19 May 2016 08:57:55 +0300	[thread overview]
Message-ID: <20160519055755.GE21813@p310> (raw)
In-Reply-To: <1463596851-3581-1-git-send-email-xypron.glpk@gmx.de>

On 16-05-18 20:40:51, Heinrich Schuchardt wrote:
> If !count is true, count < 4 is also true.

Yep, you're right.  However, gcc optimizes away the first condition.  What you 
really got me to think about is whether 4 is the right number.  I guess i shall 
refer to the HW documentation.


		Petko


> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  drivers/net/usb/pegasus.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c
> index 36cd7f0..9bbe0161 100644
> --- a/drivers/net/usb/pegasus.c
> +++ b/drivers/net/usb/pegasus.c
> @@ -473,7 +473,7 @@ static void read_bulk_callback(struct urb *urb)
>  		goto goon;
>  	}
>  
> -	if (!count || count < 4)
> +	if (count < 4)
>  		goto goon;
>  
>  	rx_status = buf[count - 2];
> -- 
> 2.1.4
> 
> 

  reply	other threads:[~2016-05-19  5:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-18  0:13 [PATCH 1/1] net: pegasus: remove dead coding Heinrich Schuchardt
2016-05-18  6:25 ` Petko Manolov
2016-05-18  6:30 ` [1/1] " Guenter Roeck
2016-05-18  7:15   ` Oliver Neukum
2016-05-18  7:50     ` Petko Manolov
2016-05-18 18:40     ` [PATCH 1/1] net: pegasus: simplify logical constraint Heinrich Schuchardt
2016-05-19  5:57       ` Petko Manolov [this message]
2016-05-23 20:49       ` David Miller
2016-05-19 18:35 ` [PATCH 1/1] net: pegasus: remove dead coding David Miller
2016-05-20  7:33   ` Petko Manolov
2016-05-20 16:38     ` 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=20160519055755.GE21813@p310 \
    --to=petkan@mip-labs.com \
    --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=petkan@nucleusys.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).