]> www.infradead.org Git - users/hch/misc.git/commit
gpiolib: acpi: Reduce memory footprint for struct acpi_gpio_params
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 3 Apr 2025 15:59:14 +0000 (18:59 +0300)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 7 Apr 2025 06:38:39 +0000 (09:38 +0300)
commit1be1cd03a93339f14c8f4fe300bca321fddc6478
treee0b9d7256b37a3565fbf789d82163cf033abef74
parentd5ab616eb89659ef8f5c3a94eaf444992e34a2cd
gpiolib: acpi: Reduce memory footprint for struct acpi_gpio_params

The line_index member in the struct acpi_gpio_params replicates
what is covered in the ACPI GpioIo() or GpioInt() resource.
The value there is limited to 16-bit one, so we don't really need
to have a full 32-bit storage for it. Together with followed
boolean the structure will be smaller.

add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-3 (-3)
Function                                     old     new   delta
acpi_gpio_property_lookup                    417     414      -3
Total: Before=15361, After=15358, chg -0.02%

`pahole` difference before and after:

- /* size: 12, cachelines: 1, members: 3 */
- /* padding: 3 */

+ /* size: 8, cachelines: 1, members: 3 */
+ /* padding: 1 */

Acked-by: Mika Westerberg <westeri@kernel.org>
Link: https://lore.kernel.org/r/20250403160034.2680485-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
include/linux/gpio/consumer.h