From: Geert Uytterhoeven <geert@linux-m68k.org>
To: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: gregkh@linuxfoundation.org, linux-serial@vger.kernel.org,
linux-kernel@vger.kernel.org, Karsten Keil <isdn@linux-pingi.de>,
Ulf Hansson <ulf.hansson@linaro.org>,
Marcel Holtmann <marcel@holtmann.org>,
Johan Hedberg <johan.hedberg@gmail.com>,
Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
netdev@vger.kernel.org, linux-mmc@vger.kernel.org,
linux-bluetooth@vger.kernel.org,
linux-m68k <linux-m68k@lists.linux-m68k.org>
Subject: Re: [PATCH 04/27] tty: make tty_operations::send_xchar accept u8 char
Date: Wed, 6 Dec 2023 09:27:36 +0100 [thread overview]
Message-ID: <CAMuHMdU4_==x7efMMOmxm3L4vZeWGeeWNo2bQ8Pv1wWx7246gQ@mail.gmail.com> (raw)
In-Reply-To: <20231206073712.17776-5-jirislaby@kernel.org>
CC linux-m68k
On Wed, Dec 6, 2023 at 8:37 AM Jiri Slaby (SUSE) <jirislaby@kernel.org> wrote:
> tty_operations::send_xchar is one of the last users of 'char' type for
> characters in the tty layer. Convert it to u8 now.
>
> Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
> drivers/tty/amiserial.c | 2 +-
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
> --- a/drivers/tty/amiserial.c
> +++ b/drivers/tty/amiserial.c
> @@ -811,7 +811,7 @@ static void rs_flush_buffer(struct tty_struct *tty)
> * This function is used to send a high-priority XON/XOFF character to
> * the device
> */
> -static void rs_send_xchar(struct tty_struct *tty, char ch)
> +static void rs_send_xchar(struct tty_struct *tty, u8 ch)
> {
> struct serial_state *info = tty->driver_data;
> unsigned long flags;
Looks like this might fix an actual (harmless?) bug, if anyone evers
configures a VSTOP or VSTART character with bit 7 set?
info->x_char = ch; // x_char is int, hence sign-extended
transmit_chars() does:
amiga_custom.serdat = info->x_char | 0x100;
which will inadvertently have all high bits sets, including the bit
9, which is only used if PARENB is enabled. But as it looks like
PARENB handling is broken in amiseral anyway, this doesn't matter
much...
include/linux/tty.h:#define STOP_CHAR(tty) ((tty)->termios.c_cc[VSTOP])
include/linux/tty.h:#define START_CHAR(tty) ((tty)->termios.c_cc[VSTART])
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next prev parent reply other threads:[~2023-12-06 8:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20231206073712.17776-1-jirislaby@kernel.org>
2023-12-06 7:36 ` [PATCH 04/27] tty: make tty_operations::send_xchar accept u8 char Jiri Slaby (SUSE)
2023-12-06 8:27 ` Geert Uytterhoeven [this message]
2023-12-07 14:09 ` Ulf Hansson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMuHMdU4_==x7efMMOmxm3L4vZeWGeeWNo2bQ8Pv1wWx7246gQ@mail.gmail.com' \
--to=geert@linux-m68k.org \
--cc=gregkh@linuxfoundation.org \
--cc=isdn@linux-pingi.de \
--cc=jirislaby@kernel.org \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
--cc=netdev@vger.kernel.org \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).