From: William Breathitt Gray <william.gray@linaro.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: linux-iio@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH] counter: Declare counter_priv() to be const
Date: Mon, 24 Jul 2023 11:14:02 -0400 [thread overview]
Message-ID: <ZL6VOpOcJsgJRKt8@fedora> (raw)
In-Reply-To: <20230718162015.3940148-1-u.kleine-koenig@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 2233 bytes --]
On Tue, Jul 18, 2023 at 06:20:15PM +0200, Uwe Kleine-König wrote:
> According to the gcc manual functions "whose return value is not
> affected by changes to the observable state of the program and that have
> no observable effects on such state other than to return a value may
> lend themselves to optimizations such as common subexpression
> elimination. Declaring such functions with the 'const' attribute allows
> GCC to avoid emitting some calls in repeated invocations of the function
> with the same argument values."
>
> counter_priv() is such a function and so can be marked with the const
> function attribute.
>
> The effect for an arm allyesconfig build according to bloat-o-meter (on
> top of v6.5-rc2) is:
>
> add/remove: 0/1 grow/shrink: 2/14 up/down: 524/-1064 (-540)
> Function old new delta
> rz_mtu3_count_enable_write 632 1152 +520
> stm32_count_enable_write 372 376 +4
> ti_eqep_action_read 456 452 -4
> stm32_lptim_cnt_action_write 400 392 -8
> stm32_lptim_cnt_action_read 300 288 -12
> rz_mtu3_count_write 296 284 -12
> rz_mtu3_count_read 304 292 -12
> rz_mtu3_count_function_read 212 200 -12
> rz_mtu3_count_direction_read 268 256 -12
> rz_mtu3_action_read 628 616 -12
> rz_mtu3_count_function_write 328 312 -16
> ecap_cnt_suspend 364 340 -24
> ecap_cnt_resume 300 276 -24
> rz_mtu3_count_ceiling_write 596 560 -36
> rz_mtu3_count_enable_read 332 288 -44
> rz_mtu3_count_ceiling_read 384 340 -44
> rz_mtu3_initialize_counter 792 - -792
> Total: Before=60715, After=60175, chg -0.89%
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Queued for counter-next.
Thanks,
William Breathitt Gray
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2023-07-24 15:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-18 16:20 [PATCH] counter: Declare counter_priv() to be const Uwe Kleine-König
2023-07-24 15:14 ` William Breathitt Gray [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=ZL6VOpOcJsgJRKt8@fedora \
--to=william.gray@linaro.org \
--cc=kernel@pengutronix.de \
--cc=linux-iio@vger.kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
/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