Skip to content

Commit c3b2b26

Browse files
Jiri Slaby (SUSE)gregkh
authored andcommitted
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>
1 parent 73276e3 commit c3b2b26

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/tty/n_tty.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ struct n_tty_data {
9999

100100
/* private to n_tty_receive_overrun (single-threaded) */
101101
unsigned long overrun_time;
102-
int num_overrun;
102+
unsigned int num_overrun;
103103

104104
/* non-atomic */
105105
bool no_room;
@@ -1174,7 +1174,7 @@ static void n_tty_receive_overrun(const struct tty_struct *tty)
11741174

11751175
ldata->num_overrun++;
11761176
if (time_is_before_jiffies(ldata->overrun_time + HZ)) {
1177-
tty_warn(tty, "%d input overrun(s)\n", ldata->num_overrun);
1177+
tty_warn(tty, "%u input overrun(s)\n", ldata->num_overrun);
11781178
ldata->overrun_time = jiffies;
11791179
ldata->num_overrun = 0;
11801180
}

0 commit comments

Comments
 (0)