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

Configure Feed

Select the types of activity you want to include in your feed.

tty: ldops: unify to u8

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>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
49b8220c 3e04ba41

+35 -41
+3 -3
drivers/bluetooth/hci_ldisc.c
··· 806 806 * We don't provide read/write/poll interface for user space. 807 807 */ 808 808 static ssize_t hci_uart_tty_read(struct tty_struct *tty, struct file *file, 809 - unsigned char *buf, size_t nr, 810 - void **cookie, unsigned long offset) 809 + u8 *buf, size_t nr, void **cookie, 810 + unsigned long offset) 811 811 { 812 812 return 0; 813 813 } 814 814 815 815 static ssize_t hci_uart_tty_write(struct tty_struct *tty, struct file *file, 816 - const unsigned char *data, size_t count) 816 + const u8 *data, size_t count) 817 817 { 818 818 return 0; 819 819 }
+2 -2
drivers/input/serio/serport.c
··· 158 158 */ 159 159 160 160 static ssize_t serport_ldisc_read(struct tty_struct * tty, struct file * file, 161 - unsigned char *kbuf, size_t nr, 162 - void **cookie, unsigned long offset) 161 + u8 *kbuf, size_t nr, void **cookie, 162 + unsigned long offset) 163 163 { 164 164 struct serport *serport = tty->disc_data; 165 165 struct serio *serio;
+4 -5
drivers/net/ppp/ppp_async.c
··· 257 257 * Pppd reads and writes packets via /dev/ppp instead. 258 258 */ 259 259 static ssize_t 260 - ppp_asynctty_read(struct tty_struct *tty, struct file *file, 261 - unsigned char *buf, size_t count, 262 - void **cookie, unsigned long offset) 260 + ppp_asynctty_read(struct tty_struct *tty, struct file *file, u8 *buf, 261 + size_t count, void **cookie, unsigned long offset) 263 262 { 264 263 return -EAGAIN; 265 264 } ··· 268 269 * from the ppp generic stuff. 269 270 */ 270 271 static ssize_t 271 - ppp_asynctty_write(struct tty_struct *tty, struct file *file, 272 - const unsigned char *buf, size_t count) 272 + ppp_asynctty_write(struct tty_struct *tty, struct file *file, const u8 *buf, 273 + size_t count) 273 274 { 274 275 return -EAGAIN; 275 276 }
+3 -4
drivers/net/ppp/ppp_synctty.c
··· 255 255 * Pppd reads and writes packets via /dev/ppp instead. 256 256 */ 257 257 static ssize_t 258 - ppp_sync_read(struct tty_struct *tty, struct file *file, 259 - unsigned char *buf, size_t count, 258 + ppp_sync_read(struct tty_struct *tty, struct file *file, u8 *buf, size_t count, 260 259 void **cookie, unsigned long offset) 261 260 { 262 261 return -EAGAIN; ··· 266 267 * from the ppp generic stuff. 267 268 */ 268 269 static ssize_t 269 - ppp_sync_write(struct tty_struct *tty, struct file *file, 270 - const unsigned char *buf, size_t count) 270 + ppp_sync_write(struct tty_struct *tty, struct file *file, const u8 *buf, 271 + size_t count) 271 272 { 272 273 return -EAGAIN; 273 274 }
+3 -4
drivers/tty/n_gsm.c
··· 3638 3638 * This code must be sure never to sleep through a hangup. 3639 3639 */ 3640 3640 3641 - static ssize_t gsmld_read(struct tty_struct *tty, struct file *file, 3642 - unsigned char *buf, size_t nr, 3643 - void **cookie, unsigned long offset) 3641 + static ssize_t gsmld_read(struct tty_struct *tty, struct file *file, u8 *buf, 3642 + size_t nr, void **cookie, unsigned long offset) 3644 3643 { 3645 3644 return -EOPNOTSUPP; 3646 3645 } ··· 3659 3660 */ 3660 3661 3661 3662 static ssize_t gsmld_write(struct tty_struct *tty, struct file *file, 3662 - const unsigned char *buf, size_t nr) 3663 + const u8 *buf, size_t nr) 3663 3664 { 3664 3665 struct gsm_mux *gsm = tty->disc_data; 3665 3666 unsigned long flags;
+3 -3
drivers/tty/n_hdlc.c
··· 425 425 * Returns the number of bytes returned or error code. 426 426 */ 427 427 static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file, 428 - __u8 *kbuf, size_t nr, 429 - void **cookie, unsigned long offset) 428 + u8 *kbuf, size_t nr, void **cookie, 429 + unsigned long offset) 430 430 { 431 431 struct n_hdlc *n_hdlc = tty->disc_data; 432 432 int ret = 0; ··· 518 518 * Returns the number of bytes written (or error code). 519 519 */ 520 520 static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file, 521 - const unsigned char *data, size_t count) 521 + const u8 *data, size_t count) 522 522 { 523 523 struct n_hdlc *n_hdlc = tty->disc_data; 524 524 int error = 0;
+3 -4
drivers/tty/n_null.c
··· 10 10 * Copyright (C) Intel 2017 11 11 */ 12 12 13 - static ssize_t n_null_read(struct tty_struct *tty, struct file *file, 14 - unsigned char *buf, size_t nr, 15 - void **cookie, unsigned long offset) 13 + static ssize_t n_null_read(struct tty_struct *tty, struct file *file, u8 *buf, 14 + size_t nr, void **cookie, unsigned long offset) 16 15 { 17 16 return -EOPNOTSUPP; 18 17 } 19 18 20 19 static ssize_t n_null_write(struct tty_struct *tty, struct file *file, 21 - const unsigned char *buf, size_t nr) 20 + const u8 *buf, size_t nr) 22 21 { 23 22 return -EOPNOTSUPP; 24 23 }
+5 -6
drivers/tty/n_tty.c
··· 2128 2128 * claims non-exclusive termios_rwsem; 2129 2129 * publishes read_tail 2130 2130 */ 2131 - static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, 2132 - unsigned char *kbuf, size_t nr, 2133 - void **cookie, unsigned long offset) 2131 + static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, u8 *kbuf, 2132 + size_t nr, void **cookie, unsigned long offset) 2134 2133 { 2135 2134 struct n_tty_data *ldata = tty->disc_data; 2136 - unsigned char *kb = kbuf; 2135 + u8 *kb = kbuf; 2137 2136 DEFINE_WAIT_FUNC(wait, woken_wake_function); 2138 2137 int c; 2139 2138 int minimum, time; ··· 2331 2332 */ 2332 2333 2333 2334 static ssize_t n_tty_write(struct tty_struct *tty, struct file *file, 2334 - const unsigned char *buf, size_t nr) 2335 + const u8 *buf, size_t nr) 2335 2336 { 2336 - const unsigned char *b = buf; 2337 + const u8 *b = buf; 2337 2338 DEFINE_WAIT_FUNC(wait, woken_wake_function); 2338 2339 int c; 2339 2340 ssize_t retval = 0;
+6 -7
include/linux/tty_ldisc.h
··· 90 90 * 91 91 * Optional. 92 92 * 93 - * @read: [TTY] ``ssize_t ()(struct tty_struct *tty, struct file *file, 94 - * unsigned char *buf, size_t nr)`` 93 + * @read: [TTY] ``ssize_t ()(struct tty_struct *tty, struct file *file, u8 *buf, 94 + * size_t nr)`` 95 95 * 96 96 * This function is called when the user requests to read from the @tty. 97 97 * The line discipline will return whatever characters it has buffered up ··· 102 102 * Optional: %EIO unless provided. Can sleep. 103 103 * 104 104 * @write: [TTY] ``ssize_t ()(struct tty_struct *tty, struct file *file, 105 - * const unsigned char *buf, size_t nr)`` 105 + * const u8 *buf, size_t nr)`` 106 106 * 107 107 * This function is called when the user requests to write to the @tty. 108 108 * The line discipline will deliver the characters to the low-level tty ··· 238 238 int (*open)(struct tty_struct *tty); 239 239 void (*close)(struct tty_struct *tty); 240 240 void (*flush_buffer)(struct tty_struct *tty); 241 - ssize_t (*read)(struct tty_struct *tty, struct file *file, 242 - unsigned char *buf, size_t nr, 243 - void **cookie, unsigned long offset); 241 + ssize_t (*read)(struct tty_struct *tty, struct file *file, u8 *buf, 242 + size_t nr, void **cookie, unsigned long offset); 244 243 ssize_t (*write)(struct tty_struct *tty, struct file *file, 245 - const unsigned char *buf, size_t nr); 244 + const u8 *buf, size_t nr); 246 245 int (*ioctl)(struct tty_struct *tty, unsigned int cmd, 247 246 unsigned long arg); 248 247 int (*compat_ioctl)(struct tty_struct *tty, unsigned int cmd,
+3 -3
net/nfc/nci/uart.c
··· 345 345 346 346 /* We don't provide read/write/poll interface for user space. */ 347 347 static ssize_t nci_uart_tty_read(struct tty_struct *tty, struct file *file, 348 - unsigned char *buf, size_t nr, 349 - void **cookie, unsigned long offset) 348 + u8 *buf, size_t nr, void **cookie, 349 + unsigned long offset) 350 350 { 351 351 return 0; 352 352 } 353 353 354 354 static ssize_t nci_uart_tty_write(struct tty_struct *tty, struct file *file, 355 - const unsigned char *data, size_t count) 355 + const u8 *data, size_t count) 356 356 { 357 357 return 0; 358 358 }