[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <889be591-93cc-4e80-bebe-04a6f8f58c70@kernel.org>
Date: Wed, 10 Apr 2024 09:17:28 +0200
From: Jiri Slaby <jirislaby@...nel.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Hugo Villeneuve <hvilleneuve@...onoff.com>
Subject: Re: [PATCH v3 7/8] serial: max3100: Extract to_max3100_port() helper
macro
On 09. 04. 24, 16:45, Andy Shevchenko wrote:
> Instead of using container_of() explicitly, introduce a helper macro.
> This saves a lot of lines of code.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Reviewed-by: Hugo Villeneuve <hvilleneuve@...onoff.com>
..
> @@ -110,6 +111,8 @@ struct max3100_port {
> struct timer_list timer;
> };
>
> +#define to_max3100_port(port) container_of(port, struct max3100_port, port)
This is wrong. If you pass something other than "port" to
to_max3100_port(), the third arg of container_of() will explode.
Use an inline to avoid mistakes like this.
regards,
--
js
suse labs
Powered by blists - more mailing lists