Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: n_hdlc: convert to u8 and size_t

Switch character types to u8 and sizes to size_t. To conform to
characters/sizes in the rest of the tty layer.

Note u8 is already both passed in and expected on output.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20231206073712.17776-21-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
5655b16e eb7e45db

+5 -5
+5 -5
drivers/tty/n_hdlc.c
··· 109 109 110 110 struct n_hdlc_buf { 111 111 struct list_head list_item; 112 - int count; 113 - char buf[]; 112 + size_t count; 113 + u8 buf[]; 114 114 }; 115 115 116 116 struct n_hdlc_buf_list { ··· 263 263 */ 264 264 static void n_hdlc_send_frames(struct n_hdlc *n_hdlc, struct tty_struct *tty) 265 265 { 266 - register int actual; 267 266 unsigned long flags; 268 267 struct n_hdlc_buf *tbuf; 268 + ssize_t actual; 269 269 270 270 check_again: 271 271 ··· 281 281 282 282 tbuf = n_hdlc_buf_get(&n_hdlc->tx_buf_list); 283 283 while (tbuf) { 284 - pr_debug("sending frame %p, count=%d\n", tbuf, tbuf->count); 284 + pr_debug("sending frame %p, count=%zu\n", tbuf, tbuf->count); 285 285 286 286 /* Send the next block of data to device */ 287 287 set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); ··· 521 521 const u8 *data, size_t count) 522 522 { 523 523 struct n_hdlc *n_hdlc = tty->disc_data; 524 - int error = 0; 525 524 DECLARE_WAITQUEUE(wait, current); 526 525 struct n_hdlc_buf *tbuf; 526 + ssize_t error = 0; 527 527 528 528 pr_debug("%s() called count=%zd\n", __func__, count); 529 529