mirror of
https://github.com/torvalds/linux
synced 2024-10-15 07:47:34 +00:00
ACPI: bus: Make container_of() no-op where it makes sense
Move list head node to be the first member in a few data structures in order to make container_of() no-op at compile time. On x86_64 with a custom (default + a few dozens of drivers enabled) configuration: add/remove: 0/0 grow/shrink: 5/12 up/down: 21/-124 (-103) ... Total: Before=39924675, After=39924572, chg -0.00% Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
39cd87c4eb
commit
32666d9cb3
|
@ -124,8 +124,8 @@ static inline struct acpi_hotplug_profile *to_acpi_hotplug_profile(
|
||||||
}
|
}
|
||||||
|
|
||||||
struct acpi_scan_handler {
|
struct acpi_scan_handler {
|
||||||
const struct acpi_device_id *ids;
|
|
||||||
struct list_head list_node;
|
struct list_head list_node;
|
||||||
|
const struct acpi_device_id *ids;
|
||||||
bool (*match)(const char *idstr, const struct acpi_device_id **matchid);
|
bool (*match)(const char *idstr, const struct acpi_device_id **matchid);
|
||||||
int (*attach)(struct acpi_device *dev, const struct acpi_device_id *id);
|
int (*attach)(struct acpi_device *dev, const struct acpi_device_id *id);
|
||||||
void (*detach)(struct acpi_device *dev);
|
void (*detach)(struct acpi_device *dev);
|
||||||
|
@ -269,6 +269,7 @@ struct acpi_device_power_flags {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct acpi_device_power_state {
|
struct acpi_device_power_state {
|
||||||
|
struct list_head resources; /* Power resources referenced */
|
||||||
struct {
|
struct {
|
||||||
u8 valid:1;
|
u8 valid:1;
|
||||||
u8 explicit_set:1; /* _PSx present? */
|
u8 explicit_set:1; /* _PSx present? */
|
||||||
|
@ -276,7 +277,6 @@ struct acpi_device_power_state {
|
||||||
} flags;
|
} flags;
|
||||||
int power; /* % Power (compared to D0) */
|
int power; /* % Power (compared to D0) */
|
||||||
int latency; /* Dx->D0 time (microseconds) */
|
int latency; /* Dx->D0 time (microseconds) */
|
||||||
struct list_head resources; /* Power resources referenced */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct acpi_device_power {
|
struct acpi_device_power {
|
||||||
|
@ -342,16 +342,16 @@ struct acpi_device_wakeup {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct acpi_device_physical_node {
|
struct acpi_device_physical_node {
|
||||||
unsigned int node_id;
|
|
||||||
struct list_head node;
|
struct list_head node;
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
|
unsigned int node_id;
|
||||||
bool put_online:1;
|
bool put_online:1;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct acpi_device_properties {
|
struct acpi_device_properties {
|
||||||
|
struct list_head list;
|
||||||
const guid_t *guid;
|
const guid_t *guid;
|
||||||
union acpi_object *properties;
|
union acpi_object *properties;
|
||||||
struct list_head list;
|
|
||||||
void **bufs;
|
void **bufs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -488,12 +488,12 @@ struct acpi_device {
|
||||||
|
|
||||||
/* Non-device subnode */
|
/* Non-device subnode */
|
||||||
struct acpi_data_node {
|
struct acpi_data_node {
|
||||||
|
struct list_head sibling;
|
||||||
const char *name;
|
const char *name;
|
||||||
acpi_handle handle;
|
acpi_handle handle;
|
||||||
struct fwnode_handle fwnode;
|
struct fwnode_handle fwnode;
|
||||||
struct fwnode_handle *parent;
|
struct fwnode_handle *parent;
|
||||||
struct acpi_device_data data;
|
struct acpi_device_data data;
|
||||||
struct list_head sibling;
|
|
||||||
struct kobject kobj;
|
struct kobject kobj;
|
||||||
struct completion kobj_done;
|
struct completion kobj_done;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue