public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* drivers/char/specialix.c: broken baud conversion
@ 2006-10-08 22:18 Adrian Bunk
  2006-10-09  6:37 ` Rogier Wolff
  0 siblings, 1 reply; 5+ messages in thread
From: Adrian Bunk @ 2006-10-08 22:18 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel, R.E.Wolff

Hi Alan,

your commit commit 67cc0161ecc9ebee6eba4af6cbfdba028090b1b9
"specialix - remove private speed decoding" converted the variable baud 
from an index in the array baud_table[] to containing the baud value 
itself.

Unfortunately, it contains at least two bugs:


The Coverity checker spotted that the following line was forgotten:

           baud = (baud_table[baud] + 5) / 10;   /* Estimated CPS */

BTW: After the trivial fix, baud_table[] could be removed.


While looking at the patch, I noticed it contains another bug that is 
not that easy to fix:

-       if (baud == 15) {
+       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.


cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-10-11  4:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-08 22:18 drivers/char/specialix.c: broken baud conversion Adrian Bunk
2006-10-09  6:37 ` Rogier Wolff
2006-10-10  6:17   ` [2.6.19 patch] drivers/char/specialix.c: fix the " Adrian Bunk
2006-10-10 12:01     ` Rolf Eike Beer
2006-10-11  4:48       ` Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox