* [PATCH 08/27] tty: con3215: convert to u8 and size_t [not found] <20231206073712.17776-1-jirislaby@kernel.org> @ 2023-12-06 7:36 ` Jiri Slaby (SUSE) 2023-12-08 13:19 ` Alexander Gordeev 2023-12-06 7:36 ` [PATCH 09/27] tty: con3270: " Jiri Slaby (SUSE) 1 sibling, 1 reply; 4+ messages in thread From: Jiri Slaby (SUSE) @ 2023-12-06 7:36 UTC (permalink / raw) To: gregkh Cc: linux-serial, linux-kernel, Jiri Slaby (SUSE), Heiko Carstens, Vasily Gorbik, Alexander Gordeev, Christian Borntraeger, Sven Schnelle, linux-s390 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 --- drivers/s390/char/con3215.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index 34bc343dcfcc..0b0324fe4aff 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c @@ -79,8 +79,8 @@ struct raw3215_info { struct ccw_device *cdev; /* device for tty driver */ spinlock_t *lock; /* pointer to irq lock */ int flags; /* state flags */ - char *buffer; /* pointer to output buffer */ - char *inbuf; /* pointer to input buffer */ + u8 *buffer; /* pointer to output buffer */ + u8 *inbuf; /* pointer to input buffer */ int head; /* first free byte in output buffer */ int count; /* number of bytes in output buffer */ int written; /* number of bytes in write requests */ @@ -522,12 +522,14 @@ static unsigned int raw3215_make_room(struct raw3215_info *raw, * string without blocking. * Return value is the number of bytes copied. */ -static unsigned int raw3215_addtext(const char *str, unsigned int length, +static unsigned int raw3215_addtext(const u8 *str, size_t length, struct raw3215_info *raw, int opmode, unsigned int todrop) { - unsigned int c, ch, i, blanks, expanded_size = 0; + unsigned int i, blanks, expanded_size = 0; unsigned int column = raw->line_pos; + size_t c; + u8 ch; if (opmode == RAW3215_COUNT) todrop = 0; @@ -558,7 +560,7 @@ static unsigned int raw3215_addtext(const char *str, unsigned int length, if (todrop && expanded_size < todrop) /* Drop head data */ continue; for (i = 0; i < blanks; i++) { - raw->buffer[raw->head] = (char)_ascebc[(int)ch]; + raw->buffer[raw->head] = _ascebc[ch]; raw->head = (raw->head + 1) & (RAW3215_BUFFER_SIZE - 1); raw->count++; } @@ -570,8 +572,8 @@ static unsigned int raw3215_addtext(const char *str, unsigned int length, /* * String write routine for 3215 devices */ -static void raw3215_write(struct raw3215_info *raw, const char *str, - unsigned int length) +static void raw3215_write(struct raw3215_info *raw, const u8 *str, + size_t length) { unsigned int count, avail; unsigned long flags; @@ -596,7 +598,7 @@ static void raw3215_write(struct raw3215_info *raw, const char *str, /* * Put character routine for 3215 devices */ -static void raw3215_putchar(struct raw3215_info *raw, unsigned char ch) +static void raw3215_putchar(struct raw3215_info *raw, u8 ch) { raw3215_write(raw, &ch, 1); } @@ -823,12 +825,10 @@ static struct ccw_driver raw3215_ccw_driver = { .int_class = IRQIO_C15, }; -static void handle_write(struct raw3215_info *raw, const char *str, int count) +static void handle_write(struct raw3215_info *raw, const u8 *str, size_t count) { - int i; - while (count > 0) { - i = min_t(int, count, RAW3215_BUFFER_SIZE - 1); + size_t i = min_t(size_t, count, RAW3215_BUFFER_SIZE - 1); raw3215_write(raw, str, i); count -= i; str += i; -- 2.43.0 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 08/27] tty: con3215: convert to u8 and size_t 2023-12-06 7:36 ` [PATCH 08/27] tty: con3215: convert to u8 and size_t Jiri Slaby (SUSE) @ 2023-12-08 13:19 ` Alexander Gordeev 0 siblings, 0 replies; 4+ messages in thread From: Alexander Gordeev @ 2023-12-08 13:19 UTC (permalink / raw) To: Jiri Slaby (SUSE) Cc: gregkh, linux-serial, linux-kernel, Heiko Carstens, Vasily Gorbik, Christian Borntraeger, Sven Schnelle, linux-s390 On Wed, Dec 06, 2023 at 08:36:53AM +0100, Jiri Slaby (SUSE) wrote: > 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 > --- > drivers/s390/char/con3215.c | 24 ++++++++++++------------ > 1 file changed, 12 insertions(+), 12 deletions(-) > > diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c > index 34bc343dcfcc..0b0324fe4aff 100644 > --- a/drivers/s390/char/con3215.c > +++ b/drivers/s390/char/con3215.c > @@ -79,8 +79,8 @@ struct raw3215_info { > struct ccw_device *cdev; /* device for tty driver */ > spinlock_t *lock; /* pointer to irq lock */ > int flags; /* state flags */ > - char *buffer; /* pointer to output buffer */ > - char *inbuf; /* pointer to input buffer */ > + u8 *buffer; /* pointer to output buffer */ > + u8 *inbuf; /* pointer to input buffer */ > int head; /* first free byte in output buffer */ > int count; /* number of bytes in output buffer */ > int written; /* number of bytes in write requests */ > @@ -522,12 +522,14 @@ static unsigned int raw3215_make_room(struct raw3215_info *raw, > * string without blocking. > * Return value is the number of bytes copied. > */ > -static unsigned int raw3215_addtext(const char *str, unsigned int length, > +static unsigned int raw3215_addtext(const u8 *str, size_t length, > struct raw3215_info *raw, int opmode, > unsigned int todrop) > { > - unsigned int c, ch, i, blanks, expanded_size = 0; > + unsigned int i, blanks, expanded_size = 0; > unsigned int column = raw->line_pos; > + size_t c; > + u8 ch; > > if (opmode == RAW3215_COUNT) > todrop = 0; > @@ -558,7 +560,7 @@ static unsigned int raw3215_addtext(const char *str, unsigned int length, > if (todrop && expanded_size < todrop) /* Drop head data */ > continue; > for (i = 0; i < blanks; i++) { > - raw->buffer[raw->head] = (char)_ascebc[(int)ch]; > + raw->buffer[raw->head] = _ascebc[ch]; > raw->head = (raw->head + 1) & (RAW3215_BUFFER_SIZE - 1); > raw->count++; > } > @@ -570,8 +572,8 @@ static unsigned int raw3215_addtext(const char *str, unsigned int length, > /* > * String write routine for 3215 devices > */ > -static void raw3215_write(struct raw3215_info *raw, const char *str, > - unsigned int length) > +static void raw3215_write(struct raw3215_info *raw, const u8 *str, > + size_t length) > { > unsigned int count, avail; > unsigned long flags; > @@ -596,7 +598,7 @@ static void raw3215_write(struct raw3215_info *raw, const char *str, > /* > * Put character routine for 3215 devices > */ > -static void raw3215_putchar(struct raw3215_info *raw, unsigned char ch) > +static void raw3215_putchar(struct raw3215_info *raw, u8 ch) > { > raw3215_write(raw, &ch, 1); > } > @@ -823,12 +825,10 @@ static struct ccw_driver raw3215_ccw_driver = { > .int_class = IRQIO_C15, > }; > > -static void handle_write(struct raw3215_info *raw, const char *str, int count) > +static void handle_write(struct raw3215_info *raw, const u8 *str, size_t count) > { > - int i; > - > while (count > 0) { > - i = min_t(int, count, RAW3215_BUFFER_SIZE - 1); > + size_t i = min_t(size_t, count, RAW3215_BUFFER_SIZE - 1); > raw3215_write(raw, str, i); > count -= i; > str += i; Acked-by: Alexander Gordeev <agordeev@linux.ibm.com> ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 09/27] tty: con3270: convert to u8 and size_t [not found] <20231206073712.17776-1-jirislaby@kernel.org> 2023-12-06 7:36 ` [PATCH 08/27] tty: con3215: convert to u8 and size_t Jiri Slaby (SUSE) @ 2023-12-06 7:36 ` Jiri Slaby (SUSE) 2023-12-08 13:19 ` Alexander Gordeev 1 sibling, 1 reply; 4+ messages in thread From: Jiri Slaby (SUSE) @ 2023-12-06 7:36 UTC (permalink / raw) To: gregkh Cc: linux-serial, linux-kernel, Jiri Slaby (SUSE), Heiko Carstens, Vasily Gorbik, Alexander Gordeev, Christian Borntraeger, Sven Schnelle, linux-s390 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 --- drivers/s390/char/con3270.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/s390/char/con3270.c b/drivers/s390/char/con3270.c index 363315fa1666..251d2a1c3eef 100644 --- a/drivers/s390/char/con3270.c +++ b/drivers/s390/char/con3270.c @@ -54,7 +54,7 @@ struct tty3270_attribute { }; struct tty3270_cell { - unsigned char character; + u8 character; struct tty3270_attribute attributes; }; @@ -123,7 +123,7 @@ struct tty3270 { /* Character array for put_char/flush_chars. */ unsigned int char_count; - char char_buf[TTY3270_CHAR_BUF_SIZE]; + u8 char_buf[TTY3270_CHAR_BUF_SIZE]; }; /* tty3270->update_flags. See tty3270_update for details. */ @@ -1255,7 +1255,7 @@ static unsigned int tty3270_write_room(struct tty_struct *tty) * Insert character into the screen at the current position with the * current color and highlight. This function does NOT do cursor movement. */ -static void tty3270_put_character(struct tty3270 *tp, char ch) +static void tty3270_put_character(struct tty3270 *tp, u8 ch) { struct tty3270_line *line; struct tty3270_cell *cell; @@ -1561,7 +1561,7 @@ static void tty3270_goto_xy(struct tty3270 *tp, int cx, int cy) * Pn is a numeric parameter, a string of zero or more decimal digits. * Ps is a selective parameter. */ -static void tty3270_escape_sequence(struct tty3270 *tp, char ch) +static void tty3270_escape_sequence(struct tty3270 *tp, u8 ch) { enum { ES_NORMAL, ES_ESC, ES_SQUARE, ES_PAREN, ES_GETPARS }; @@ -1726,7 +1726,7 @@ static void tty3270_escape_sequence(struct tty3270 *tp, char ch) * String write routine for 3270 ttys */ static void tty3270_do_write(struct tty3270 *tp, struct tty_struct *tty, - const unsigned char *buf, int count) + const u8 *buf, size_t count) { int i_msg, i; @@ -2052,7 +2052,7 @@ con3270_write(struct console *co, const char *str, unsigned int count) { struct tty3270 *tp = co->data; unsigned long flags; - char c; + u8 c; spin_lock_irqsave(&tp->view.lock, flags); while (count--) { -- 2.43.0 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 09/27] tty: con3270: convert to u8 and size_t 2023-12-06 7:36 ` [PATCH 09/27] tty: con3270: " Jiri Slaby (SUSE) @ 2023-12-08 13:19 ` Alexander Gordeev 0 siblings, 0 replies; 4+ messages in thread From: Alexander Gordeev @ 2023-12-08 13:19 UTC (permalink / raw) To: Jiri Slaby (SUSE) Cc: gregkh, linux-serial, linux-kernel, Heiko Carstens, Vasily Gorbik, Christian Borntraeger, Sven Schnelle, linux-s390 On Wed, Dec 06, 2023 at 08:36:54AM +0100, Jiri Slaby (SUSE) wrote: > 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 > --- > drivers/s390/char/con3270.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/s390/char/con3270.c b/drivers/s390/char/con3270.c > index 363315fa1666..251d2a1c3eef 100644 > --- a/drivers/s390/char/con3270.c > +++ b/drivers/s390/char/con3270.c > @@ -54,7 +54,7 @@ struct tty3270_attribute { > }; > > struct tty3270_cell { > - unsigned char character; > + u8 character; > struct tty3270_attribute attributes; > }; > > @@ -123,7 +123,7 @@ struct tty3270 { > > /* Character array for put_char/flush_chars. */ > unsigned int char_count; > - char char_buf[TTY3270_CHAR_BUF_SIZE]; > + u8 char_buf[TTY3270_CHAR_BUF_SIZE]; > }; > > /* tty3270->update_flags. See tty3270_update for details. */ > @@ -1255,7 +1255,7 @@ static unsigned int tty3270_write_room(struct tty_struct *tty) > * Insert character into the screen at the current position with the > * current color and highlight. This function does NOT do cursor movement. > */ > -static void tty3270_put_character(struct tty3270 *tp, char ch) > +static void tty3270_put_character(struct tty3270 *tp, u8 ch) > { > struct tty3270_line *line; > struct tty3270_cell *cell; > @@ -1561,7 +1561,7 @@ static void tty3270_goto_xy(struct tty3270 *tp, int cx, int cy) > * Pn is a numeric parameter, a string of zero or more decimal digits. > * Ps is a selective parameter. > */ > -static void tty3270_escape_sequence(struct tty3270 *tp, char ch) > +static void tty3270_escape_sequence(struct tty3270 *tp, u8 ch) > { > enum { ES_NORMAL, ES_ESC, ES_SQUARE, ES_PAREN, ES_GETPARS }; > > @@ -1726,7 +1726,7 @@ static void tty3270_escape_sequence(struct tty3270 *tp, char ch) > * String write routine for 3270 ttys > */ > static void tty3270_do_write(struct tty3270 *tp, struct tty_struct *tty, > - const unsigned char *buf, int count) > + const u8 *buf, size_t count) > { > int i_msg, i; > > @@ -2052,7 +2052,7 @@ con3270_write(struct console *co, const char *str, unsigned int count) > { > struct tty3270 *tp = co->data; > unsigned long flags; > - char c; > + u8 c; > > spin_lock_irqsave(&tp->view.lock, flags); > while (count--) { Acked-by: Alexander Gordeev <agordeev@linux.ibm.com> ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-12-08 13:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20231206073712.17776-1-jirislaby@kernel.org>
2023-12-06 7:36 ` [PATCH 08/27] tty: con3215: convert to u8 and size_t Jiri Slaby (SUSE)
2023-12-08 13:19 ` Alexander Gordeev
2023-12-06 7:36 ` [PATCH 09/27] tty: con3270: " Jiri Slaby (SUSE)
2023-12-08 13:19 ` Alexander Gordeev
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox