2023-10-25 11:19:05

by Wilczynski, Michal

[permalink] [raw]
Subject: [PATCH v1 6/6] ACPI: acpi_video: Fix holes in acpi_video_bus

As identified by 'pahole' utility there are holes in acpi_video_bus
struct. Rearrange elements to get rid of the holes. Put elements
biggest in size first, and one-byte elements later.

Signed-off-by: Michal Wilczynski <[email protected]>
---
drivers/acpi/acpi_video.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c
index bfc7f51a527d..1e10d5b748b2 100644
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -155,19 +155,19 @@ struct acpi_video_enumerated_device {

struct acpi_video_bus {
struct acpi_device *device;
+ struct acpi_video_enumerated_device *attached_array;
+ struct list_head video_device_list;
+ struct mutex device_list_lock; /* protects video_device_list */
+ struct list_head entry;
+ struct input_dev *input;
+ struct notifier_block pm_nb;
bool backlight_registered;
u8 dos_setting;
- struct acpi_video_enumerated_device *attached_array;
u8 attached_count;
u8 child_count;
struct acpi_video_bus_cap cap;
struct acpi_video_bus_flags flags;
- struct list_head video_device_list;
- struct mutex device_list_lock; /* protects video_device_list */
- struct list_head entry;
- struct input_dev *input;
char phys[32]; /* for input device */
- struct notifier_block pm_nb;
};

struct acpi_video_device_flags {
--
2.41.0


2023-10-26 12:26:34

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v1 6/6] ACPI: acpi_video: Fix holes in acpi_video_bus

On Wed, Oct 25, 2023 at 02:18:06PM +0300, Michal Wilczynski wrote:
> As identified by 'pahole' utility there are holes in acpi_video_bus
> struct. Rearrange elements to get rid of the holes. Put elements
> biggest in size first, and one-byte elements later.

How does this affect the code generation (e.g., measured by bloat-o-meter)?

--
With Best Regards,
Andy Shevchenko