diff options
author | Gustavo A. R. Silva <garsilva@embeddedor.com> | 2017-07-04 13:34:05 -0500 |
---|---|---|
committer | Juergen Gross <jgross@suse.com> | 2017-07-27 19:55:41 +0200 |
commit | 039937308e55fba152a40e5d729a43731f56acab (patch) | |
tree | c338e3c2d7002a69552aa3d5992078450ea56608 /security/tomoyo | |
parent | d02ca074f63ba562cc0786121e92e38c59e6d97f (diff) |
xen: selfballoon: remove unnecessary static in frontswap_selfshrink()
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>
Signed-off-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to 'security/tomoyo')
0 files changed, 0 insertions, 0 deletions