Re: [2.6.19 patch] drivers/char/specialix.c: fix the baud conversion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Attachment: pgpIEzFIza2qA.pgp
Description: PGP signature


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux