linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
	linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Mika Westerberg <westeri@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>
Subject: [PATCH v1 1/5] gpiolib: acpi: Improve struct acpi_gpio_info memory footprint
Date: Wed,  2 Apr 2025 15:21:16 +0300	[thread overview]
Message-ID: <20250402122301.1517463-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20250402122301.1517463-1-andriy.shevchenko@linux.intel.com>

The struct acpi_gpio_info has two boolean members that are located
not close to each other making two gaps due to alignment requirements.
Group them to improve memory footprint.

`pahole` difference before and after (on 32-bit):

-       /* size: 36, cachelines: 1, members: 9 */
-       /* sum members: 30, holes: 2, sum holes: 6 */

+       /* size: 32, cachelines: 1, members: 9 */
+       /* sum members: 30, holes: 1, sum holes: 2 */

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpiolib-acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 69caa35c58df..878b11c81c7b 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -96,10 +96,10 @@ struct acpi_gpio_chip {
  * @adev: reference to ACPI device which consumes GPIO resource
  * @flags: GPIO initialization flags
  * @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo
+ * @wake_capable: wake capability as provided by ACPI
  * @pin_config: pin bias as provided by ACPI
  * @polarity: interrupt polarity as provided by ACPI
  * @triggering: triggering type as provided by ACPI
- * @wake_capable: wake capability as provided by ACPI
  * @debounce: debounce timeout as provided by ACPI
  * @quirks: Linux specific quirks as provided by struct acpi_gpio_mapping
  */
@@ -107,10 +107,10 @@ struct acpi_gpio_info {
 	struct acpi_device *adev;
 	enum gpiod_flags flags;
 	bool gpioint;
+	bool wake_capable;
 	int pin_config;
 	int polarity;
 	int triggering;
-	bool wake_capable;
 	unsigned int debounce;
 	unsigned int quirks;
 };
-- 
2.47.2


  reply	other threads:[~2025-04-02 12:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-02 12:21 [PATCH v1 0/5] gpiolib: acpi: Refactor to shrink the code by ~8% Andy Shevchenko
2025-04-02 12:21 ` Andy Shevchenko [this message]
2025-04-02 12:21 ` [PATCH v1 2/5] gpiolib: acpi: Remove index parameter from acpi_gpio_property_lookup() Andy Shevchenko
2025-04-02 12:21 ` [PATCH v1 3/5] gpiolib: acpi: Reduce memory footprint for struct acpi_gpio_params Andy Shevchenko
2025-04-02 12:21 ` [PATCH v1 4/5] gpiolib: acpi: Reuse struct acpi_gpio_params in struct acpi_gpio_lookup Andy Shevchenko
2025-04-03 10:35   ` Mika Westerberg
2025-04-03 11:04     ` Andy Shevchenko
2025-04-03 11:57       ` Bartosz Golaszewski
2025-04-03 12:12         ` Andy Shevchenko
2025-04-03 12:38       ` Mika Westerberg
2025-04-02 12:21 ` [PATCH v1 5/5] gpiolib: acpi: Deduplicate some code in __acpi_find_gpio() Andy Shevchenko

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=20250402122301.1517463-2-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=westeri@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).