From: Juergen Gross <jgross@suse.com>
To: "Gustavo A. R. Silva" <garsilva@embeddedor.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 09:36:18 +0200 [thread overview]
Message-ID: <49a2e01f-7f29-6e29-c5d4-6431218a07f1@suse.com> (raw)
In-Reply-To: <20170704183404.GA13813@embeddedgus>
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>
Sorry for late answer,
Juergen
next prev parent reply other threads:[~2017-07-21 7:36 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 [this message]
2017-07-21 20:46 ` Gustavo A. R. Silva
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=49a2e01f-7f29-6e29-c5d4-6431218a07f1@suse.com \
--to=jgross@suse.com \
--cc=boris.ostrovsky@oracle.com \
--cc=garsilva@embeddedor.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).