From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-serial <linux-serial@vger.kernel.org>,
Jiri Slaby <jirislaby@kernel.org>
Subject: Re: [PATCH v1 1/1] serial: max3100: Convert to_max3100_port() to be static inline
Date: Thu, 11 Apr 2024 14:20:29 +0300 (EEST) [thread overview]
Message-ID: <0efff014-43a2-b1e2-6690-515a6b2a3edd@linux.intel.com> (raw)
In-Reply-To: <20240410141135.1378948-1-andriy.shevchenko@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1304 bytes --]
On Wed, 10 Apr 2024, Andy Shevchenko wrote:
> As Jiri rightfully pointed out the current to_max3100_port() macro
> implementation is fragile in a sense that it expects the variable
> name to be port, otherwise it blow up the build.
>
> Change this to be static inline to prevent bad compilation.
>
> Suggested-by: Jiri Slaby <jirislaby@kernel.org>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/tty/serial/max3100.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c
> index 1e6b5763ce3f..07ee001640bb 100644
> --- a/drivers/tty/serial/max3100.c
> +++ b/drivers/tty/serial/max3100.c
> @@ -111,7 +111,10 @@ struct max3100_port {
> struct timer_list timer;
> };
>
> -#define to_max3100_port(port) container_of(port, struct max3100_port, port)
> +static inline struct max3100_port *to_max3100_port(struct uart_port *port)
> +{
> + return container_of(port, struct max3100_port, port);
> +}
>
> static struct max3100_port *max3100s[MAX_MAX3100]; /* the chips */
> static DEFINE_MUTEX(max3100s_lock); /* race on probe */
>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
It seems liteuart has the same trap.
--
i.
prev parent reply other threads:[~2024-04-11 11:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-10 14:11 [PATCH v1 1/1] serial: max3100: Convert to_max3100_port() to be static inline Andy Shevchenko
2024-04-10 14:20 ` Greg Kroah-Hartman
2024-04-10 14:22 ` Andy Shevchenko
2024-04-11 11:20 ` Ilpo Järvinen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0efff014-43a2-b1e2-6690-515a6b2a3edd@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).