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

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20231206073712.17776-11-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/ehv_bytechan.c

index cc9f4338da601cf61c7fe51119aaceaa0c567206..69508d7a4135fd32bd311fd6b9d7aae60de6a243 100644 (file)
@@ -49,7 +49,7 @@ struct ehv_bc_data {
        unsigned int tx_irq;
 
        spinlock_t lock;        /* lock for transmit buffer */
-       unsigned char buf[BUF_SIZE];    /* transmit circular buffer */
+       u8 buf[BUF_SIZE];       /* transmit circular buffer */
        unsigned int head;      /* circular buffer head */
        unsigned int tail;      /* circular buffer tail */
 
@@ -138,9 +138,9 @@ static int find_console_handle(void)
 
 static unsigned int local_ev_byte_channel_send(unsigned int handle,
                                               unsigned int *count,
-                                              const char *p)
+                                              const u8 *p)
 {
-       char buffer[EV_BYTE_CHANNEL_MAX_BYTES];
+       u8 buffer[EV_BYTE_CHANNEL_MAX_BYTES];
        unsigned int c = *count;
 
        /*
@@ -166,7 +166,7 @@ static unsigned int local_ev_byte_channel_send(unsigned int handle,
  * has been sent, or if some error has occurred.
  *
  */
-static void byte_channel_spin_send(const char data)
+static void byte_channel_spin_send(const u8 data)
 {
        int ret, count;
 
@@ -474,8 +474,7 @@ static ssize_t ehv_bc_tty_write(struct tty_struct *ttys, const u8 *s,
 {
        struct ehv_bc_data *bc = ttys->driver_data;
        unsigned long flags;
-       unsigned int len;
-       unsigned int written = 0;
+       size_t len, written = 0;
 
        while (1) {
                spin_lock_irqsave(&bc->lock, flags);