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)" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 73276e3 commit c3b2b26

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)