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: <CAE_Gge1cGbeV93bzF_1Vo9S-3QtxtASSD1Mzt_ULcPux41Aa-w@mail.gmail.com>
Date:	Thu, 17 Sep 2015 01:06:33 -0400
From:	Raphaƫl Beamonte <raphael.beamonte@...il.com>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	Cristina Opriceana <cristina.opriceana@...il.com>,
	devel@...verdev.osuosl.org, lkml <linux-kernel@...r.kernel.org>,
	Dan Carpenter <dan.carpenter@...cle.com>
Subject: Re: [PATCHv2 03/16] staging: rtl8192u: r8192U_core: add temporary
 variables to keep lines under 80 characters

2015-09-17 0:57 GMT-04:00 Greg Kroah-Hartman <gregkh@...uxfoundation.org>:
<SNIP>
>> @@ -1748,8 +1755,9 @@ static short rtl8192_usb_initendpoints(struct net_device *dev)
>>               oldaddr = priv->oldaddr;
>>               align = ((long)oldaddr) & 3;
>>               if (align) {
>> -                     newaddr = oldaddr + 4 - align;
>> -                     priv->rx_urb[16]->transfer_buffer_length = 16 - 4 + align;
>> +                     align = 4 - align;
>> +                     newaddr = oldaddr + align;
>> +                     priv->rx_urb[16]->transfer_buffer_length = 16 - align;
>
> At a quick glance, this conversion looks wrong...

What is wrong with it?

oldaddr + 4 - align;
can also be read:
oldaddr + (4 - align);

as well as
16 - 4 + align;
can also be read
16 - (4 - align);
as when we remove the parenthesis, the - sign invert the parenthesis
elements signs.

Calculating (4 - align) previously thus preserve the logic here!

> And it's not what your changelog text said you were doing :(

It's true that I didn't add a new temporary variable here but instead
re-used one that is not used after, but I thought it went in the same
idea as the rest of this patch. Should I separate that as another
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