usb: ulpi: Make container_of() no-op in to_ulpi_dev()
PATCH 1/1 usb: ulpi: Make container_of() no-op in to_ulpi_dev()
Move embedded struct device member to make container_of() noop
Signed-off-by Andy Shevchenko <[email protected]>
--- include/linux/ulpi/driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/ulpi/driver.h +1 -1
@@ -15,9 +15,9 @@ struct ulpi_ops;* @dev: device interface */ struct ulpi { +struct device dev;struct ulpi_device_id id;const struct ulpi_ops *ops; -struct device dev; };#define to_ulpi_dev (d) container_of(d, struct ulpi, dev)
Signature · 1 line
2.40.0.1.gaa8946217a0b
Quoted 12 lines · Andy Shevchenko
Move embedded struct device member to make
container_of()noopSigned-off-by Andy Shevchenko <[email protected]>--- include/linux/ulpi/driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/linux/ulpi/driver.h +0
-0
include/linux/ulpi/driver.h struct ulpi_ops; · line 20
Quoted 7 lines
include/linux/ulpi/driver.h +1
-1@@ -15,9 +15,9 @@ struct ulpi_ops;* @dev: device interface */ struct ulpi { +struct device dev;struct ulpi_device_id id;const struct ulpi_ops *ops; -struct device dev;
CPUs don't like doing pointer math anymore? :)
I'll go queue this up, thanks for the micro-optimization.
greg k-h