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]
Message-ID: <1ec3c66b-9bd2-978d-250e-369a7cea13c8@suse.com>
Date:   Fri, 28 Jul 2017 11:34:24 +0200
From:   Juergen Gross <jgross@...e.com>
To:     "Gustavo A. R. Silva" <garsilva@...eddedor.com>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>
Cc:     xen-devel@...ts.xenproject.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] xen: selfballoon: remove unnecessary static in
 frontswap_selfshrink()

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@...eddedor.com>

Committed to xen/tip.git for-linus-4.13b


Thanks,

Juergen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ