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

tty: propagate u8 data to tty_operations::write()

Data are now typed as u8. Propagate this change to
tty_operations::write().

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Richard Weinberger <richard@nod.at>
Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Vaibhav Gupta <vaibhavgupta40@gmail.com>
Cc: Jens Taprogge <jens.taprogge@taprogge.org>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Scott Branden <scott.branden@broadcom.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
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: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: David Lin <dtwlin@gmail.com>
Cc: Johan Hovold <johan@kernel.org>
Cc: Alex Elder <elder@kernel.org>
Cc: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: David Sterba <dsterba@suse.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP Linux Team <linux-imx@nxp.com>
Cc: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Cc: Oliver Neukum <oneukum@suse.com>
Cc: Mathias Nyman <mathias.nyman@intel.com>
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Link: https://lore.kernel.org/r/20230810091510.13006-28-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
69851e4a 48a6ab88

+53 -88
+1 -2
arch/alpha/kernel/srmcons.c
··· 130 130 } 131 131 132 132 static int 133 - srmcons_write(struct tty_struct *tty, 134 - const unsigned char *buf, int count) 133 + srmcons_write(struct tty_struct *tty, const u8 *buf, int count) 135 134 { 136 135 unsigned long flags; 137 136
+1 -2
arch/m68k/emu/nfcon.c
··· 70 70 { 71 71 } 72 72 73 - static int nfcon_tty_write(struct tty_struct *tty, const unsigned char *buf, 74 - int count) 73 + static int nfcon_tty_write(struct tty_struct *tty, const u8 *buf, int count) 75 74 { 76 75 nfputs(buf, count); 77 76 return count;
+1 -1
arch/um/drivers/line.c
··· 184 184 line_flush_buffer(tty); 185 185 } 186 186 187 - int line_write(struct tty_struct *tty, const unsigned char *buf, int len) 187 + int line_write(struct tty_struct *tty, const u8 *buf, int len) 188 188 { 189 189 struct line *line = tty->driver_data; 190 190 unsigned long flags;
+1 -2
arch/um/drivers/line.h
··· 64 64 extern void line_hangup(struct tty_struct *tty); 65 65 extern int line_setup(char **conf, unsigned nlines, char **def, 66 66 char *init, char *name); 67 - extern int line_write(struct tty_struct *tty, const unsigned char *buf, 68 - int len); 67 + extern int line_write(struct tty_struct *tty, const u8 *buf, int len); 69 68 extern unsigned int line_chars_in_buffer(struct tty_struct *tty); 70 69 extern void line_flush_buffer(struct tty_struct *tty); 71 70 extern void line_flush_chars(struct tty_struct *tty);
+1 -2
arch/xtensa/platforms/iss/console.c
··· 52 52 } 53 53 54 54 55 - static int rs_write(struct tty_struct * tty, 56 - const unsigned char *buf, int count) 55 + static int rs_write(struct tty_struct * tty, const u8 *buf, int count) 57 56 { 58 57 /* see drivers/char/serialX.c to reference original version */ 59 58
+2 -3
drivers/char/ttyprintk.c
··· 51 51 } 52 52 } 53 53 54 - static int tpk_printk(const unsigned char *buf, int count) 54 + static int tpk_printk(const u8 *buf, int count) 55 55 { 56 56 int i; 57 57 ··· 103 103 /* 104 104 * TTY operations write function. 105 105 */ 106 - static int tpk_write(struct tty_struct *tty, 107 - const unsigned char *buf, int count) 106 + static int tpk_write(struct tty_struct *tty, const u8 *buf, int count) 108 107 { 109 108 struct ttyprintk_port *tpkp = tty->driver_data; 110 109 unsigned long flags;
+2 -4
drivers/ipack/devices/ipoctal.c
··· 437 437 } 438 438 439 439 static inline int ipoctal_copy_write_buffer(struct ipoctal_channel *channel, 440 - const unsigned char *buf, 441 - int count) 440 + const u8 *buf, int count) 442 441 { 443 442 unsigned long flags; 444 443 int i; ··· 458 459 return i; 459 460 } 460 461 461 - static int ipoctal_write_tty(struct tty_struct *tty, 462 - const unsigned char *buf, int count) 462 + static int ipoctal_write_tty(struct tty_struct *tty, const u8 *buf, int count) 463 463 { 464 464 struct ipoctal_channel *channel = tty->driver_data; 465 465 unsigned int char_copied;
+1 -2
drivers/isdn/capi/capi.c
··· 1077 1077 tty_port_close(&mp->port, tty, filp); 1078 1078 } 1079 1079 1080 - static int capinc_tty_write(struct tty_struct *tty, 1081 - const unsigned char *buf, int count) 1080 + static int capinc_tty_write(struct tty_struct *tty, const u8 *buf, int count) 1082 1081 { 1083 1082 struct capiminor *mp = tty->driver_data; 1084 1083 struct sk_buff *skb;
+1 -3
drivers/misc/bcm-vk/bcm_vk_tty.c
··· 186 186 VK_BAR0_REGSEG_DB_BASE + VK_BAR0_REGSEG_TTY_DB_OFFSET); 187 187 } 188 188 189 - static int bcm_vk_tty_write(struct tty_struct *tty, 190 - const unsigned char *buffer, 191 - int count) 189 + static int bcm_vk_tty_write(struct tty_struct *tty, const u8 *buffer, int count) 192 190 { 193 191 int index; 194 192 struct bcm_vk *vk;
+1 -2
drivers/mmc/core/sdio_uart.c
··· 760 760 tty_port_hangup(&port->port); 761 761 } 762 762 763 - static int sdio_uart_write(struct tty_struct *tty, const unsigned char *buf, 764 - int count) 763 + static int sdio_uart_write(struct tty_struct *tty, const u8 *buf, int count) 765 764 { 766 765 struct sdio_uart_port *port = tty->driver_data; 767 766 int ret;
+1 -2
drivers/net/usb/hso.c
··· 1322 1322 } 1323 1323 1324 1324 /* close the requested serial port */ 1325 - static int hso_serial_write(struct tty_struct *tty, const unsigned char *buf, 1326 - int count) 1325 + static int hso_serial_write(struct tty_struct *tty, const u8 *buf, int count) 1327 1326 { 1328 1327 struct hso_serial *serial = tty->driver_data; 1329 1328 int space, tx_bytes;
+1 -2
drivers/s390/char/con3215.c
··· 1021 1021 /* 1022 1022 * String write routine for 3215 ttys 1023 1023 */ 1024 - static int tty3215_write(struct tty_struct *tty, 1025 - const unsigned char *buf, int count) 1024 + static int tty3215_write(struct tty_struct *tty, const u8 *buf, int count) 1026 1025 { 1027 1026 handle_write(tty->driver_data, buf, count); 1028 1027 return count;
+1 -2
drivers/s390/char/con3270.c
··· 1803 1803 /* 1804 1804 * String write routine for 3270 ttys 1805 1805 */ 1806 - static int tty3270_write(struct tty_struct *tty, 1807 - const unsigned char *buf, int count) 1806 + static int tty3270_write(struct tty_struct *tty, const u8 *buf, int count) 1808 1807 { 1809 1808 struct tty3270 *tp; 1810 1809
+1 -1
drivers/s390/char/sclp_tty.c
··· 230 230 * routine will return the number of characters actually accepted for writing. 231 231 */ 232 232 static int 233 - sclp_tty_write(struct tty_struct *tty, const unsigned char *buf, int count) 233 + sclp_tty_write(struct tty_struct *tty, const u8 *buf, int count) 234 234 { 235 235 if (sclp_tty_chars_count > 0) { 236 236 sclp_tty_write_string(sclp_tty_chars, sclp_tty_chars_count, 0);
+1 -1
drivers/s390/char/sclp_vt220.c
··· 463 463 * number of characters actually accepted for writing. 464 464 */ 465 465 static int 466 - sclp_vt220_write(struct tty_struct *tty, const unsigned char *buf, int count) 466 + sclp_vt220_write(struct tty_struct *tty, const u8 *buf, int count) 467 467 { 468 468 return __sclp_vt220_write(buf, count, 1, 0, 1); 469 469 }
+1 -2
drivers/staging/gdm724x/gdm_tty.c
··· 149 149 tty_port_tty_wakeup(&gdm->port); 150 150 } 151 151 152 - static int gdm_tty_write(struct tty_struct *tty, const unsigned char *buf, 153 - int len) 152 + static int gdm_tty_write(struct tty_struct *tty, const u8 *buf, int len) 154 153 { 155 154 struct gdm *gdm = tty->driver_data; 156 155 int remain = len;
+1 -2
drivers/staging/greybus/uart.c
··· 427 427 tty_port_hangup(&gb_tty->port); 428 428 } 429 429 430 - static int gb_tty_write(struct tty_struct *tty, const unsigned char *buf, 431 - int count) 430 + static int gb_tty_write(struct tty_struct *tty, const u8 *buf, int count) 432 431 { 433 432 struct gb_tty *gb_tty = tty->driver_data; 434 433
+1 -1
drivers/tty/amiserial.c
··· 741 741 local_irq_restore(flags); 742 742 } 743 743 744 - static int rs_write(struct tty_struct * tty, const unsigned char *buf, int count) 744 + static int rs_write(struct tty_struct * tty, const u8 *buf, int count) 745 745 { 746 746 int c, ret = 0; 747 747 struct serial_state *info = tty->driver_data;
+1 -2
drivers/tty/ehv_bytechan.c
··· 466 466 * ehv_bc_tty_write_room() will never lie, so the tty layer will never send us 467 467 * too much data. 468 468 */ 469 - static int ehv_bc_tty_write(struct tty_struct *ttys, const unsigned char *s, 470 - int count) 469 + static int ehv_bc_tty_write(struct tty_struct *ttys, const u8 *s, int count) 471 470 { 472 471 struct ehv_bc_data *bc = ttys->driver_data; 473 472 unsigned long flags;
+2 -4
drivers/tty/goldfish.c
··· 125 125 } 126 126 } 127 127 128 - static void goldfish_tty_do_write(int line, const char *buf, 129 - unsigned int count) 128 + static void goldfish_tty_do_write(int line, const u8 *buf, unsigned int count) 130 129 { 131 130 struct goldfish_tty *qtty = &goldfish_ttys[line]; 132 131 unsigned long address = (unsigned long)(void *)buf; ··· 185 186 tty_port_hangup(tty->port); 186 187 } 187 188 188 - static int goldfish_tty_write(struct tty_struct *tty, const unsigned char *buf, 189 - int count) 189 + static int goldfish_tty_write(struct tty_struct *tty, const u8 *buf, int count) 190 190 { 191 191 goldfish_tty_do_write(tty->index, buf, count); 192 192 return count;
+1 -1
drivers/tty/hvc/hvc_console.c
··· 496 496 return n; 497 497 } 498 498 499 - static int hvc_write(struct tty_struct *tty, const unsigned char *buf, int count) 499 + static int hvc_write(struct tty_struct *tty, const u8 *buf, int count) 500 500 { 501 501 struct hvc_struct *hp = tty->driver_data; 502 502 unsigned long flags;
+1 -2
drivers/tty/hvc/hvcs.c
··· 1257 1257 * tty_hangup will allow hvcs_write time to complete execution before it 1258 1258 * terminates our device. 1259 1259 */ 1260 - static int hvcs_write(struct tty_struct *tty, 1261 - const unsigned char *buf, int count) 1260 + static int hvcs_write(struct tty_struct *tty, const u8 *buf, int count) 1262 1261 { 1263 1262 struct hvcs_struct *hvcsd = tty->driver_data; 1264 1263 unsigned int unit_address;
+1 -2
drivers/tty/hvc/hvsi.c
··· 904 904 return hp->n_outbuf; 905 905 } 906 906 907 - static int hvsi_write(struct tty_struct *tty, 908 - const unsigned char *source, int count) 907 + static int hvsi_write(struct tty_struct *tty, const u8 *source, int count) 909 908 { 910 909 struct hvsi_struct *hp = tty->driver_data; 911 910 unsigned long flags;
+1 -1
drivers/tty/ipwireless/hardware.c
··· 1292 1292 } 1293 1293 1294 1294 int ipwireless_send_packet(struct ipw_hardware *hw, unsigned int channel_idx, 1295 - const unsigned char *data, unsigned int length, 1295 + const u8 *data, unsigned int length, 1296 1296 void (*callback) (void *cb, unsigned int length), 1297 1297 void *callback_data) 1298 1298 {
+1 -2
drivers/tty/ipwireless/tty.c
··· 186 186 tty->tx_bytes_queued -= packet_length; 187 187 } 188 188 189 - static int ipw_write(struct tty_struct *linux_tty, 190 - const unsigned char *buf, int count) 189 + static int ipw_write(struct tty_struct *linux_tty, const u8 *buf, int count) 191 190 { 192 191 struct ipw_tty *tty = linux_tty->driver_data; 193 192 int room, ret;
+2 -2
drivers/tty/mips_ejtag_fdc.c
··· 796 796 tty_port_hangup(tty->port); 797 797 } 798 798 799 - static int mips_ejtag_fdc_tty_write(struct tty_struct *tty, 800 - const unsigned char *buf, int total) 799 + static int mips_ejtag_fdc_tty_write(struct tty_struct *tty, const u8 *buf, 800 + int total) 801 801 { 802 802 int count, block; 803 803 struct mips_ejtag_fdc_tty_port *dport = tty->driver_data;
+3 -5
drivers/tty/moxa.c
··· 487 487 */ 488 488 static int moxa_open(struct tty_struct *, struct file *); 489 489 static void moxa_close(struct tty_struct *, struct file *); 490 - static int moxa_write(struct tty_struct *, const unsigned char *, int); 490 + static int moxa_write(struct tty_struct *, const u8 *, int); 491 491 static unsigned int moxa_write_room(struct tty_struct *); 492 492 static void moxa_flush_buffer(struct tty_struct *); 493 493 static unsigned int moxa_chars_in_buffer(struct tty_struct *); ··· 1499 1499 tty_port_close(&ch->port, tty, filp); 1500 1500 } 1501 1501 1502 - static int moxa_write(struct tty_struct *tty, 1503 - const unsigned char *buf, int count) 1502 + static int moxa_write(struct tty_struct *tty, const u8 *buf, int count) 1504 1503 { 1505 1504 struct moxa_port *ch = tty->driver_data; 1506 1505 unsigned long flags; ··· 2163 2164 return val; 2164 2165 } 2165 2166 2166 - static int MoxaPortWriteData(struct tty_struct *tty, 2167 - const unsigned char *buffer, int len) 2167 + static int MoxaPortWriteData(struct tty_struct *tty, const u8 *buffer, int len) 2168 2168 { 2169 2169 struct moxa_port *port = tty->driver_data; 2170 2170 void __iomem *baseAddr, *ofsAddr, *ofs;
+1 -1
drivers/tty/mxser.c
··· 901 901 tty_port_close(tty->port, tty, filp); 902 902 } 903 903 904 - static int mxser_write(struct tty_struct *tty, const unsigned char *buf, int count) 904 + static int mxser_write(struct tty_struct *tty, const u8 *buf, int count) 905 905 { 906 906 struct mxser_port *info = tty->driver_data; 907 907 unsigned long flags;
+1 -2
drivers/tty/n_gsm.c
··· 4256 4256 gsm_dlci_begin_close(dlci); 4257 4257 } 4258 4258 4259 - static int gsmtty_write(struct tty_struct *tty, const unsigned char *buf, 4260 - int len) 4259 + static int gsmtty_write(struct tty_struct *tty, const u8 *buf, int len) 4261 4260 { 4262 4261 int sent; 4263 4262 struct gsm_dlci *dlci = tty->driver_data;
+2 -3
drivers/tty/nozomi.c
··· 1599 1599 * called when the userspace process writes to the tty (/dev/noz*). 1600 1600 * Data is inserted into a fifo, which is then read and transferred to the modem. 1601 1601 */ 1602 - static int ntty_write(struct tty_struct *tty, const unsigned char *buffer, 1603 - int count) 1602 + static int ntty_write(struct tty_struct *tty, const u8 *buffer, int count) 1604 1603 { 1605 1604 int rval = -EINVAL; 1606 1605 struct nozomi *dc = get_dc_by_tty(tty); ··· 1609 1610 if (!dc || !port) 1610 1611 return -ENODEV; 1611 1612 1612 - rval = kfifo_in(&port->fifo_ul, (unsigned char *)buffer, count); 1613 + rval = kfifo_in(&port->fifo_ul, buffer, count); 1613 1614 1614 1615 spin_lock_irqsave(&dc->spin_mutex, flags); 1615 1616 /* CTS is only valid on the modem channel */
+1 -1
drivers/tty/pty.c
··· 108 108 * the other side of the pty/tty pair. 109 109 */ 110 110 111 - static int pty_write(struct tty_struct *tty, const unsigned char *buf, int c) 111 + static int pty_write(struct tty_struct *tty, const u8 *buf, int c) 112 112 { 113 113 struct tty_struct *to = tty->link; 114 114
+1 -1
drivers/tty/serial/kgdb_nmi.c
··· 304 304 return 2048; 305 305 } 306 306 307 - static int kgdb_nmi_tty_write(struct tty_struct *tty, const unchar *buf, int c) 307 + static int kgdb_nmi_tty_write(struct tty_struct *tty, const u8 *buf, int c) 308 308 { 309 309 int i; 310 310
+1 -2
drivers/tty/serial/serial_core.c
··· 580 580 uart_start(tty); 581 581 } 582 582 583 - static int uart_write(struct tty_struct *tty, 584 - const unsigned char *buf, int count) 583 + static int uart_write(struct tty_struct *tty, const u8 *buf, int count) 585 584 { 586 585 struct uart_state *state = tty->driver_data; 587 586 struct uart_port *port;
+1 -2
drivers/tty/ttynull.c
··· 29 29 tty_port_hangup(&ttynull_port); 30 30 } 31 31 32 - static int ttynull_write(struct tty_struct *tty, const unsigned char *buf, 33 - int count) 32 + static int ttynull_write(struct tty_struct *tty, const u8 *buf, int count) 34 33 { 35 34 return count; 36 35 }
+1 -2
drivers/tty/vcc.c
··· 804 804 tty_port_hangup(tty->port); 805 805 } 806 806 807 - static int vcc_write(struct tty_struct *tty, const unsigned char *buf, 808 - int count) 807 + static int vcc_write(struct tty_struct *tty, const u8 *buf, int count) 809 808 { 810 809 struct vcc_port *port; 811 810 struct vio_vcc *pkt;
+2 -2
drivers/tty/vt/vt.c
··· 2845 2845 } 2846 2846 2847 2847 /* acquires console_lock */ 2848 - static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int count) 2848 + static int do_con_write(struct tty_struct *tty, const u8 *buf, int count) 2849 2849 { 2850 2850 struct vc_draw_region draw = { 2851 2851 .x = -1, ··· 3238 3238 * /dev/ttyN handling 3239 3239 */ 3240 3240 3241 - static int con_write(struct tty_struct *tty, const unsigned char *buf, int count) 3241 + static int con_write(struct tty_struct *tty, const u8 *buf, int count) 3242 3242 { 3243 3243 int retval; 3244 3244
+1 -2
drivers/usb/class/cdc-acm.c
··· 789 789 tty_port_close(&acm->port, tty, filp); 790 790 } 791 791 792 - static int acm_tty_write(struct tty_struct *tty, 793 - const unsigned char *buf, int count) 792 + static int acm_tty_write(struct tty_struct *tty, const u8 *buf, int count) 794 793 { 795 794 struct acm *acm = tty->driver_data; 796 795 int stat;
+1 -1
drivers/usb/gadget/function/u_serial.c
··· 734 734 spin_unlock_irq(&port->port_lock); 735 735 } 736 736 737 - static int gs_write(struct tty_struct *tty, const unsigned char *buf, int count) 737 + static int gs_write(struct tty_struct *tty, const u8 *buf, int count) 738 738 { 739 739 struct gs_port *port = tty->driver_data; 740 740 unsigned long flags;
+1 -3
drivers/usb/host/xhci-dbgtty.c
··· 208 208 tty_port_close(&port->port, tty, file); 209 209 } 210 210 211 - static int dbc_tty_write(struct tty_struct *tty, 212 - const unsigned char *buf, 213 - int count) 211 + static int dbc_tty_write(struct tty_struct *tty, const u8 *buf, int count) 214 212 { 215 213 struct dbc_port *port = tty->driver_data; 216 214 unsigned long flags;
+1 -2
drivers/usb/serial/usb-serial.c
··· 361 361 module_put(owner); 362 362 } 363 363 364 - static int serial_write(struct tty_struct *tty, const unsigned char *buf, 365 - int count) 364 + static int serial_write(struct tty_struct *tty, const u8 *buf, int count) 366 365 { 367 366 struct usb_serial_port *port = tty->driver_data; 368 367 int retval = -ENODEV;
+1 -2
include/linux/tty_driver.h
··· 356 356 void (*close)(struct tty_struct * tty, struct file * filp); 357 357 void (*shutdown)(struct tty_struct *tty); 358 358 void (*cleanup)(struct tty_struct *tty); 359 - int (*write)(struct tty_struct * tty, 360 - const unsigned char *buf, int count); 359 + int (*write)(struct tty_struct *tty, const u8 *buf, int count); 361 360 int (*put_char)(struct tty_struct *tty, unsigned char ch); 362 361 void (*flush_chars)(struct tty_struct *tty); 363 362 unsigned int (*write_room)(struct tty_struct *tty);
+1 -1
net/bluetooth/rfcomm/tty.c
··· 779 779 tty_port_close(&dev->port, tty, filp); 780 780 } 781 781 782 - static int rfcomm_tty_write(struct tty_struct *tty, const unsigned char *buf, int count) 782 + static int rfcomm_tty_write(struct tty_struct *tty, const u8 *buf, int count) 783 783 { 784 784 struct rfcomm_dev *dev = tty->driver_data; 785 785 struct rfcomm_dlc *dlc = dev->dlc;