From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: "Theodore Y. Ts'o" <tytso@mit.edu>,
Andreas Dilger <adilger.kernel@dilger.ca>,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ext4: use swap macro in mext_page_double_lock
Date: Sun, 22 Jul 2018 18:30:53 -0500 [thread overview]
Message-ID: <fc152714-1784-bb0c-5340-db50e63e2044@embeddedor.com> (raw)
In-Reply-To: <20180722221911.GC3358@thunk.org>
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@embeddedor.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
prev parent reply other threads:[~2018-07-22 23:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-09 13:16 [PATCH] ext4: use swap macro in mext_page_double_lock Gustavo A. R. Silva
2018-07-22 22:19 ` Theodore Y. Ts'o
2018-07-22 23:30 ` Gustavo A. R. Silva [this message]
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=fc152714-1784-bb0c-5340-db50e63e2044@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=adilger.kernel@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/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).