lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100111130631.GB5198@verge.net.au>
Date:	Tue, 12 Jan 2010 00:06:31 +1100
From:	Simon Horman <horms@...ge.net.au>
To:	Dan Carpenter <error27@...il.com>, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org, Greg Kroah-Hartman <gregkh@...e.de>,
	Peter Huewe <PeterHuewe@....de>
Subject: Re: [patch 6/6] otus: zfRateCtrlRateDiff(): remove duplicate
 comparison

On Sat, Jan 09, 2010 at 11:44:38AM +0300, Dan Carpenter wrote:
> On Fri, Jan 08, 2010 at 06:57:54PM +1100, horms@...genet.net wrote:
> > I think this is correct.
> > 
> > $ gcc (Debian 4.4.2-8) 4.4.2
> > Copyright (C) 2009 Free Software Foundation, Inc.
> > This is free software; see the source for copying conditions.  There is NO
> > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> > 
> > $ make
> > ...
> > drivers/staging/otus/80211core/ratectrl.c: In function
> > 'zfRateCtrlRateDiff':
> > drivers/staging/otus/80211core/ratectrl.c:433: warning: suggest parentheses
> > around comparison in operand of '=='
> > ...
> > 
> > Signed-off-by: Simon Horman <horms@...ge.net.au>
> > 
> > Index: linux-2.6/drivers/staging/otus/80211core/ratectrl.c
> > ===================================================================
> > --- linux-2.6.orig/drivers/staging/otus/80211core/ratectrl.c	2010-01-08 17:13:44.000000000 +1100
> > +++ linux-2.6/drivers/staging/otus/80211core/ratectrl.c	2010-01-08 17:14:02.000000000 +1100
> > @@ -430,7 +430,7 @@ u8_t zfRateCtrlRateDiff(struct zsRcCell*
> >              {
> >                  return ((rcCell->currentRateIndex - i)+1)>>1;
> >              }
> > -            else if (i == rcCell->currentRateIndex == 0)
> > +            else if (i == rcCell->currentRateIndex)
> 
> You realize you have reversed the meaning of the test?  The original 
> was the same as if (i != rcCell->currentRateIndex).
> 
> Your patch is possibly correct, but it's hard to know.  I would
> leave this for now until someone grovels through the code to find
> out for sure if it should be == or !=.  If we silence the warning,
> no one will ever look at this code again.

Good point, I withdraw this patch.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ