Re: [PATCH v4 2/2] bpftool: Align bpf_load_and_run_opts insns and data

From: Quentin Monnet
Date: Thu Oct 05 2023 - 12:08:42 EST


On 04/10/2023 23:23, Ian Rogers wrote:
> A C string lacks alignment so use aligned arrays to avoid potential
> alignment problems. Switch to using sizeof (less 1 for the \0
> terminator) rather than a hardcode size constant.
>
> Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
> ---
> tools/bpf/bpftool/gen.c | 47 ++++++++++++++++++++++-------------------
> 1 file changed, 25 insertions(+), 22 deletions(-)
>
> diff --git a/tools/bpf/bpftool/gen.c b/tools/bpf/bpftool/gen.c
> index b8ebcee9bc56..7a545dcabe38 100644
> --- a/tools/bpf/bpftool/gen.c
> +++ b/tools/bpf/bpftool/gen.c
> @@ -408,8 +408,8 @@ static void codegen(const char *template, ...)
> /* skip baseline indentation tabs */
> for (n = skip_tabs; n > 0; n--, src++) {
> if (*src != '\t') {
> - p_err("not enough tabs at pos %td in template '%s'",
> - src - template - 1, template);
> + p_err("not enough tabs at pos %td in template '%s'\n'%s'",
> + src - template - 1, template, src);

Nit: This line is no longer aligned with the opening parenthesis.

Other than that:

Acked-by: Quentin Monnet <quenti@xxxxxxxxxxxxx>