tty: ldops: unify to u8
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Thu, 10 Aug 2023 09:15:05 +0000 (11:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Aug 2023 19:12:47 +0000 (21:12 +0200)
Some hooks in struct tty_ldisc_ops still reference buffers by 'unsigned
char'. Unify to 'u8' as the rest of the tty layer does.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810091510.13006-32-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/bluetooth/hci_ldisc.c
drivers/input/serio/serport.c
drivers/net/ppp/ppp_async.c
drivers/net/ppp/ppp_synctty.c
drivers/tty/n_gsm.c
drivers/tty/n_hdlc.c
drivers/tty/n_null.c
drivers/tty/n_tty.c
include/linux/tty_ldisc.h
net/nfc/nci/uart.c

index b41071282ce5f51eb5ac1ab24fd5bdb319b5f33b..997f7e98eb624cea92626a1f63ff875a5cbfda21 100644 (file)
@@ -806,14 +806,14 @@ static int hci_uart_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
  * We don't provide read/write/poll interface for user space.
  */
 static ssize_t hci_uart_tty_read(struct tty_struct *tty, struct file *file,
-                                unsigned char *buf, size_t nr,
-                                void **cookie, unsigned long offset)
+                                u8 *buf, size_t nr, void **cookie,
+                                unsigned long offset)
 {
        return 0;
 }
 
 static ssize_t hci_uart_tty_write(struct tty_struct *tty, struct file *file,
-                                 const unsigned char *data, size_t count)
+                                 const u8 *data, size_t count)
 {
        return 0;
 }
index 5ce8d9f10f3ea5d0ef336a3b26e29556eaa72626..1db3f30011c42dc1fd6ef835613232af29edd35f 100644 (file)
@@ -158,8 +158,8 @@ out:
  */
 
 static ssize_t serport_ldisc_read(struct tty_struct * tty, struct file * file,
-                                 unsigned char *kbuf, size_t nr,
-                                 void **cookie, unsigned long offset)
+                                 u8 *kbuf, size_t nr, void **cookie,
+                                 unsigned long offset)
 {
        struct serport *serport = tty->disc_data;
        struct serio *serio;
index cfd5cb609d99b9dfd1311927633dae1e86a93d23..fbaaa8c102a1b11acc5d88b7d3213308dc6287ff 100644 (file)
@@ -257,9 +257,8 @@ static void ppp_asynctty_hangup(struct tty_struct *tty)
  * Pppd reads and writes packets via /dev/ppp instead.
  */
 static ssize_t
-ppp_asynctty_read(struct tty_struct *tty, struct file *file,
-                 unsigned char *buf, size_t count,
-                 void **cookie, unsigned long offset)
+ppp_asynctty_read(struct tty_struct *tty, struct file *file, u8 *buf,
+                 size_t count, void **cookie, unsigned long offset)
 {
        return -EAGAIN;
 }
@@ -269,8 +268,8 @@ ppp_asynctty_read(struct tty_struct *tty, struct file *file,
  * from the ppp generic stuff.
  */
 static ssize_t
-ppp_asynctty_write(struct tty_struct *tty, struct file *file,
-                  const unsigned char *buf, size_t count)
+ppp_asynctty_write(struct tty_struct *tty, struct file *file, const u8 *buf,
+                  size_t count)
 {
        return -EAGAIN;
 }
index 164c9053f73bbf9afc6869bd88ed6a1b6deadade..ebcdffdf4f0e0193635d2b479e8a9f7a32703509 100644 (file)
@@ -255,8 +255,7 @@ static void ppp_sync_hangup(struct tty_struct *tty)
  * Pppd reads and writes packets via /dev/ppp instead.
  */
 static ssize_t
-ppp_sync_read(struct tty_struct *tty, struct file *file,
-             unsigned char *buf, size_t count,
+ppp_sync_read(struct tty_struct *tty, struct file *file, u8 *buf, size_t count,
              void **cookie, unsigned long offset)
 {
        return -EAGAIN;
@@ -267,8 +266,8 @@ ppp_sync_read(struct tty_struct *tty, struct file *file,
  * from the ppp generic stuff.
  */
 static ssize_t
-ppp_sync_write(struct tty_struct *tty, struct file *file,
-               const unsigned char *buf, size_t count)
+ppp_sync_write(struct tty_struct *tty, struct file *file, const u8 *buf,
+              size_t count)
 {
        return -EAGAIN;
 }
index 3e5cc30941a78d11736e21291a0ba6e7a69e4855..42759500b79e7903f66de679c69cd43a708b3bca 100644 (file)
@@ -3638,9 +3638,8 @@ static void gsmld_write_wakeup(struct tty_struct *tty)
  *     This code must be sure never to sleep through a hangup.
  */
 
-static ssize_t gsmld_read(struct tty_struct *tty, struct file *file,
-                         unsigned char *buf, size_t nr,
-                         void **cookie, unsigned long offset)
+static ssize_t gsmld_read(struct tty_struct *tty, struct file *file, u8 *buf,
+                         size_t nr, void **cookie, unsigned long offset)
 {
        return -EOPNOTSUPP;
 }
@@ -3660,7 +3659,7 @@ static ssize_t gsmld_read(struct tty_struct *tty, struct file *file,
  */
 
 static ssize_t gsmld_write(struct tty_struct *tty, struct file *file,
-                          const unsigned char *buf, size_t nr)
+                          const u8 *buf, size_t nr)
 {
        struct gsm_mux *gsm = tty->disc_data;
        unsigned long flags;
index 9be0932d07e0c905c0dc7390404e3453e4c01375..a670419efe7963c8e8630d05696c8046c10fe8b3 100644 (file)
@@ -425,8 +425,8 @@ static void n_hdlc_tty_receive(struct tty_struct *tty, const u8 *data,
  * Returns the number of bytes returned or error code.
  */
 static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
-                          __u8 *kbuf, size_t nr,
-                          void **cookie, unsigned long offset)
+                              u8 *kbuf, size_t nr, void **cookie,
+                              unsigned long offset)
 {
        struct n_hdlc *n_hdlc = tty->disc_data;
        int ret = 0;
@@ -518,7 +518,7 @@ done_with_rbuf:
  * Returns the number of bytes written (or error code).
  */
 static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file,
-                           const unsigned char *data, size_t count)
+                               const u8 *data, size_t count)
 {
        struct n_hdlc *n_hdlc = tty->disc_data;
        int error = 0;
index 4a0d8bb2fb4c2ea5a807549862866f5a9313102f..5a429d923eb31620e12620b6365fca16c3f194c7 100644 (file)
  *  Copyright (C) Intel 2017
  */
 
-static ssize_t n_null_read(struct tty_struct *tty, struct file *file,
-                          unsigned char *buf, size_t nr,
-                          void **cookie, unsigned long offset)
+static ssize_t n_null_read(struct tty_struct *tty, struct file *file, u8 *buf,
+                          size_t nr, void **cookie, unsigned long offset)
 {
        return -EOPNOTSUPP;
 }
 
 static ssize_t n_null_write(struct tty_struct *tty, struct file *file,
-                           const unsigned char *buf, size_t nr)
+                           const u8 *buf, size_t nr)
 {
        return -EOPNOTSUPP;
 }
index 1053b2adb04c835b29fffa9413e6c45b1ff415bf..f44f38bb412e6e027ebbc824f510e9abdd6aa0b1 100644 (file)
@@ -2128,12 +2128,11 @@ static int job_control(struct tty_struct *tty, struct file *file)
  *     claims non-exclusive termios_rwsem;
  *     publishes read_tail
  */
-static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,
-                         unsigned char *kbuf, size_t nr,
-                         void **cookie, unsigned long offset)
+static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, u8 *kbuf,
+                         size_t nr, void **cookie, unsigned long offset)
 {
        struct n_tty_data *ldata = tty->disc_data;
-       unsigned char *kb = kbuf;
+       u8 *kb = kbuf;
        DEFINE_WAIT_FUNC(wait, woken_wake_function);
        int c;
        int minimum, time;
@@ -2332,9 +2331,9 @@ more_to_be_read:
  */
 
 static ssize_t n_tty_write(struct tty_struct *tty, struct file *file,
-                          const unsigned char *buf, size_t nr)
+                          const u8 *buf, size_t nr)
 {
-       const unsigned char *b = buf;
+       const u8 *b = buf;
        DEFINE_WAIT_FUNC(wait, woken_wake_function);
        int c;
        ssize_t retval = 0;
index a661d7df5497a70198a468d00fc19413b7233b1b..af01e89074b2d3fb55c6def86ed5e5966e9a80ff 100644 (file)
@@ -90,8 +90,8 @@ int ldsem_down_write_nested(struct ld_semaphore *sem, int subclass,
  *
  *     Optional.
  *
- * @read: [TTY] ``ssize_t ()(struct tty_struct *tty, struct file *file,
- *             unsigned char *buf, size_t nr)``
+ * @read: [TTY] ``ssize_t ()(struct tty_struct *tty, struct file *file, u8 *buf,
+ *             size_t nr)``
  *
  *     This function is called when the user requests to read from the @tty.
  *     The line discipline will return whatever characters it has buffered up
@@ -102,7 +102,7 @@ int ldsem_down_write_nested(struct ld_semaphore *sem, int subclass,
  *     Optional: %EIO unless provided. Can sleep.
  *
  * @write: [TTY] ``ssize_t ()(struct tty_struct *tty, struct file *file,
- *             const unsigned char *buf, size_t nr)``
+ *              const u8 *buf, size_t nr)``
  *
  *     This function is called when the user requests to write to the @tty.
  *     The line discipline will deliver the characters to the low-level tty
@@ -238,11 +238,10 @@ struct tty_ldisc_ops {
        int     (*open)(struct tty_struct *tty);
        void    (*close)(struct tty_struct *tty);
        void    (*flush_buffer)(struct tty_struct *tty);
-       ssize_t (*read)(struct tty_struct *tty, struct file *file,
-                       unsigned char *buf, size_t nr,
-                       void **cookie, unsigned long offset);
+       ssize_t (*read)(struct tty_struct *tty, struct file *file, u8 *buf,
+                       size_t nr, void **cookie, unsigned long offset);
        ssize_t (*write)(struct tty_struct *tty, struct file *file,
-                        const unsigned char *buf, size_t nr);
+                        const u8 *buf, size_t nr);
        int     (*ioctl)(struct tty_struct *tty, unsigned int cmd,
                        unsigned long arg);
        int     (*compat_ioctl)(struct tty_struct *tty, unsigned int cmd,
index 93775c540287aa96d05e8be1915ab2565e4c7ea3..ed1508a9e093eda56937b9bd7663b8eb31e13890 100644 (file)
@@ -345,14 +345,14 @@ static int nci_uart_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
 
 /* We don't provide read/write/poll interface for user space. */
 static ssize_t nci_uart_tty_read(struct tty_struct *tty, struct file *file,
-                                unsigned char *buf, size_t nr,
-                                void **cookie, unsigned long offset)
+                                u8 *buf, size_t nr, void **cookie,
+                                unsigned long offset)
 {
        return 0;
 }
 
 static ssize_t nci_uart_tty_write(struct tty_struct *tty, struct file *file,
-                                 const unsigned char *data, size_t count)
+                                 const u8 *data, size_t count)
 {
        return 0;
 }