diff mbox series

[v1,1/1] usb: ulpi: Make container_of() no-op in to_ulpi_dev()

Message ID 20230621163122.5693-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted
Commit e6ecc0414c87126836d04b46cce8942e778226bb
Headers show
Series [v1,1/1] usb: ulpi: Make container_of() no-op in to_ulpi_dev() | expand

Commit Message

Andy Shevchenko June 21, 2023, 4:31 p.m. UTC
Move embedded struct device member to make container_of() noop

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/ulpi/driver.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Greg KH June 21, 2023, 7:08 p.m. UTC | #1
On Wed, Jun 21, 2023 at 07:31:22PM +0300, Andy Shevchenko wrote:
> Move embedded struct device member to make container_of() noop
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  include/linux/ulpi/driver.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/ulpi/driver.h b/include/linux/ulpi/driver.h
> index c7a1810373e3..a8cb617a3028 100644
> --- a/include/linux/ulpi/driver.h
> +++ b/include/linux/ulpi/driver.h
> @@ -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
diff mbox series

Patch

diff --git a/include/linux/ulpi/driver.h b/include/linux/ulpi/driver.h
index c7a1810373e3..a8cb617a3028 100644
--- a/include/linux/ulpi/driver.h
+++ b/include/linux/ulpi/driver.h
@@ -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)