From: Greg KH <gregkh@linuxfoundation.org>
To: Hugo Villeneuve <hugo@hugovil.com>
Cc: Jiri Slaby <jirislaby@kernel.org>,
fvallee@eukrea.fr, linux-kernel@vger.kernel.org,
linux-serial@vger.kernel.org,
Hugo Villeneuve <hvilleneuve@dimonoff.com>
Subject: Re: [PATCH 12/15] serial: sc16is7xx: add missing space between macro args (checkpatch)
Date: Thu, 2 Oct 2025 07:24:38 +0200 [thread overview]
Message-ID: <2025100201-snowiness-goggles-4b43@gregkh> (raw)
In-Reply-To: <20251001092920.e6d5ffa046937fc850f1ab6a@hugovil.com>
On Wed, Oct 01, 2025 at 09:29:20AM -0400, Hugo Villeneuve wrote:
> Hi Greg,
>
> On Wed, 1 Oct 2025 07:16:06 +0200
> Greg KH <gregkh@linuxfoundation.org> wrote:
>
> > On Tue, Sep 30, 2025 at 04:08:28PM -0400, Hugo Villeneuve wrote:
> > > Hi Jiri,
> > >
> > > On Mon, 29 Sep 2025 08:15:56 +0200
> > > Jiri Slaby <jirislaby@kernel.org> wrote:
> > >
> > > > On 24. 09. 25, 17:37, Hugo Villeneuve wrote:
> > > > > From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> > > > >
> > > > > Fix the following checkpatch error:
> > > > >
> > > > > ERROR: space required after that ',' (ctx:VxV)
> > > > > +#define to_sc16is7xx_one(p,e)...
> > > > >
> > > > > Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> > > > > ---
> > > > > drivers/tty/serial/sc16is7xx.c | 2 +-
> > > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
> > > > > index a05be92f7e776..9d04d665ec9ab 100644
> > > > > --- a/drivers/tty/serial/sc16is7xx.c
> > > > > +++ b/drivers/tty/serial/sc16is7xx.c
> > > > > @@ -365,7 +365,7 @@ static struct uart_driver sc16is7xx_uart = {
> > > > > .nr = SC16IS7XX_MAX_DEVS,
> > > > > };
> > > > >
> > > > > -#define to_sc16is7xx_one(p,e) ((container_of((p), struct sc16is7xx_one, e)))
> > > > > +#define to_sc16is7xx_one(p, e) ((container_of((p), struct sc16is7xx_one, e)))
> > > >
> > > > Or perhaps make it type-safe and more obvious by switching it to an inline?
> > >
> > > Not easy to do, because this macro is also used with the second
> > > argument "e" not always being used with the same member name. At the
> > > same time, this is what makes this macro more complex than it should
> > > be. I will convert it to an inline and simplify it by removing the
> > > second argument (and of course adapt the code where the new, simpler,
> > > inline function no longer works).
> >
> > Please don't use an inline fuction for container_of() as you will just
> > need to change it later in the future when you really want to use
> > container_of_const() instead :)
>
> Noted. I will simplify the macro and leave it as a macro then.
>
> Would you suggest to also convert container_of to
> container_of_const in this patch series?
For now, no, it's not needed as I do not think this structure is ever
marked as const, is it?
I have a long-term plan to move container_of() to be
container_of_const(), but that's a kernel-wide thing, and not relevant
here. I was just trying to point out that when inlining container_of(),
it can actually cause problems.
thanks,
greg k-h
next prev parent reply other threads:[~2025-10-02 5:24 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-24 15:37 [PATCH 00/15] serial: sc16is7xx: register access fixes and improvements Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 01/15] serial: sc16is7xx: remove useless enable of enhanced features Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 02/15] serial: sc16is7xx: rename LCR macros to better reflect usage Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 03/15] serial: sc16is7xx: rename EFR mutex with generic name Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 04/15] serial: sc16is7xx: define common register access function Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 05/15] serial: sc16is7xx: use guards for simple mutex locks Hugo Villeneuve
2025-09-29 6:09 ` Jiri Slaby
2025-09-30 0:27 ` Hugo Villeneuve
2025-09-30 4:01 ` Jiri Slaby
2025-09-30 13:57 ` Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 06/15] serial: sc16is7xx: use dev_err_probe() instead of dev_err() Hugo Villeneuve
2025-09-29 6:10 ` Jiri Slaby
2025-09-30 0:32 ` Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 07/15] serial: sc16is7xx: declare SPR/TLR/XOFF2 register as volatile Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 08/15] serial: sc16is7xx: move port/channel init to separate function Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 09/15] serial: sc16is7xx: Kconfig: allow building with COMPILE_TEST Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 10/15] serial: sc16is7xx: use KBUILD_MODNAME Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 11/15] serial: sc16is7xx: remove empty line Hugo Villeneuve
2025-09-29 6:14 ` Jiri Slaby
2025-09-30 0:53 ` Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 12/15] serial: sc16is7xx: add missing space between macro args (checkpatch) Hugo Villeneuve
2025-09-29 6:15 ` Jiri Slaby
2025-09-30 20:08 ` Hugo Villeneuve
2025-10-01 5:16 ` Greg KH
2025-10-01 13:29 ` Hugo Villeneuve
2025-10-02 5:24 ` Greg KH [this message]
2025-09-24 15:37 ` [PATCH 13/15] serial: sc16is7xx: change incorrect indentation Hugo Villeneuve
2025-09-26 9:18 ` Maarten Brock
2025-09-26 16:11 ` Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 14/15] serial: sc16is7xx: reformat comments Hugo Villeneuve
2025-09-29 6:18 ` Jiri Slaby
2025-09-30 19:42 ` Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 15/15] serial: sc16is7xx: add/improve comments Hugo Villeneuve
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=2025100201-snowiness-goggles-4b43@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=fvallee@eukrea.fr \
--cc=hugo@hugovil.com \
--cc=hvilleneuve@dimonoff.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.