Re: [PATCH stable v2 2/2] termios, tty/tty_baudrate.c: simplify, auto-generate baud table

From: H. Peter Anvin
Date: Mon Oct 08 2018 - 13:30:29 EST


This is a multi-part message in MIME format.On 10/8/18 8:46 AM, Johan Hovold wrote:
>
> So we need a minimal fix for this only as this patch in particular
> should not be backported to stable.
>
> I'm not sure when I'll have time to review this one thoroughly, so
> perhaps others can chime in meanwhile.
>
> Johan
>

OK. In the past Greg has generally liked to avoid fixes which will diverge
from upstream (because code in stable which is not in upstream can make
debugging difficult), but this is the minimal patch as requested; which to
apply is up to Greg.

As far as reviewing the cleanup patch, I strongly recommend:

a) Looking at the resulting file, not at the patch. Most of the code is simply
merging the input and output rate functions into a common help function,
and restructuring the code to that the utterly bizarre coding of a for loop
using a do { ... } while() loop with the initial condition set at variable
declaration(!!) far from the loop itself.
b) Examine bmacros.h after a build.
c) Build drivers/tty/tty_baudrate.s. You can directly examine the baud_table
and verify that it is, indeed, correct for whatever architecture you build.

-hpa