Skip to content

gpiolib: acpi: Refactor to shrink the code by ~8%

Andy Shevchenko linux-acpi linux-gpio lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 6 repliesIn review
  2. v15 patches 5 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6gpiolib: acpi: Improve struct acpi_gpio_info memory footprintdrivers/gpio/gpiolib-acpi.c+2 -20 replies
2/6gpiolib: acpi: Remove index parameter from acpi_gpio_property_lookup()drivers/gpio/gpiolib-acpi.c+6 -70 replies
3/6gpiolib: acpi: Reduce memory footprint for struct acpi_gpio_paramsinclude/linux/gpio/consumer.h+1 -10 replies
4/6gpiolib: acpi: Rename par to params for better readabilitydrivers/gpio/gpiolib-acpi.c+4 -40 replies
5/6gpiolib: acpi: Reuse struct acpi_gpio_params in struct acpi_gpio_lookupdrivers/gpio/gpiolib-acpi.c+19 -170 replies
6/6gpiolib: acpi: Deduplicate some code in __acpi_find_gpio()drivers/gpio/gpiolib-acpi.c+48 -532 replies

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchBartosz GolaszewskiMika Westerberg
SeriesA-b
1/6
2/6
3/6
4/6Requested-by
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/6] gpiolib: acpi: Refactor to shrink the code by ~8%

A simple refactoring of the GPIO ACPI library parts to get an impressive ~8% code shrink on x86_64 and ~2% on x86_32. Also reduces a C code a bit.

add/remove: 0/2 grow/shrink: 0/5 up/down: 0/-1221 (-1221)

Function                                     old     new   delta
acpi_gpio_property_lookup                    425     414     -11
acpi_find_gpio.__UNIQUE_ID_ddebug478          56       -     -56
acpi_dev_gpio_irq_wake_get_by.__UNIQUE_ID_ddebug480      56       -     -56
acpi_find_gpio                               354     216    -138
acpi_get_gpiod_by_index                      462     307    -155
__acpi_find_gpio                             877     638    -239
acpi_dev_gpio_irq_wake_get_by                695     129    -566

Total: Before=15375, After=14154, chg -7.94%

In v2:
- renamed par to params (Mika, Bart)

Andy Shevchenko (6):
gpiolib: acpi: Improve struct acpi_gpio_info memory footprint
gpiolib: acpi: Remove index parameter from acpi_gpio_property_lookup()
gpiolib: acpi: Reduce memory footprint for struct acpi_gpio_params
gpiolib: acpi: Rename par to params for better readability
gpiolib: acpi: Reuse struct acpi_gpio_params in struct
acpi_gpio_lookup
gpiolib: acpi: Deduplicate some code in __acpi_find_gpio()

 drivers/gpio/gpiolib-acpi.c   | 146 +++++++++++++++++-----------------
 include/linux/gpio/consumer.h |   2 +-
 2 files changed, 72 insertions(+), 76 deletions(-)
Signature · 1 line
2.47.2