Skip to contentSkip to conversation

Documentation: sphinx: Add missing comma to list of strings

PATCH In review Jonathan Neuschäfer 3 participants 4 messages Aug 12, 2019

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

PATCH v2 1/2 Documentation: sphinx: Add missing comma to list of strings

In Python, like in C, when a comma is omitted in a list of strings, the two strings around the missing comma are concatenated.

---

v2:
- new patch

---
 Documentation/sphinx/automarkup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/sphinx/automarkup.py +1 -1
index 77e89c1956d7..a8798369e8f7 100644
@@ -25,7 +25,7 @@ RE_function = re.compile(r'([\w_][\w\d_]+\(\))')
 # to the creation of incorrect and confusing cross references.  So
 # just don't even try with these names.
 #
-Skipfuncs = [ 'open', 'close', 'read', 'write', 'fcntl', 'mmap'
+Skipfuncs = [ 'open', 'close', 'read', 'write', 'fcntl', 'mmap',
               'select', 'poll', 'fork', 'execve', 'clone', 'ioctl']
 
 #

--
2.20.1

#1 lore raw

PATCH v2 2/2 Documentation: sphinx: Don't parse socket() as identifier reference

With the introduction of Documentation/sphinx/automarkup.py, socket() is parsed as a reference to the in-kernel definition of socket. Sphinx then decides that struct socket is a good match, which is usually not intended, when the syscall is meant instead. This was observed in Documentation/networking/af_xdp.rst.

Prevent socket() from being misinterpreted by adding it to the Skipfuncs list in automarkup.py.

---

v2:
- block socket() in Documentation/sphinx/automarkup.py, as suggested by Jonathan Corbet

v1:
- https://lore.kernel.org/lkml/[email protected]/

---
 Documentation/sphinx/automarkup.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/sphinx/automarkup.py +2 -1
index a8798369e8f7..5b6119ff69f4 100644
@@ -26,7 +26,8 @@ RE_function = re.compile(r'([\w_][\w\d_]+\(\))')
 # just don't even try with these names.
 #
 Skipfuncs = [ 'open', 'close', 'read', 'write', 'fcntl', 'mmap',
-              'select', 'poll', 'fork', 'execve', 'clone', 'ioctl']
+              'select', 'poll', 'fork', 'execve', 'clone', 'ioctl',
+              'socket' ]
 
 #
 # Find all occurrences of function() and try to replace them with

--
2.20.1

Reviewed-by on v2 2/2
#2 lore raw

Re: [PATCH v2 2/2] Documentation: sphinx: Don't parse socket() as identifier reference

Em Mon, 12 Aug 2019 18:07:05 +0200
Jonathan Neuschäfer <[email protected]> escreveu:

Quoted 27 lines

With the introduction of Documentation/sphinx/automarkup.py, socket() is parsed as a reference to the in-kernel definition of socket. Sphinx then decides that struct socket is a good match, which is usually not intended, when the syscall is meant instead. This was observed in Documentation/networking/af_xdp.rst.

Prevent socket() from being misinterpreted by adding it to the Skipfuncs list in automarkup.py.

---

v2:
- block socket() in Documentation/sphinx/automarkup.py, as suggested by Jonathan Corbet

v1:
- https://lore.kernel.org/lkml/[email protected]/

---
 Documentation/sphinx/automarkup.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/sphinx/automarkup.py +0 -0
index a8798369e8f7..5b6119ff69f4 100644

Documentation/sphinx/automarkup.py RE_function = re.compile(r'([\w_][\w\d_]+\(\))') · line 30

Quoted 6 lines
Documentation/sphinx/automarkup.py +2 -1
@@ -26,7 +26,8 @@ RE_function = re.compile(r'([\w_][\w\d_]+\(\))')
 # just don't even try with these names.
 #
 Skipfuncs = [ 'open', 'close', 'read', 'write', 'fcntl', 'mmap',
-              'select', 'poll', 'fork', 'execve', 'clone', 'ioctl']
+              'select', 'poll', 'fork', 'execve', 'clone', 'ioctl',
+              'socket' ]

Both patches sound OK on my eyes. Yet, I would just fold them into a single one.

In any case:

Quoted 6 lines
Documentation/sphinx/automarkup.py +0 -1
 #
 # Find all occurrences of function() and try to replace them with
--

2.20.1

Thanks,
Mauro

maintainer
#3 lore raw
In reply to Jonathan Neuschäfer
Quoted 17 lines · On Mon, 12 Aug 2019 18:07:04 +0200 Jonathan Neuschäfer <[email protected]>…

In Python, like in C, when a comma is omitted in a list of strings, the two strings around the missing comma are concatenated.

---

v2:
- new patch

---
 Documentation/sphinx/automarkup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/sphinx/automarkup.py +0 -0
index 77e89c1956d7..a8798369e8f7 100644

Documentation/sphinx/automarkup.py RE_function = re.compile(r'([\w_][\w\d_]+\(\))') · line 29

Quoted 6 lines
Documentation/sphinx/automarkup.py +1 -1
@@ -25,7 +25,7 @@ RE_function = re.compile(r'([\w_][\w\d_]+\(\))')
 # to the creation of incorrect and confusing cross references.  So
 # just don't even try with these names.
 #
-Skipfuncs = [ 'open', 'close', 'read', 'write', 'fcntl', 'mmap'
+Skipfuncs = [ 'open', 'close', 'read', 'write', 'fcntl', 'mmap',
               'select', 'poll', 'fork', 'execve', 'clone', 'ioctl']

Hmm...that's a wee bit embarrassing. Applied (and the socket() patch too), thanks.

jon