linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] Documentation: sphinx: Add missing comma to list of strings
@ 2019-08-12 16:07 Jonathan Neuschäfer
  2019-08-12 16:07 ` [PATCH v2 2/2] Documentation: sphinx: Don't parse socket() as identifier reference Jonathan Neuschäfer
  2019-08-12 20:56 ` [PATCH v2 1/2] Documentation: sphinx: Add missing comma to list of strings Jonathan Corbet
  0 siblings, 2 replies; 4+ messages in thread
From: Jonathan Neuschäfer @ 2019-08-12 16:07 UTC (permalink / raw)
  To: linux-doc
  Cc: Jonathan Neuschäfer, Jonathan Corbet, Mauro Carvalho Chehab,
	linux-kernel

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

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
---

v2:
- new patch
---
 Documentation/sphinx/automarkup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/sphinx/automarkup.py b/Documentation/sphinx/automarkup.py
index 77e89c1956d7..a8798369e8f7 100644
--- a/Documentation/sphinx/automarkup.py
+++ b/Documentation/sphinx/automarkup.py
@@ -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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] Documentation: sphinx: Don't parse socket() as identifier reference
  2019-08-12 16:07 [PATCH v2 1/2] Documentation: sphinx: Add missing comma to list of strings Jonathan Neuschäfer
@ 2019-08-12 16:07 ` Jonathan Neuschäfer
  2019-08-12 16:11   ` Mauro Carvalho Chehab
  2019-08-12 20:56 ` [PATCH v2 1/2] Documentation: sphinx: Add missing comma to list of strings Jonathan Corbet
  1 sibling, 1 reply; 4+ messages in thread
From: Jonathan Neuschäfer @ 2019-08-12 16:07 UTC (permalink / raw)
  To: linux-doc
  Cc: Jonathan Neuschäfer, Jonathan Corbet, Alexei Starovoitov,
	Daniel Borkmann, David S. Miller, Jakub Kicinski,
	Jesper Dangaard Brouer, John Fastabend, Mauro Carvalho Chehab,
	linux-kernel, netdev, xdp-newbies, bpf

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.

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
---

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

v1:
- https://lore.kernel.org/lkml/20190810121738.19587-1-j.neuschaefer@gmx.net/
---
 Documentation/sphinx/automarkup.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/sphinx/automarkup.py b/Documentation/sphinx/automarkup.py
index a8798369e8f7..5b6119ff69f4 100644
--- a/Documentation/sphinx/automarkup.py
+++ b/Documentation/sphinx/automarkup.py
@@ -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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 2/2] Documentation: sphinx: Don't parse socket() as identifier reference
  2019-08-12 16:07 ` [PATCH v2 2/2] Documentation: sphinx: Don't parse socket() as identifier reference Jonathan Neuschäfer
@ 2019-08-12 16:11   ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 4+ messages in thread
From: Mauro Carvalho Chehab @ 2019-08-12 16:11 UTC (permalink / raw)
  To: Jonathan Neuschäfer
  Cc: linux-doc, Jonathan Corbet, Alexei Starovoitov, Daniel Borkmann,
	David S. Miller, Jakub Kicinski, Jesper Dangaard Brouer,
	John Fastabend, linux-kernel, netdev, xdp-newbies, bpf

Em Mon, 12 Aug 2019 18:07:05 +0200
Jonathan Neuschäfer <j.neuschaefer@gmx.net> escreveu:

> 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.
> 
> Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
> ---
> 
> v2:
> - block socket() in Documentation/sphinx/automarkup.py, as suggested by
>   Jonathan Corbet
> 
> v1:
> - https://lore.kernel.org/lkml/20190810121738.19587-1-j.neuschaefer@gmx.net/
> ---
>  Documentation/sphinx/automarkup.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/sphinx/automarkup.py b/Documentation/sphinx/automarkup.py
> index a8798369e8f7..5b6119ff69f4 100644
> --- a/Documentation/sphinx/automarkup.py
> +++ b/Documentation/sphinx/automarkup.py
> @@ -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:

Reviewed-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
> 
>  #
>  # Find all occurrences of function() and try to replace them with
> --
> 2.20.1
> 



Thanks,
Mauro

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 1/2] Documentation: sphinx: Add missing comma to list of strings
  2019-08-12 16:07 [PATCH v2 1/2] Documentation: sphinx: Add missing comma to list of strings Jonathan Neuschäfer
  2019-08-12 16:07 ` [PATCH v2 2/2] Documentation: sphinx: Don't parse socket() as identifier reference Jonathan Neuschäfer
@ 2019-08-12 20:56 ` Jonathan Corbet
  1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Corbet @ 2019-08-12 20:56 UTC (permalink / raw)
  To: Jonathan Neuschäfer; +Cc: linux-doc, Mauro Carvalho Chehab, linux-kernel

On Mon, 12 Aug 2019 18:07:04 +0200
Jonathan Neuschäfer <j.neuschaefer@gmx.net> wrote:

> In Python, like in C, when a comma is omitted in a list of strings, the
> two strings around the missing comma are concatenated.
> 
> Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
> ---
> 
> v2:
> - new patch
> ---
>  Documentation/sphinx/automarkup.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/sphinx/automarkup.py b/Documentation/sphinx/automarkup.py
> index 77e89c1956d7..a8798369e8f7 100644
> --- a/Documentation/sphinx/automarkup.py
> +++ b/Documentation/sphinx/automarkup.py
> @@ -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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-12 20:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-12 16:07 [PATCH v2 1/2] Documentation: sphinx: Add missing comma to list of strings Jonathan Neuschäfer
2019-08-12 16:07 ` [PATCH v2 2/2] Documentation: sphinx: Don't parse socket() as identifier reference Jonathan Neuschäfer
2019-08-12 16:11   ` Mauro Carvalho Chehab
2019-08-12 20:56 ` [PATCH v2 1/2] Documentation: sphinx: Add missing comma to list of strings Jonathan Corbet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).