From: Vladimir Zapolskiy <vz@mleia.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gpio: reduce descriptor validation code size
Date: Thu, 21 Dec 2017 14:55:06 +0200 [thread overview]
Message-ID: <15498c25-56c6-c914-4cf6-574a45ed696e@mleia.com> (raw)
In-Reply-To: <20171221002704.20824-1-linux@rasmusvillemoes.dk>
Hello Rasmus,
On 12/21/2017 02:27 AM, Rasmus Villemoes wrote:
> While we do need macros to be able to return from the "calling"
> function, we can still factor the checks done by the VALIDATE_DESC*
> macros into a real helper function. This reduces the backslashtitis,
> avoids duplicating the logic in the two macros and saves about 1K of
> generated code:
>
> $ scripts/bloat-o-meter drivers/gpio/gpiolib.o.{0,1}
> add/remove: 1/0 grow/shrink: 0/15 up/down: 104/-1281 (-1177)
> Function old new delta
> validate_desc - 104 +104
> gpiod_set_value 192 135 -57
> gpiod_set_raw_value 125 67 -58
> gpiod_direction_output 412 351 -61
> gpiod_set_value_cansleep 150 70 -80
> gpiod_set_raw_value_cansleep 132 52 -80
> gpiod_get_raw_value 139 54 -85
> gpiod_set_debounce 226 140 -86
> gpiod_direction_output_raw 124 38 -86
> gpiod_get_value 161 74 -87
> gpiod_cansleep 126 39 -87
> gpiod_get_raw_value_cansleep 130 39 -91
> gpiod_get_value_cansleep 152 59 -93
> gpiod_is_active_low 128 33 -95
> gpiod_request 299 184 -115
> gpiod_direction_input 386 266 -120
> Total: Before=25460, After=24283, chg -4.62%
>
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
The change looks good from my point of view, thank you for the change.
Reviewed-by: Vladimir Zapolskiy <vz@mleia.com>
--
With best wishes,
Vladimir
prev parent reply other threads:[~2017-12-21 12:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-21 0:27 Rasmus Villemoes
2017-12-21 12:53 ` Linus Walleij
2017-12-21 12:55 ` Vladimir Zapolskiy [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=15498c25-56c6-c914-4cf6-574a45ed696e@mleia.com \
--to=vz@mleia.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
/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
all inboxes | Powered by JetHome®