2024-02-19 20:27:37

by Thomas Weißschuh

[permalink] [raw]
Subject: [PATCH v3 2/3] ipc: remove linebreaks from arguments of __register_sysctl_table

Calls to __register_sysctl_table will be validated by
scripts/check-sysctl-docs. As this script is line-based remove the
linebreak which would confuse the script.

Signed-off-by: Thomas Weißschuh <[email protected]>
---
ipc/ipc_sysctl.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c
index 8c62e443f78b..e4008288a3ba 100644
--- a/ipc/ipc_sysctl.c
+++ b/ipc/ipc_sysctl.c
@@ -259,8 +259,7 @@ bool setup_ipc_sysctls(struct ipc_namespace *ns)
tbl[i].data = NULL;
}

- ns->ipc_sysctls = __register_sysctl_table(&ns->ipc_set,
- "kernel", tbl,
+ ns->ipc_sysctls = __register_sysctl_table(&ns->ipc_set, "kernel", tbl,
ARRAY_SIZE(ipc_sysctls));
}
if (!ns->ipc_sysctls) {

--
2.43.2



2024-02-23 10:17:21

by Joel Granados

[permalink] [raw]
Subject: Re: [PATCH v3 2/3] ipc: remove linebreaks from arguments of __register_sysctl_table

On Mon, Feb 19, 2024 at 09:19:23PM +0100, Thomas Wei?schuh wrote:
> Calls to __register_sysctl_table will be validated by
> scripts/check-sysctl-docs. As this script is line-based remove the
> linebreak which would confuse the script.
>
> Signed-off-by: Thomas Wei?schuh <[email protected]>
> ---
> ipc/ipc_sysctl.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c
> index 8c62e443f78b..e4008288a3ba 100644
> --- a/ipc/ipc_sysctl.c
> +++ b/ipc/ipc_sysctl.c
> @@ -259,8 +259,7 @@ bool setup_ipc_sysctls(struct ipc_namespace *ns)
> tbl[i].data = NULL;
> }
>
> - ns->ipc_sysctls = __register_sysctl_table(&ns->ipc_set,
> - "kernel", tbl,
> + ns->ipc_sysctls = __register_sysctl_table(&ns->ipc_set, "kernel", tbl,
> ARRAY_SIZE(ipc_sysctls));
> }
> if (!ns->ipc_sysctls) {
This is very interesting and points to a bigger issue with the
check-sysctl-docs: which is that the AWK record separator is "\n" and it
require that the lines being analyzed follow a strict pattern; even if
that meant having a loooong line (not the case in this patch).

The final solution would be to change the separator to something less
line based to something more C based like RS=";{}". This is not a
blocker to this patchset as it actually fixes a broken script. But is an
interesting observation for whomever wants to continue this work.

Thx Thomas.

Best

--

Joel Granados


Attachments:
(No filename) (1.46 kB)
signature.asc (673.00 B)
Download all attachments