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: core: the rest to u8

There are still last minor users in the tty core that still reference
characters by the 'char' type. Switch them to u8.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20231206073712.17776-6-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
4e8d8878 3a00da02

+7 -7
+5 -5
drivers/tty/tty_io.c
··· 852 852 { 853 853 void *cookie = NULL; 854 854 unsigned long offset = 0; 855 - char kernel_buf[64]; 856 855 ssize_t retval = 0; 857 856 size_t copied, count = iov_iter_count(to); 857 + u8 kernel_buf[64]; 858 858 859 859 do { 860 860 ssize_t size = min(count, sizeof(kernel_buf)); ··· 995 995 996 996 /* write_buf/write_cnt is protected by the atomic_write_lock mutex */ 997 997 if (tty->write_cnt < chunk) { 998 - unsigned char *buf_chunk; 998 + u8 *buf_chunk; 999 999 1000 1000 if (chunk < 1024) 1001 1001 chunk = 1024; ··· 2278 2278 * * Called functions take tty_ldiscs_lock 2279 2279 * * current->signal->tty check is safe without locks 2280 2280 */ 2281 - static int tiocsti(struct tty_struct *tty, char __user *p) 2281 + static int tiocsti(struct tty_struct *tty, u8 __user *p) 2282 2282 { 2283 - char ch; 2284 2283 struct tty_ldisc *ld; 2284 + u8 ch; 2285 2285 2286 2286 if (!tty_legacy_tiocsti && !capable(CAP_SYS_ADMIN)) 2287 2287 return -EIO; ··· 3142 3142 * 3143 3143 * Return: the number of characters successfully output. 3144 3144 */ 3145 - int tty_put_char(struct tty_struct *tty, unsigned char ch) 3145 + int tty_put_char(struct tty_struct *tty, u8 ch) 3146 3146 { 3147 3147 if (tty->ops->put_char) 3148 3148 return tty->ops->put_char(tty, ch);
+2 -2
include/linux/tty.h
··· 242 242 void *driver_data; 243 243 spinlock_t files_lock; 244 244 int write_cnt; 245 - unsigned char *write_buf; 245 + u8 *write_buf; 246 246 247 247 struct list_head tty_files; 248 248 ··· 411 411 void start_tty(struct tty_struct *tty); 412 412 void tty_write_message(struct tty_struct *tty, char *msg); 413 413 int tty_send_xchar(struct tty_struct *tty, u8 ch); 414 - int tty_put_char(struct tty_struct *tty, unsigned char c); 414 + int tty_put_char(struct tty_struct *tty, u8 c); 415 415 unsigned int tty_chars_in_buffer(struct tty_struct *tty); 416 416 unsigned int tty_write_room(struct tty_struct *tty); 417 417 void tty_driver_flush_buffer(struct tty_struct *tty);