* [PATCH v1 1/1] usb: ulpi: Make container_of() no-op in to_ulpi_dev()
@ 2023-06-21 16:31 Andy Shevchenko
2023-06-21 19:08 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2023-06-21 16:31 UTC (permalink / raw)
To: Andy Shevchenko, linux-usb, linux-kernel; +Cc: Heikki Krogerus
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;
};
#define to_ulpi_dev(d) container_of(d, struct ulpi, dev)
--
2.40.0.1.gaa8946217a0b
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1 1/1] usb: ulpi: Make container_of() no-op in to_ulpi_dev()
2023-06-21 16:31 [PATCH v1 1/1] usb: ulpi: Make container_of() no-op in to_ulpi_dev() Andy Shevchenko
@ 2023-06-21 19:08 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2023-06-21 19:08 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: linux-usb, linux-kernel, Heikki Krogerus
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-21 19:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-21 16:31 [PATCH v1 1/1] usb: ulpi: Make container_of() no-op in to_ulpi_dev() Andy Shevchenko
2023-06-21 19:08 ` Greg KH
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).