From: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
To: Juergen Gross <jgross@suse.com>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] xen: selfballoon: remove unnecessary static in frontswap_selfshrink()
Date: Fri, 21 Jul 2017 15:46:46 -0500 [thread overview]
Message-ID: <d60b1758-bd77-202a-067d-07c8f3db578b@embeddedor.com> (raw)
In-Reply-To: <49a2e01f-7f29-6e29-c5d4-6431218a07f1@suse.com>
Hi Juergen,
On 07/21/2017 02:36 AM, Juergen Gross wrote:
> On 04/07/17 20:34, Gustavo A. R. Silva wrote:
>> Remove unnecessary static on local variables last_frontswap_pages and
>> tgt_frontswap_pages. Such variables are initialized before being used,
>> on every execution path throughout the function. The statics have no
>> benefit and, removing them reduce the code size.
>>
>> This issue was detected using Coccinelle and the following semantic patch:
>>
>> @bad exists@
>> position p;
>> identifier x;
>> type T;
>> @@
>>
>> static T x@p;
>> ...
>> x = <+...x...+>
>>
>> @@
>> identifier x;
>> expression e;
>> type T;
>> position p != bad.p;
>> @@
>>
>> -static
>> T x@p;
>> ... when != x
>> when strict
>> ?x = e;
>>
>> You can see a significant difference in the code size after executing
>> the size command, before and after the code change:
>>
>> before:
>> text data bss dec hex filename
>> 5633 3452 384 9469 24fd drivers/xen/xen-selfballoon.o
>>
>> after:
>> text data bss dec hex filename
>> 5576 3308 256 9140 23b4 drivers/xen/xen-selfballoon.o
>>
>> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
>
> Reviewed-by: Juergen Gross <jgross@suse.com>
>
Thank you!
--
Gustavo A. R. Silva
next prev parent reply other threads:[~2017-07-21 20:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-04 18:34 [PATCH] xen: selfballoon: remove unnecessary static in frontswap_selfshrink() Gustavo A. R. Silva
2017-07-21 7:36 ` Juergen Gross
2017-07-21 20:46 ` Gustavo A. R. Silva [this message]
2017-07-28 9:34 ` Juergen Gross
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=d60b1758-bd77-202a-067d-07c8f3db578b@embeddedor.com \
--to=garsilva@embeddedor.com \
--cc=boris.ostrovsky@oracle.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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).