[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 10 Oct 2006 14:01:19 +0200
From: Rolf Eike Beer <eike-kernel@...tec.de>
To: Adrian Bunk <bunk@...sta.de>
Cc: Rogier Wolff <R.E.Wolff@...wizard.nl>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
linux-kernel@...r.kernel.org
Subject: Re: [2.6.19 patch] drivers/char/specialix.c: fix the baud conversion
Adrian Bunk wrote:
> On Mon, Oct 09, 2006 at 08:37:45AM +0200, Rogier Wolff wrote:
> > On Mon, Oct 09, 2006 at 12:18:19AM +0200, Adrian Bunk wrote:
> > > + if (baud == 38400) {
> > > if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
> > > baud ++;
> > > if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
> > > baud += 2;
> > > }
> > >
> > > Increasing the index for baud_table[] by 1 or 2 is quite different from
> > > increasing baud by 1 or 2.
> >
> > In that range,
> > baud <<= 1;
> > and
> > baud <<= 2;
> >
> > should work.
>
> Thanks for the hint.
>
> What about the patch below?
> @@ -1090,9 +1085,9 @@
>
> if (baud == 38400) {
> if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
> - baud ++;
> + baud <<= 1;
> if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
> - baud += 2;
> + baud <<= 2;
> }
>
> if (!baud) {
Neither is 38400 <<= 1 == 57600 nor is 38400 <<= 2 == 115200. You should just
set baud to the value you want instead of doing tricks here.
Eike
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists