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: con3215: convert to u8 and size_t

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: 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: linux-s390@vger.kernel.org
Link: https://lore.kernel.org/r/20231206073712.17776-9-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
359bbdc0 03e5af52

+12 -12
+12 -12
drivers/s390/char/con3215.c
··· 79 79 struct ccw_device *cdev; /* device for tty driver */ 80 80 spinlock_t *lock; /* pointer to irq lock */ 81 81 int flags; /* state flags */ 82 - char *buffer; /* pointer to output buffer */ 83 - char *inbuf; /* pointer to input buffer */ 82 + u8 *buffer; /* pointer to output buffer */ 83 + u8 *inbuf; /* pointer to input buffer */ 84 84 int head; /* first free byte in output buffer */ 85 85 int count; /* number of bytes in output buffer */ 86 86 int written; /* number of bytes in write requests */ ··· 522 522 * string without blocking. 523 523 * Return value is the number of bytes copied. 524 524 */ 525 - static unsigned int raw3215_addtext(const char *str, unsigned int length, 525 + static unsigned int raw3215_addtext(const u8 *str, size_t length, 526 526 struct raw3215_info *raw, int opmode, 527 527 unsigned int todrop) 528 528 { 529 - unsigned int c, ch, i, blanks, expanded_size = 0; 529 + unsigned int i, blanks, expanded_size = 0; 530 530 unsigned int column = raw->line_pos; 531 + size_t c; 532 + u8 ch; 531 533 532 534 if (opmode == RAW3215_COUNT) 533 535 todrop = 0; ··· 560 558 if (todrop && expanded_size < todrop) /* Drop head data */ 561 559 continue; 562 560 for (i = 0; i < blanks; i++) { 563 - raw->buffer[raw->head] = (char)_ascebc[(int)ch]; 561 + raw->buffer[raw->head] = _ascebc[ch]; 564 562 raw->head = (raw->head + 1) & (RAW3215_BUFFER_SIZE - 1); 565 563 raw->count++; 566 564 } ··· 572 570 /* 573 571 * String write routine for 3215 devices 574 572 */ 575 - static void raw3215_write(struct raw3215_info *raw, const char *str, 576 - unsigned int length) 573 + static void raw3215_write(struct raw3215_info *raw, const u8 *str, 574 + size_t length) 577 575 { 578 576 unsigned int count, avail; 579 577 unsigned long flags; ··· 598 596 /* 599 597 * Put character routine for 3215 devices 600 598 */ 601 - static void raw3215_putchar(struct raw3215_info *raw, unsigned char ch) 599 + static void raw3215_putchar(struct raw3215_info *raw, u8 ch) 602 600 { 603 601 raw3215_write(raw, &ch, 1); 604 602 } ··· 825 823 .int_class = IRQIO_C15, 826 824 }; 827 825 828 - static void handle_write(struct raw3215_info *raw, const char *str, int count) 826 + static void handle_write(struct raw3215_info *raw, const u8 *str, size_t count) 829 827 { 830 - int i; 831 - 832 828 while (count > 0) { 833 - i = min_t(int, count, RAW3215_BUFFER_SIZE - 1); 829 + size_t i = min_t(size_t, count, RAW3215_BUFFER_SIZE - 1); 834 830 raw3215_write(raw, str, i); 835 831 count -= i; 836 832 str += i;