[PATCH] docs: use flexible array members, not zero-length

2019-09-27 Thread Stephen Kitt
Update the docs throughout to remove zero-length arrays, replacing them with C99 flexible array members. GCC will then ensure that the arrays are always the last element in the struct. Signed-off-by: Stephen Kitt Cc: Gustavo A. R. Silva --- Documentation/bpf/btf.rst | 2

Re: [PATCH] docs: use flexible array members, not zero-length

2019-09-28 Thread Stephen Kitt
On Sat, 28 Sep 2019 01:16:39 -0600, Jonathan Corbet wrote: > On Fri, 27 Sep 2019 16:29:27 +0200 > Stephen Kitt wrote: > > diff --git a/Documentation/bpf/btf.rst b/Documentation/bpf/btf.rst > > index 4d565d202ce3..24ce50fc1fc1 100644 > > --- a/Documentation/bpf/btf.rst >

[PATCH] bpf: use flexible array members, not zero-length

2019-09-28 Thread Stephen Kitt
This switches zero-length arrays in variable-length structs to C99 flexible array members. GCC will then ensure that the arrays are always the last element in the struct. Coccinelle: @@ identifier S, fld; type T; @@ struct S { ... - T fld[0]; + T fld[]; ... }; Signed-off-by: Stephen Kitt

[PATCH v2] bpf: use flexible array members, not zero-length

2019-09-30 Thread Stephen Kitt
This switches zero-length arrays in variable-length structs to C99 flexible array members. GCC will then ensure that the arrays are always the last element in the struct. Coccinelle: @@ identifier S, fld; type T; @@ struct S { ... T fld[ - 0 ]; ... }; Signed-off-by: Stephen Kitt

Re: [PATCH] bpf: use flexible array members, not zero-length

2019-09-30 Thread Stephen Kitt
Le 30/09/2019 08:07, Song Liu a écrit : On Sep 28, 2019, at 10:49 PM, Gustavo A. R. Silva wrote: I think you should preserve the tab here. Agreed. Indeed (and I thought I’d checked whitespace changes!). V2 upcoming with an improved Coccinelle script which preserves whitespace and fixes a

[PATCH] docs: stop suggesting strlcpy

2019-06-13 Thread Stephen Kitt
Since strlcpy is deprecated, the documentation shouldn't suggest using it. This patch fixes the examples to use strscpy instead. It also uses sizeof instead of underlying constants as far as possible, to simplify future changes to the corresponding data structures. Signed-off-by: Stephen

[PATCH] docs: format kernel-parameters -- as code

2019-06-27 Thread Stephen Kitt
The current ReStructuredText formatting results in "--", used to indicate the end of the kernel command-line parameters, appearing as an en-dash instead of two hyphens; this patch formats them as code, "``--``", as done elsewhere in the documentation. Signed-

Re: [PATCH] docs: format kernel-parameters -- as code

2019-06-28 Thread Stephen Kitt
two hyphens; this patch formats them as code, > > "``--``", as done elsewhere in the documentation. > > > > Signed-off-by: Stephen Kitt > > A worthy fix, I've applied it. This seems like the sort of annoyance that > will bite us over and over, though. W

Re: [PATCH] docs: format kernel-parameters -- as code

2019-06-28 Thread Stephen Kitt
On Fri, 28 Jun 2019 12:48:04 -0600, Jonathan Corbet wrote: > On Fri, 28 Jun 2019 20:38:41 +0200 > Stephen Kitt wrote: > > > Right, looking further shows a large number of places where -- is handled > > incorrectly. The following patch disables this “smart” handling wholesal