]> Gentwo Git Trees - linux/.git/commitdiff
virtio: console: Use str_yes_no() helper in port_debugfs_show()
authorThorsten Blum <thorsten.blum@linux.dev>
Wed, 12 Feb 2025 11:48:41 +0000 (12:48 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Feb 2025 14:24:19 +0000 (15:24 +0100)
Remove hard-coded strings by using the str_yes_no() helper function.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Amit Shah <amit@kernel.org>
Link: https://lore.kernel.org/r/20250212114841.74650-2-thorsten.blum@linux.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/virtio_console.c

index 24442485e73e7113dddbdd0b1e51cf3e74b5ee22..35af0cc11d9341ca522dc96fdb6f736cd7b6df54 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/workqueue.h>
 #include <linux/module.h>
 #include <linux/dma-mapping.h>
+#include <linux/string_choices.h>
 #include "../tty/hvc/hvc_console.h"
 
 #define is_rproc_enabled IS_ENABLED(CONFIG_REMOTEPROC)
@@ -1269,8 +1270,7 @@ static int port_debugfs_show(struct seq_file *s, void *data)
        seq_printf(s, "bytes_sent: %lu\n", port->stats.bytes_sent);
        seq_printf(s, "bytes_received: %lu\n", port->stats.bytes_received);
        seq_printf(s, "bytes_discarded: %lu\n", port->stats.bytes_discarded);
-       seq_printf(s, "is_console: %s\n",
-                  is_console_port(port) ? "yes" : "no");
+       seq_printf(s, "is_console: %s\n", str_yes_no(is_console_port(port)));
        seq_printf(s, "console_vtermno: %u\n", port->cons.vtermno);
 
        return 0;