* [PATCH v1] tty: baudrate: Synchronise baud_table[] and baud_bits[]
@ 2020-01-14 17:09 Andy Shevchenko
2020-01-14 17:27 ` Greg Kroah-Hartman
0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2020-01-14 17:09 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby, linux-kernel; +Cc: Andy Shevchenko
Synchronize baud rate tables for better readability.
No functional change intended.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/tty/tty_baudrate.c | 24 +++++++++---------------
1 file changed, 9 insertions(+), 15 deletions(-)
diff --git a/drivers/tty/tty_baudrate.c b/drivers/tty/tty_baudrate.c
index f438eaa68246..eb6b07f079c8 100644
--- a/drivers/tty/tty_baudrate.c
+++ b/drivers/tty/tty_baudrate.c
@@ -17,8 +17,8 @@
* include/asm/termbits.h file.
*/
static const speed_t baud_table[] = {
- 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800,
- 9600, 19200, 38400, 57600, 115200, 230400, 460800,
+ 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400,
+ 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800,
#ifdef __sparc__
76800, 153600, 307200, 614400, 921600
#else
@@ -27,22 +27,16 @@ static const speed_t baud_table[] = {
#endif
};
-#ifndef __sparc__
static const tcflag_t baud_bits[] = {
- B0, B50, B75, B110, B134, B150, B200, B300, B600,
- B1200, B1800, B2400, B4800, B9600, B19200, B38400,
- B57600, B115200, B230400, B460800, B500000, B576000,
- B921600, B1000000, B1152000, B1500000, B2000000, B2500000,
- B3000000, B3500000, B4000000
-};
+ B0, B50, B75, B110, B134, B150, B200, B300, B600, B1200, B1800, B2400,
+ B4800, B9600, B19200, B38400, B57600, B115200, B230400, B460800,
+#ifdef __sparc__
+ B76800, B153600, B307200, B614400, B921600
#else
-static const tcflag_t baud_bits[] = {
- B0, B50, B75, B110, B134, B150, B200, B300, B600,
- B1200, B1800, B2400, B4800, B9600, B19200, B38400,
- B57600, B115200, B230400, B460800, B76800, B153600,
- B307200, B614400, B921600
-};
+ B500000, B576000, B921600, B1000000, B1152000, B1500000, B2000000,
+ B2500000, B3000000, B3500000, B4000000
#endif
+};
static int n_baud_table = ARRAY_SIZE(baud_table);
--
2.24.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v1] tty: baudrate: Synchronise baud_table[] and baud_bits[]
2020-01-14 17:09 [PATCH v1] tty: baudrate: Synchronise baud_table[] and baud_bits[] Andy Shevchenko
@ 2020-01-14 17:27 ` Greg Kroah-Hartman
2020-01-15 16:33 ` Andy Shevchenko
0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2020-01-14 17:27 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Jiri Slaby, linux-kernel
On Tue, Jan 14, 2020 at 07:09:17PM +0200, Andy Shevchenko wrote:
> Synchronize baud rate tables for better readability.
"Synchronize"? With what? Why? I'm all for cleaning up code, but this
just seems totally gratuitous.
We have whole serial drivers with _THOUSANDS_ of checkpatch issues, and
this is bothering you? :)
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1] tty: baudrate: Synchronise baud_table[] and baud_bits[]
2020-01-14 17:27 ` Greg Kroah-Hartman
@ 2020-01-15 16:33 ` Andy Shevchenko
2020-01-15 17:21 ` Greg Kroah-Hartman
0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2020-01-15 16:33 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Jiri Slaby, linux-kernel
On Tue, Jan 14, 2020 at 06:27:56PM +0100, Greg Kroah-Hartman wrote:
> On Tue, Jan 14, 2020 at 07:09:17PM +0200, Andy Shevchenko wrote:
> > Synchronize baud rate tables for better readability.
>
> "Synchronize"? With what?
Between each other. This SPARC thingy makes it's harder to follow.
> Why? I'm all for cleaning up code, but this
> just seems totally gratuitous.
Btw, while doing it I found that SPARC actually supports more baud rates than
defined in those arrays. Without this patch I would not (easily) notice that.
Should I also attach another patch and resend?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1] tty: baudrate: Synchronise baud_table[] and baud_bits[]
2020-01-15 16:33 ` Andy Shevchenko
@ 2020-01-15 17:21 ` Greg Kroah-Hartman
2020-01-15 22:38 ` Andy Shevchenko
0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2020-01-15 17:21 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Jiri Slaby, linux-kernel
On Wed, Jan 15, 2020 at 06:33:27PM +0200, Andy Shevchenko wrote:
> On Tue, Jan 14, 2020 at 06:27:56PM +0100, Greg Kroah-Hartman wrote:
> > On Tue, Jan 14, 2020 at 07:09:17PM +0200, Andy Shevchenko wrote:
> > > Synchronize baud rate tables for better readability.
> >
> > "Synchronize"? With what?
>
> Between each other. This SPARC thingy makes it's harder to follow.
Ok, be more specific please, a better changelog is key here.
> > Why? I'm all for cleaning up code, but this
> > just seems totally gratuitous.
>
> Btw, while doing it I found that SPARC actually supports more baud rates than
> defined in those arrays. Without this patch I would not (easily) notice that.
> Should I also attach another patch and resend?
Yes, that might justify this patch's acceptance :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1] tty: baudrate: Synchronise baud_table[] and baud_bits[]
2020-01-15 17:21 ` Greg Kroah-Hartman
@ 2020-01-15 22:38 ` Andy Shevchenko
0 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2020-01-15 22:38 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Jiri Slaby, linux-kernel
On Wed, Jan 15, 2020 at 06:21:06PM +0100, Greg Kroah-Hartman wrote:
> On Wed, Jan 15, 2020 at 06:33:27PM +0200, Andy Shevchenko wrote:
> > On Tue, Jan 14, 2020 at 06:27:56PM +0100, Greg Kroah-Hartman wrote:
> > > On Tue, Jan 14, 2020 at 07:09:17PM +0200, Andy Shevchenko wrote:
> > > > Synchronize baud rate tables for better readability.
> > >
> > > "Synchronize"? With what?
> >
> > Between each other. This SPARC thingy makes it's harder to follow.
>
> Ok, be more specific please, a better changelog is key here.
>
> > > Why? I'm all for cleaning up code, but this
> > > just seems totally gratuitous.
> >
> > Btw, while doing it I found that SPARC actually supports more baud rates than
> > defined in those arrays. Without this patch I would not (easily) notice that.
> > Should I also attach another patch and resend?
>
> Yes, that might justify this patch's acceptance :)
Done in v2.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-01-15 22:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-14 17:09 [PATCH v1] tty: baudrate: Synchronise baud_table[] and baud_bits[] Andy Shevchenko
2020-01-14 17:27 ` Greg Kroah-Hartman
2020-01-15 16:33 ` Andy Shevchenko
2020-01-15 17:21 ` Greg Kroah-Hartman
2020-01-15 22:38 ` Andy Shevchenko
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).