From: Greg KH <gregkh@linuxfoundation.org>
To: Jiri Slaby <jslaby@suse.cz>
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
"Richard Genoud" <richard.genoud@gmail.com>,
"Florian Fainelli" <f.fainelli@gmail.com>,
"Tobias Klauser" <tklauser@distanz.ch>,
"Paul Cercueil" <paul@crapouillou.net>,
"Russell King" <linux@armlinux.org.uk>,
"Vineet Gupta" <vgupta@kernel.org>,
"Nicolas Ferre" <nicolas.ferre@microchip.com>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"Ludovic Desroches" <ludovic.desroches@microchip.com>,
bcm-kernel-feedback-list@broadcom.com,
"Alexander Shiyan" <shc_work@mail.ru>,
"Baruch Siach" <baruch@tkos.co.il>,
"Maciej W. Rozycki" <macro@orcam.me.uk>,
"Paul Walmsley" <paul.walmsley@sifive.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Shawn Guo" <shawnguo@kernel.org>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Pengutronix Kernel Team" <kernel@pengutronix.de>,
"Fabio Estevam" <festevam@gmail.com>,
"NXP Linux Team" <linux-imx@nxp.com>,
"Karol Gugala" <kgugala@antmicro.com>,
"Mateusz Holenko" <mholenko@antmicro.com>,
"Vladimir Zapolskiy" <vz@mleia.com>,
"Neil Armstrong" <narmstrong@baylibre.com>,
"Kevin Hilman" <khilman@baylibre.com>,
"Jerome Brunet" <jbrunet@baylibre.com>,
"Martin Blumenstingl" <martin.blumenstingl@googlemail.com>,
"Taichi Sugaya" <sugaya.taichi@socionext.com>,
"Takao Orito" <orito.takao@socionext.com>,
"Liviu Dudau" <liviu.dudau@arm.com>,
"Sudeep Holla" <sudeep.holla@arm.com>,
"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
"Andreas Färber" <afaerber@suse.de>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Michael Ellerman" <mpe@ellerman.id.au>,
"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
"Paul Mackerras" <paulus@samba.org>,
"Andy Gross" <agross@kernel.org>,
"Bjorn Andersson" <bjorn.andersson@linaro.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski@canonical.com>,
"Orson Zhai" <orsonzhai@gmail.com>,
"Baolin Wang" <baolin.wang7@gmail.com>,
"Chunyan Zhang" <zhang.lyra@gmail.com>,
"Patrice Chotard" <patrice.chotard@foss.st.com>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
"David S. Miller" <davem@davemloft.net>,
"Peter Korsgaard" <peter@korsgaard.com>,
"Michal Simek" <michal.simek@xilinx.com>
Subject: Re: [PATCH v3] serial: make uart_console_write->putchar()'s character an unsigned char
Date: Thu, 3 Mar 2022 09:07:22 +0100 [thread overview]
Message-ID: <YiB3OjwZDDPtKgmm@kroah.com> (raw)
In-Reply-To: <0ed348d2-a3dd-22a1-0773-83369c35794e@suse.cz>
On Thu, Mar 03, 2022 at 08:49:44AM +0100, Jiri Slaby wrote:
> On 03. 03. 22, 8:45, Greg KH wrote:
> > On Thu, Mar 03, 2022 at 07:32:59AM +0100, Jiri Slaby wrote:
> > > On 02. 03. 22, 8:27, Jiri Slaby wrote:
> > > > Currently, uart_console_write->putchar's second parameter (the
> > > > character) is of type int. It makes little sense, provided uart_console_write()
> > > > accepts the input string as "const char *s" and passes its content -- the
> > > > characters -- to putchar(). So switch the character's type to unsigned
> > > > char.
> > > >
> > > > We don't use char as that is signed on some platforms. That would cause
> > > > troubles for drivers which (implicitly) cast the char to u16 when
> > > > writing to the device. Sign extension would happen in that case and the
> > > > value written would be completely different to the provided char. DZ is
> > > > an example of such a driver -- on MIPS, it uses u16 for dz_out in
> > > > dz_console_putchar().
> > > >
> > > > Note we do the char -> uchar conversion implicitly in
> > > > uart_console_write(). Provided we do not change size of the data type,
> > > > sign extension does not happen there, so the problem is void.
> > > >
> > > > This makes the types consistent and unified with the rest of the uart
> > > > layer, which uses unsigned char in most places already. One exception is
> > > > xmit_buf, but that is going to be converted later.
> > >
> > > Kbuild seems to serve me this one by one. So this patch is still incomplete:
> > > > drivers/tty/serial/sunplus-uart.c:526:7: error: incompatible function
> > > pointer types passing 'void (struct uart_port *, int)' to parameter of type
> > > 'void (*)(struct uart_port *, unsigned char)'
> >
> > Let me just add this to my -testing branch, that will give us much
> > quicker kbuild responses and handle stuff like this easier and I can fix
> > the errors up when they are reported.
>
> Note this was missed as this driver was added only few days ago, so it was
> not covered by kbuild against my tree until then. And to me, it looks like
> kbuild is run on my tree only when it has nothing better to do (which is
> perfectly fine, as even that catches a lot of things).
>
> Besides that, there are two places in the driver which need update.
>
> So should I send a v4 or wait?
If you have a v4 now with this fixed, sure, I'll take that and queue
that one up.
thanks,
greg k-h
next prev parent reply other threads:[~2022-03-03 8:07 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-02 7:27 [PATCH v3] serial: make uart_console_write->putchar()'s character an unsigned char Jiri Slaby
2022-03-02 17:52 ` Uwe Kleine-König
2022-03-02 23:57 ` David Laight
2022-03-03 7:06 ` Jiri Slaby
2022-03-03 9:55 ` Maciej W. Rozycki
2022-03-03 10:22 ` Paul Cercueil
2022-03-03 11:30 ` Maciej W. Rozycki
2022-03-03 11:35 ` Jiri Slaby
2022-03-03 11:44 ` David Laight
2022-03-03 12:27 ` Paul Cercueil
2022-03-03 10:23 ` David Laight
2022-03-31 22:59 ` Maciej W. Rozycki
2022-03-02 18:21 ` Vladimir Zapolskiy
2022-03-03 6:32 ` Jiri Slaby
2022-03-03 7:45 ` Greg KH
2022-03-03 7:49 ` Jiri Slaby
2022-03-03 8:07 ` Greg KH [this message]
2022-03-03 8:09 ` Jiri Slaby
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=YiB3OjwZDDPtKgmm@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=afaerber@suse.de \
--cc=agross@kernel.org \
--cc=alexandre.belloni@bootlin.com \
--cc=alexandre.torgue@foss.st.com \
--cc=aou@eecs.berkeley.edu \
--cc=baolin.wang7@gmail.com \
--cc=baruch@tkos.co.il \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=benh@kernel.crashing.org \
--cc=bjorn.andersson@linaro.org \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=festevam@gmail.com \
--cc=jbrunet@baylibre.com \
--cc=jslaby@suse.cz \
--cc=kernel@pengutronix.de \
--cc=kgugala@antmicro.com \
--cc=khilman@baylibre.com \
--cc=krzysztof.kozlowski@canonical.com \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=liviu.dudau@arm.com \
--cc=lorenzo.pieralisi@arm.com \
--cc=ludovic.desroches@microchip.com \
--cc=macro@orcam.me.uk \
--cc=mani@kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=mholenko@antmicro.com \
--cc=michal.simek@xilinx.com \
--cc=mpe@ellerman.id.au \
--cc=narmstrong@baylibre.com \
--cc=nicolas.ferre@microchip.com \
--cc=orito.takao@socionext.com \
--cc=orsonzhai@gmail.com \
--cc=palmer@dabbelt.com \
--cc=patrice.chotard@foss.st.com \
--cc=paul.walmsley@sifive.com \
--cc=paul@crapouillou.net \
--cc=paulus@samba.org \
--cc=peter@korsgaard.com \
--cc=richard.genoud@gmail.com \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=shc_work@mail.ru \
--cc=sudeep.holla@arm.com \
--cc=sugaya.taichi@socionext.com \
--cc=tklauser@distanz.ch \
--cc=vgupta@kernel.org \
--cc=vz@mleia.com \
--cc=zhang.lyra@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.