Skip to contentSkip to conversation

docs: escape literal asterisk to fix reST emphasis warning

PATCH In review Khaled Elnaggar 4 participants 6 messages May 26, 2025 – Jun 5, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs: escape literal asterisk to fix reST emphasis warning

Escaped a literal '*' character in symbol-namespaces.rst to prevent a Docutils warning about unmatched emphasis markers during documentation build.

---

Hello, this is probably too trivial to have its own patch, but I found it while building today's tag, so I thought I would send a patch.

---
 Documentation/core-api/symbol-namespaces.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/core-api/symbol-namespaces.rst +1 -1
index f7cfa7b73e97..008b34fe6629 100644
@@ -87,7 +87,7 @@ modules to access this symbol. Simple tail-globs are supported.
 
 For example:
 
-  EXPORT_SYMBOL_GPL_FOR_MODULES(preempt_notifier_inc, "kvm,kvm-*")
+  EXPORT_SYMBOL_GPL_FOR_MODULES(preempt_notifier_inc, "kvm,kvm-\*")
 
 will limit usage of this symbol to modules whoes name matches the given
 patterns.

--
2.47.2

#1 lore raw
Quoted 2 lines · Khaled Elnaggar

Escaped a literal '*' character in symbol-namespaces.rst to prevent a Docutils warning about unmatched emphasis markers during documentation build.

I don't think this is the right way to fix this problem. We want the test to work in both rendered and un-rendered form. I think we can do something like:

-For example:
+For example::

to turn it into a block that is rendered literally. See

                For example::

                  echo $((100 * `cat active_duration` / `cat connected_duration`))

as an example in Documentation/ABI/stable/sysfs-bus-usb

Quoted 11 lines

For example:

Documentation/core-api/symbol-namespaces.rst +1 -2
-  EXPORT_SYMBOL_GPL_FOR_MODULES(preempt_notifier_inc, "kvm,kvm-*")
+  EXPORT_SYMBOL_GPL_FOR_MODULES(preempt_notifier_inc, "kvm,kvm-\*")
 
 will limit usage of this symbol to modules whoes name matches the given
 patterns.
--

2.47.2

#2 lore raw
Quoted 11 lines · Matthew Wilcox
Quoted 2 lines · Khaled Elnaggar

Escaped a literal '*' character in symbol-namespaces.rst to prevent a Docutils warning about unmatched emphasis markers during documentation build.

I don't think this is the right way to fix this problem. We want the test to work in both rendered and un-rendered form. I think we can do something like:

(quoted diff) +1 -1
-For example:
+For example::
Quoted 19 lines

to turn it into a block that is rendered literally. See

                For example::

                  echo $((100 * `cat active_duration` / `cat connected_duration`))

as an example in Documentation/ABI/stable/sysfs-bus-usb

Quoted 11 lines

For example:

Documentation/core-api/symbol-namespaces.rst +1 -2
-  EXPORT_SYMBOL_GPL_FOR_MODULES(preempt_notifier_inc, "kvm,kvm-*")
+  EXPORT_SYMBOL_GPL_FOR_MODULES(preempt_notifier_inc, "kvm,kvm-\*")
 
 will limit usage of this symbol to modules whoes name matches the given
 patterns.
--

2.47.2

That even looks better in rendered, (::) are actually so prevalent I don't know how I did not see it before. I will send v2, thank you for the proper fix.

#3 lore raw

PATCH v2 1/1 docs: symbol-namespaces: fix reST warning with literal block

In reply to Khaled Elnaggar

Use a literal block for the EXPORT_SYMBOL_GPL_FOR_MODULES() example to avoid a Docutils warning about unmatched '*'. This ensures correct rendering and keeps the source readable.

Warning:
Documentation/core-api/symbol-namespaces.rst:90: WARNING: Inline emphasis start-string without end-string. [docutils]

---

Changes in v2:
- Use 'For example::' to create a literal block, suggested by Matthew Wilcox.

---
 Documentation/core-api/symbol-namespaces.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/core-api/symbol-namespaces.rst +1 -1
index f7cfa7b73e97..32fc73dc5529 100644
@@ -85,7 +85,7 @@ namespace cannot be imported.
 The macro takes a comma separated list of module names, allowing only those
 modules to access this symbol. Simple tail-globs are supported.
 
-For example:
+For example::
 
   EXPORT_SYMBOL_GPL_FOR_MODULES(preempt_notifier_inc, "kvm,kvm-*")
 

--
2.47.2

Reviewed-by on v2 1/1
#4 lore raw

Re: [PATCH v2] docs: symbol-namespaces: fix reST warning with literal block

Documentation/core-api/symbol-namespaces.rst namespace cannot be imported. · line 91

Quoted 13 lines · Khaled Elnaggar
Documentation/core-api/symbol-namespaces.rst +1 -1
index f7cfa7b73e97..32fc73dc5529 100644
@@ -85,7 +85,7 @@ namespace cannot be imported.
 The macro takes a comma separated list of module names, allowing only those
 modules to access this symbol. Simple tail-globs are supported.
 
-For example:
+For example::
 
   EXPORT_SYMBOL_GPL_FOR_MODULES(preempt_notifier_inc, "kvm,kvm-*")
 

LGTM, thanks!

Signature · 1 line
An old man doll... just what I always wanted! - Clara
#5 lore raw

Re: [PATCH v2] docs: symbol-namespaces: fix reST warning with literal block

In reply to Khaled Elnaggar
Quoted 8 lines · Khaled Elnaggar

Use a literal block for the EXPORT_SYMBOL_GPL_FOR_MODULES() example to avoid a Docutils warning about unmatched '*'. This ensures correct rendering and keeps the source readable.

Warning:
Documentation/core-api/symbol-namespaces.rst:90: WARNING: Inline emphasis start-string without end-string. [docutils]

Quoted 7 lines

---

Changes in v2:
- Use 'For example::' to create a literal block, suggested by Matthew Wilcox.

--

Applied to linux-kbuild.
Thanks.

Signature · 2 lines
Best Regards
Masahiro Yamada