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] [day] [month] [year] [list]
Date:   Sun, 22 Jul 2018 18:30:53 -0500
From:   "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To:     "Theodore Y. Ts'o" <tytso@....edu>,
        Andreas Dilger <adilger.kernel@...ger.ca>,
        linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ext4: use swap macro in mext_page_double_lock

Hi Theodore,

On 07/22/2018 05:19 PM, Theodore Y. Ts'o wrote:
> On Mon, Jul 09, 2018 at 08:16:00AM -0500, Gustavo A. R. Silva wrote:
>> Make use of the swap macro and remove unnecessary variable *tmp*.
>> This makes the code easier to read and maintain. Also, reduces the
>> stack usage.
>>
>> This code was detected with the help of Coccinelle.
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>
> 
> It doesn't actually reduce stack usage.  Look at the definition of
> swap() in include/linux/kernel.h:
> 
> #define swap(a, b) \
> 	do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
> 
> It removes the variable "tmp", and replace it with "__tmp".
> 
> It slightly reduces the number of lines of code, so it slightly makes
> the code easier to maintainer.  But I think you are really
> over-promising how much this commit helps.
> 
I'll remove that part from the changelog and send it again.

Thanks
--
Gustavo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ