tty/serial: kgdb_nmi: use true,false for bool variable
authorZheng Bin <zhengbin13@huawei.com>
Mon, 13 Jan 2020 02:16:15 +0000 (10:16 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jan 2020 13:34:04 +0000 (14:34 +0100)
Fixes coccicheck warning:

drivers/tty/serial/kgdb_nmi.c:121:6-13: WARNING: Assignment of 0/1 to bool variable
drivers/tty/serial/kgdb_nmi.c:133:2-9: WARNING: Assignment of 0/1 to bool variable

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Link: https://lore.kernel.org/r/1578881777-65475-3-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/kgdb_nmi.c

index 4029272891f9d6e4385d01b03dbb73b53d7026e5..5022447afa23eb8ba52efd30e540c0136ccebfa8 100644 (file)
@@ -118,7 +118,7 @@ static int kgdb_nmi_poll_one_knock(void)
        int c = -1;
        const char *magic = kgdb_nmi_magic;
        size_t m = strlen(magic);
-       bool printch = 0;
+       bool printch = false;
 
        c = dbg_io_ops->read_char();
        if (c == NO_POLL_CHAR)
@@ -130,7 +130,7 @@ static int kgdb_nmi_poll_one_knock(void)
                n = (n + 1) % m;
                if (!n)
                        return 1;
-               printch = 1;
+               printch = true;
        } else {
                n = 0;
        }