Skip to content

Commit 01c4335

Browse files
mchehabJonathan Corbet
authored andcommitted
docs: sphinx: kerneldoc: ignore "\" characters from options
Documentation/driver-api/infiniband.rst has a kernel-doc tag with "\" characters at the end: .. kernel-doc:: drivers/infiniband/ulp/iser/iscsi_iser.c :functions: iscsi_iser_pdu_alloc iser_initialize_task_headers \ iscsi_iser_task_init iscsi_iser_mtask_xmit iscsi_iser_task_xmit \ iscsi_iser_cleanup_task iscsi_iser_check_protection \ iscsi_iser_conn_create iscsi_iser_conn_bind \ iscsi_iser_conn_start iscsi_iser_conn_stop \ iscsi_iser_session_destroy iscsi_iser_session_create \ iscsi_iser_set_param iscsi_iser_ep_connect iscsi_iser_ep_poll \ iscsi_iser_ep_disconnect This is not handled well, as the "\" strings will be just stored inside Sphinx options. While the actual problem deserves being fixed, better to relax the keneldoc.py extension to silently strip "\" from the end of strings, as otherwise this may cause troubles when preparing arguments to be executed by kernel-doc. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/4c652d6c57b20500c135b95294e554d9e9a97f42.1744106242.git.mchehab+huawei@kernel.org
1 parent 668b9d1 commit 01c4335

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Documentation/sphinx/kerneldoc.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ def run(self):
118118
identifiers = self.options.get('identifiers').split()
119119
if identifiers:
120120
for i in identifiers:
121+
i = i.rstrip("\\").strip()
122+
if not i:
123+
continue
124+
121125
cmd += ['-function', i]
122126
else:
123127
cmd += ['-no-doc-sections']
@@ -126,9 +130,17 @@ def run(self):
126130
no_identifiers = self.options.get('no-identifiers').split()
127131
if no_identifiers:
128132
for i in no_identifiers:
133+
i = i.rstrip("\\").strip()
134+
if not i:
135+
continue
136+
129137
cmd += ['-nosymbol', i]
130138

131139
for pattern in export_file_patterns:
140+
pattern = pattern.rstrip("\\").strip()
141+
if not pattern:
142+
continue
143+
132144
for f in glob.glob(env.config.kerneldoc_srctree + '/' + pattern):
133145
env.note_dependency(os.path.abspath(f))
134146
cmd += ['-export-file', f]

0 commit comments

Comments
 (0)