From: Stephen Boyd <sboyd@codeaurora.org>
To: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Cc: Michael Turquette <mturquette@baylibre.com>,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] clk: moxart: remove unnecessary statics
Date: Mon, 17 Jul 2017 18:30:26 -0700 [thread overview]
Message-ID: <20170718013026.GR22780@codeaurora.org> (raw)
In-Reply-To: <20170704223650.GA22546@embeddedgus>
On 07/04, Gustavo A. R. Silva wrote:
> Remove unnecessary static on local variable _base_ in both functions
> moxart_of_pll_clk_init() and moxart_of_apb_clk_init(). Such variables
> are initialized before being used, on every execution path throughout
> the mentioned functions. 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;
>
> In the following log you can see the difference in the code size. Also,
> notice that the bss segment is reduced down to zero. This log is the
> output of the size command, before and after the code change:
>
> before:
> text data bss dec hex filename
> 1724 384 128 2236 8bc drivers/clk/clk-moxart.o
>
> after:
> text data bss dec hex filename
> 1697 240 0 1937 791 drivers/clk/clk-moxart.o
>
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
Applied to clk-next
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
prev parent reply other threads:[~2017-07-18 1:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-04 22:36 [PATCH v2] clk: moxart: remove unnecessary statics Gustavo A. R. Silva
2017-07-18 1:30 ` Stephen Boyd [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=20170718013026.GR22780@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=garsilva@embeddedor.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
/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).