The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
To: Hugo Villeneuve <hugo@hugovil.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Jiri Slaby <jirislaby@kernel.org>,
	Hugo Villeneuve <hvilleneuve@dimonoff.com>,
	 kernel test robot <lkp@intel.com>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH] serial: 8250: fix compile error with hub6_match_port() when compiled as a module
Date: Mon, 20 Jul 2026 12:39:39 +0200	[thread overview]
Message-ID: <al35IBntRNPJNoNw@monoceros> (raw)
In-Reply-To: <20260715153707.4181828-1-hugo@hugovil.com>

[-- Attachment #1: Type: text/plain, Size: 2112 bytes --]

On Wed, Jul 15, 2026 at 11:37:05AM -0400, Hugo Villeneuve wrote:
> From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> 
> With CONFIG_SERIAL_8250_HUB6=m, we have the following compile error:
> 
>   ../drivers/tty/serial/8250/8250_hub6.c:46:6: error: redefinition of
>        'hub6_match_port'
> 
> Fix hub6_match_port() prototype definition by using IS_REACHABLE() to
> support both built-in and module values, and substitute empty prototype
> otherwise.
> 
> Fixes: 3d406299d8829 ("serial: 8250_hub6: add hub6_match_port()")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202607150717.2YxVdWpX-lkp@intel.com/
> Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>

I hit the same problem and fixed it similarly[1] before spotting this
patch.

> ---
>  drivers/tty/serial/8250/8250.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h
> index 9d1068d0489dc..b62f88eec881f 100644
> --- a/drivers/tty/serial/8250/8250.h
> +++ b/drivers/tty/serial/8250/8250.h
> @@ -8,6 +8,7 @@
>   */
>  
>  #include <linux/bits.h>
> +#include <linux/kconfig.h>

This isn't really needed, because the compiler is called with

	-include $(srctree)/include/linux/kconfig.h

which I think you can rely on. But it also doesn't hurt.

>  #include <linux/serial_8250.h>
>  #include <linux/serial_core.h>
>  #include <linux/dmaengine.h>
> @@ -334,7 +335,7 @@ int fintek_8250_probe(struct uart_8250_port *uart);
>  static inline int fintek_8250_probe(struct uart_8250_port *uart) { return 0; }
>  #endif
>  
> -#ifdef CONFIG_SERIAL_8250_HUB6
> +#if IS_REACHABLE(CONFIG_SERIAL_8250_HUB6)

I picked IS_ENABLED(). Both work fine here. (IS_ENABLED() has the slight
(maybe subjective) advantage to break if CONFIG_SERIAL_8250_HUB6 is
enabled but not reachabe (which currently cannot happen).

Anyhow:

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Tested-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2026-07-20 10:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-15 15:37 [PATCH] serial: 8250: fix compile error with hub6_match_port() when compiled as a module Hugo Villeneuve
2026-07-20 10:39 ` Uwe Kleine-König [this message]
2026-07-20 19:09 ` Andy Shevchenko
2026-07-20 19:11   ` Hugo Villeneuve
2026-07-20 19:36     ` Andy Shevchenko

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=al35IBntRNPJNoNw@monoceros \
    --to=u.kleine-koenig@baylibre.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hugo@hugovil.com \
    --cc=hvilleneuve@dimonoff.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=lkp@intel.com \
    /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