Skip to content

Commit 1be1cd0

Browse files
committed
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Andy Shevchenko <[email protected]>
1 parent d5ab616 commit 1be1cd0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/gpio/consumer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ struct gpio_desc *devm_fwnode_gpiod_get(struct device *dev,
587587

588588
struct acpi_gpio_params {
589589
unsigned int crs_entry_index;
590-
unsigned int line_index;
590+
unsigned short line_index;
591591
bool active_low;
592592
};
593593

0 commit comments

Comments
 (0)