bpf: Simplify character output in seq_print_delegate_opts()
authorMarkus Elfring <elfring@users.sourceforge.net>
Mon, 15 Jul 2024 09:12:30 +0000 (11:12 +0200)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 29 Jul 2024 19:53:04 +0000 (12:53 -0700)
Single characters should be put into a sequence.
Thus use the corresponding function “seq_putc” for two selected calls.

This issue was transformed by using the Coccinelle software.

Suggested-by: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/abde0992-3d71-44d2-ab27-75b382933a22@web.de
kernel/bpf/inode.c

index af5d2ffadd70bc5066b9aaf1e6977feaaabcb706..d8fc5eba529dca1aa5802801c7339e111101180a 100644 (file)
@@ -709,10 +709,10 @@ static void seq_print_delegate_opts(struct seq_file *m,
                        msk = 1ULL << e->val;
                        if (delegate_msk & msk) {
                                /* emit lower-case name without prefix */
-                               seq_printf(m, "%c", first ? '=' : ':');
+                               seq_putc(m, first ? '=' : ':');
                                name += pfx_len;
                                while (*name) {
-                                       seq_printf(m, "%c", tolower(*name));
+                                       seq_putc(m, tolower(*name));
                                        name++;
                                }