From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753026AbcESF5u (ORCPT ); Thu, 19 May 2016 01:57:50 -0400 Received: from lan.nucleusys.com ([92.247.61.126]:45198 "EHLO zztop.nucleusys.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751362AbcESF5r (ORCPT ); Thu, 19 May 2016 01:57:47 -0400 Date: Thu, 19 May 2016 08:57:55 +0300 From: Petko Manolov To: Heinrich Schuchardt Cc: Petko Manolov , Oliver Neukum , Guenter Roeck , linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] net: pegasus: simplify logical constraint Message-ID: <20160519055755.GE21813@p310> References: <1463555740.22748.0.camel@suse.com> <1463596851-3581-1-git-send-email-xypron.glpk@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1463596851-3581-1-git-send-email-xypron.glpk@gmx.de> User-Agent: Mutt/1.6.0 (2016-04-01) X-Spam-Score: -1.0 (-) X-Spam-Report: Spam detection software, running on the system "zztop.nucleusys.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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. [...] Content analysis details: (-1.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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 > >