diff options
author | Jiri Slaby (SUSE) <jirislaby@kernel.org> | 2023-08-27 10:41:38 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-08-27 12:46:52 +0300 |
commit | c3b2b26f6eaad5d48fe6dd2d9bada07b193bdb61 (patch) | |
tree | 67da90c74d0c02fc38c8bdbdaa65bdf773ff2b52 /drivers/tty/n_tty.c | |
parent | 73276e3a1097ff58d9d167fc9a593cc249d1fd6f (diff) | |
download | linux-c3b2b26f6eaad5d48fe6dd2d9bada07b193bdb61.tar.xz |
tty: n_tty: make n_tty_data::num_overrun unsigned
n_tty_data::num_overrun is unlikely to overflow in a second. But make it
explicitly unsigned to avoid printing negative values.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230827074147.2287-6-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/n_tty.c')
-rw-r--r-- | drivers/tty/n_tty.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index c0b23e975877..7f8f6cfa8843 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c @@ -99,7 +99,7 @@ struct n_tty_data { /* private to n_tty_receive_overrun (single-threaded) */ unsigned long overrun_time; - int num_overrun; + unsigned int num_overrun; /* non-atomic */ bool no_room; @@ -1174,7 +1174,7 @@ static void n_tty_receive_overrun(const struct tty_struct *tty) ldata->num_overrun++; if (time_is_before_jiffies(ldata->overrun_time + HZ)) { - tty_warn(tty, "%d input overrun(s)\n", ldata->num_overrun); + tty_warn(tty, "%u input overrun(s)\n", ldata->num_overrun); ldata->overrun_time = jiffies; ldata->num_overrun = 0; } |