tty: n_hdlc: convert to u8 and size_t
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Wed, 6 Dec 2023 07:37:05 +0000 (08:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Dec 2023 11:02:38 +0000 (12:02 +0100)
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>
drivers/tty/n_hdlc.c

index a670419efe7963c8e8630d05696c8046c10fe8b3..1615f074ab86c507b7152d60749c6e43d4a3194f 100644 (file)
 
 struct n_hdlc_buf {
        struct list_head  list_item;
-       int               count;
-       char              buf[];
+       size_t            count;
+       u8                buf[];
 };
 
 struct n_hdlc_buf_list {
@@ -263,9 +263,9 @@ static int n_hdlc_tty_open(struct tty_struct *tty)
  */
 static void n_hdlc_send_frames(struct n_hdlc *n_hdlc, struct tty_struct *tty)
 {
-       register int actual;
        unsigned long flags;
        struct n_hdlc_buf *tbuf;
+       ssize_t actual;
 
 check_again:
 
@@ -281,7 +281,7 @@ check_again:
 
        tbuf = n_hdlc_buf_get(&n_hdlc->tx_buf_list);
        while (tbuf) {
-               pr_debug("sending frame %p, count=%d\n", tbuf, tbuf->count);
+               pr_debug("sending frame %p, count=%zu\n", tbuf, tbuf->count);
 
                /* Send the next block of data to device */
                set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
@@ -521,9 +521,9 @@ static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file,
                                const u8 *data, size_t count)
 {
        struct n_hdlc *n_hdlc = tty->disc_data;
-       int error = 0;
        DECLARE_WAITQUEUE(wait, current);
        struct n_hdlc_buf *tbuf;
+       ssize_t error = 0;
 
        pr_debug("%s() called count=%zd\n", __func__, count);