public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org, R.E.Wolff@BitWizard.nl
Subject: drivers/char/specialix.c: broken baud conversion
Date: Mon, 9 Oct 2006 00:18:19 +0200	[thread overview]
Message-ID: <20061008221818.GL6755@stusta.de> (raw)

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


             reply	other threads:[~2006-10-08 22:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-08 22:18 Adrian Bunk [this message]
2006-10-09  6:37 ` drivers/char/specialix.c: broken baud conversion 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061008221818.GL6755@stusta.de \
    --to=bunk@stusta.de \
    --cc=R.E.Wolff@BitWizard.nl \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox