Skip to contentSkip to conversation

vt: Escape the CUR_ prefix in the cursor kernel-doc

PATCH New TAKANO Mitsuhiro 2 participants 2 messages Nov 25 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vt: Escape the CUR_ prefix in the cursor kernel-doc

A trailing underscore is how reST writes a link to a target, so CUR_ in the prose is read as a reference to a target named "cur" and the build fails for the three cursor helpers:

drivers/tty/vt/vt.c:276: ERROR: Unknown target name: "cur"

The same line appears in vc_cursor_start() and vc_cursor_end(). Wrap the prefix in double backticks, which is how the rest of the kernel marks a literal, and all three render without an error.

Verification: before the change, each of

  $ ./scripts/kernel-doc -rst -function vc_cursor_valid_size \
        drivers/tty/vt/vt.c > x.rst
  $ rst2pseudoxml x.rst

reports "Unknown target name: \"cur\"" once, and vc_cursor_start and vc_cursor_end do the same; after it, none of the three reports anything. kernel-doc -none on the file is silent both ways.

---
 drivers/tty/vt/vt.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/tty/vt/vt.c +5 -5
index 6a6eb8b2a6de..14b7214ec105 100644
@@ -273,9 +273,9 @@ EXPORT_SYMBOL_GPL(vc_font_size);
  * vc_cursor_valid_size - Computes a valid cursor size from the given value
  * @cursor_size: The size constant of cursor pattern
  *
- * The argument given in @cursor_size is one of the CUR_ constants, as stored
- * in struct @vc_data.vc_cursor_type. For unknown values, the helper draws the
- * default cursor or an underline dash.
+ * The argument given in @cursor_size is one of the ``CUR_`` constants, as
+ * stored in struct @vc_data.vc_cursor_type. For unknown values, the helper
+ * draws the default cursor or an underline dash.
  *
  * Returns:
  * A valid cursor size for the given size value
@@ -317,7 +317,7 @@ EXPORT_SYMBOL_GPL(vc_cursor_valid_size);
  *
  * The parameter @cell_height is the height of the character cell as
  * displayed by the console. The argument given in @cursor_size is one
- * of the CUR_ constants. See vc_cursor_valid_size() for how to get a
+ * of the ``CUR_`` constants. See vc_cursor_valid_size() for how to get a
  * valid cursor-size constant.
  *
  * Returns:
@@ -353,7 +353,7 @@ EXPORT_SYMBOL_GPL(vc_cursor_start);
  *
  * The parameter @cell_height is the height of the character cell as
  * displayed by the console. The argument given in @cursor_size is one
- * of the CUR_ constants. See vc_cursor_valid_size() for how to get a
+ * of the ``CUR_`` constants. See vc_cursor_valid_size() for how to get a
  * valid cursor-size constant.
  *
  * Returns:

base-commit: b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f

Signature · 1 line
2.53.0
#1 lore raw
Sashiko has reviewed this patch and found no issues.
Quoted 16 lines

A trailing underscore is how reST writes a link to a target, so CUR_ in the prose is read as a reference to a target named "cur" and the build fails for the three cursor helpers:

drivers/tty/vt/vt.c:276: ERROR: Unknown target name: "cur"

The same line appears in vc_cursor_start() and vc_cursor_end(). Wrap the prefix in double backticks, which is how the rest of the kernel marks a literal, and all three render without an error.

Verification: before the change, each of

  $ ./scripts/kernel-doc -rst -function vc_cursor_valid_size \
        drivers/tty/vt/vt.c > x.rst
  $ rst2pseudoxml x.rst
Quoted 5 lines

reports "Unknown target name: \"cur\"" once, and vc_cursor_start and vc_cursor_end do the same; after it, none of the three reports anything. kernel-doc -none on the file is silent both ways.

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1