All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: Rong Zhang <i@rong.moe>, Jonathan Corbet <corbet@lwn.net>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Nicolas Schier <nsc@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org
Subject: Re: [PATCH] kbuild: install-extmod-build: Add missing python libraries
Date: Thu, 29 Jan 2026 23:40:11 -0700	[thread overview]
Message-ID: <20260130064011.GA2981809@ax162> (raw)
In-Reply-To: <20260130063056.72fbe458@foz.lan>

On Fri, Jan 30, 2026 at 06:30:56AM +0100, Mauro Carvalho Chehab wrote:
> On Thu, 29 Jan 2026 18:11:06 -0700
> Nathan Chancellor <nathan@kernel.org> wrote:
> > On Fri, Jan 30, 2026 at 01:49:55AM +0800, Rong Zhang wrote:
...
> > >   $ make -C /lib/modules/6.19.0-rc6/build/ M="$(pwd)" modules V=1 W=1
> > >   [...]
> > >   make -f /usr/src/linux-headers-6.19.0-rc6/scripts/Makefile.build obj=. need-builtin=1 need-modorder=1
> > >   # CC [M]  mod.o
> > >   [...]
> > >   # cmd_checkdoc mod.o
> > >   PYTHONDONTWRITEBYTECODE=1 python3 /usr/src/linux-headers-6.19.0-rc6/scripts/kernel-doc.py -none mod.c
> 
> This sounds really weird, as it is trying to run scripts/kernel-doc.py
> instead of tools/docs/kernel-doc. Does the out-of-tree Makefile
> override KERNELDOC variable? The current version contains:
> 	
> 	KERNELDOC       = $(srctree)/tools/docs/kernel-doc
> 
> But somehow it is using the old version before the renames:
> 
> 	KERNELDOC       = $(srctree)/scripts/kernel-doc.py

Well I think based on the "6.19.0-rc6" in the path above, this is
mainline, not -next, so the rename has has not happend there yet.

> Btw, I did a very quick test here, using an old OOT project I have
> at github:
> 
> 	https://github.com/mchehab/xr_serial
...
> It sounds to me that Rong may be using a Makefile on his OOT project
> that was not updated to pick the right kernel-doc tool.

If I use that project with Rong's original command, the
linux-upstream-headers package from the pacman-pkg target (which uses
install-extmod-build), and the following fix up for a more modern kernel
version, I see the following error:

  $ make -C /usr/lib/modules/6.19.0-rc7-next-20260129/build M=/tmp/xr_serial modules V=1 W=1
  ...
  # CC [M]  xr_serial.o
    gcc ...
  # cmd_checkdoc xr_serial.o
    PYTHONDONTWRITEBYTECODE=1 python3 /usr/lib/modules/6.19.0-rc7-next-20260129/build/tools/docs/kernel-doc -none   xr_serial.c
  python3: can't open file '/usr/lib/modules/6.19.0-rc7-next-20260129/build/tools/docs/kernel-doc': [Errno 2] No such file or directory
  make[3]: *** [/usr/lib/modules/6.19.0-rc7-next-20260129/build/scripts/Makefile.build:287: xr_serial.o] Error 2

If it is not expected that kernel-doc runs for external modules, then
maybe cmd_checkdoc should also be wrapped in a check for KBUILD_EXTMOD?

Cheers,
Nathan

diff --git a/xr_serial.c b/xr_serial.c
index 63a45a2..d4f7d81 100644
--- a/xr_serial.c
+++ b/xr_serial.c
@@ -517,7 +517,7 @@ static void xr_dtr_rts(struct usb_serial_port *port, int on)
 		xr_tiocmset_port(port, 0, TIOCM_DTR | TIOCM_RTS);
 }
 
-static void xr_break_ctl(struct tty_struct *tty, int break_state)
+static int xr_break_ctl(struct tty_struct *tty, int break_state)
 {
 	struct usb_serial_port *port = tty->driver_data;
 	struct xr_port_private *port_priv = usb_get_serial_data(port->serial);
@@ -526,7 +526,7 @@ static void xr_break_ctl(struct tty_struct *tty, int break_state)
 	if (port_priv->model != XR21V141X) {
 		xr_usb_serial_ctrl_msg(port, USB_CDC_REQ_SEND_BREAK, state,
 				       NULL, 0);
-		return;
+		return 0;
 	}
 
 	if (break_state == 0)
@@ -538,6 +538,7 @@ static void xr_break_ctl(struct tty_struct *tty, int break_state)
 		state == UART_BREAK_OFF ? "off" : "on");
 	xr_set_reg_uart(port, xr_hal_table[port_priv->model][REG_TX_BREAK],
 			state);
+	return 0;
 }
 
 /* Tx and Rx clock mask values obtained from section 3.3.4 of datasheet */
@@ -645,7 +646,7 @@ static int xr_set_baudrate(struct tty_struct *tty,
 
 static void xr_set_flow_mode(struct tty_struct *tty,
 			     struct usb_serial_port *port,
-			     struct ktermios *old_termios)
+			     const struct ktermios *old_termios)
 {
 	struct xr_port_private *port_priv = usb_get_serial_data(port->serial);
 	u8 flow, gpio_mode;
@@ -701,7 +702,7 @@ static void xr_set_flow_mode(struct tty_struct *tty,
 
 static void xr_set_termios_cdc(struct tty_struct *tty,
 			       struct usb_serial_port *port,
-			       struct ktermios *old_termios)
+			       const struct ktermios *old_termios)
 {
 	struct ktermios *termios = &tty->termios;
 	struct usb_cdc_line_coding line = { 0 };
@@ -747,7 +748,7 @@ static void xr_set_termios_cdc(struct tty_struct *tty,
 
 static void xr_set_termios_format_reg(struct tty_struct *tty,
 				      struct usb_serial_port *port,
-				      struct ktermios *old_termios)
+				      const struct ktermios *old_termios)
 {
 	struct xr_port_private *port_priv = usb_get_serial_data(port->serial);
 	struct ktermios *termios = &tty->termios;
@@ -805,7 +806,7 @@ static void xr_set_termios_format_reg(struct tty_struct *tty,
 
 static void xr_set_termios(struct tty_struct *tty,
 			   struct usb_serial_port *port,
-			   struct ktermios *old_termios)
+			   const struct ktermios *old_termios)
 {
 	struct xr_port_private *port_priv = usb_get_serial_data(port->serial);
 

  reply	other threads:[~2026-01-30  6:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29 17:49 [PATCH] kbuild: install-extmod-build: Add missing python libraries Rong Zhang
2026-01-30  1:11 ` Nathan Chancellor
2026-01-30  5:30   ` Mauro Carvalho Chehab
2026-01-30  6:40     ` Nathan Chancellor [this message]
2026-01-30  8:32       ` Mauro Carvalho Chehab
2026-01-31 15:08         ` Nicolas Schier

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=20260130064011.GA2981809@ax162 \
    --to=nathan@kernel.org \
    --cc=corbet@lwn.net \
    --cc=i@rong.moe \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=mchehab@kernel.org \
    --cc=nsc@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.