[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6e3b1745-f5f7-7b0b-4bde-309c081bcd03@fb.com>
Date: Tue, 2 Jul 2019 18:02:00 +0000
From: Yonghong Song <yhs@...com>
To: Markus Elfring <Markus.Elfring@....de>,
"bpf@...r.kernel.org" <bpf@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Martin Lau <kafai@...com>, Song Liu <songliubraving@...com>
CC: LKML <linux-kernel@...r.kernel.org>,
"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH] bpf: Replace a seq_printf() call by seq_puts() in
btf_enum_seq_show()
On 7/2/19 10:13 AM, Markus Elfring wrote:
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Tue, 2 Jul 2019 19:04:08 +0200
>
> A string which did not contain a data format specification should be put
> into a sequence. Thus use the corresponding function “seq_puts”.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
Acked-by: Yonghong Song <yhs@...com>
> ---
> kernel/bpf/btf.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
> index 546ebee39e2a..679a19968f29 100644
> --- a/kernel/bpf/btf.c
> +++ b/kernel/bpf/btf.c
> @@ -2426,9 +2426,8 @@ static void btf_enum_seq_show(const struct btf *btf, const struct btf_type *t,
>
> for (i = 0; i < nr_enums; i++) {
> if (v == enums[i].val) {
> - seq_printf(m, "%s",
> - __btf_name_by_offset(btf,
> - enums[i].name_off));
> + seq_puts(m,
> + __btf_name_by_offset(btf, enums[i].name_off));
> return;
> }
> }
> --
> 2.22.0
>
Powered by blists - more mailing lists