mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Tollef Fog Heen <tfheen@err.no>
Cc: linux-kernel@vger.kernel.org, werner@cornelius-consult.de,
	frank@kingswood-consulting.co.uk
Subject: Re: [PATCH] Winchiphead 340/1: full baud rate and status/control line support
Date: Sun, 4 Jan 2009 12:16:52 +0000	[thread overview]
Message-ID: <20090104121652.35a33c4c@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <87iqovs740.fsf@qurzaw.linpro.no>

> +	if (factor > 0xfff0) { /* Clamp */
> +		factor = 0xfff0;
> +		divisor = 0;
> +	}
> +
> +	t1 = factor;
> +	for (t2 = divisor; t2 <= CH341_BAUDBASE_DIVMAX; t2++)
> +		t1 >>= 3;
> +	baud = CH341_BAUDBASE_FACTOR / t1;
> +

Same question as before: Can baud really become zero at this point ? Also
for that matter what guarantees that t1 cannot become zero in this
computation ?


> +	if (baud && tty)
> +		tty_encode_baud_rate(tty, baud, baud);

The check for B0 (hangup) was done earlier (see set_termios). So if you
can end up with a requested baud rate being turned into 0 you need to
bump it up to 1. If not you don't need the test.


  reply	other threads:[~2009-01-04 12:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-04 10:22 Tollef Fog Heen
2009-01-04 12:16 ` Alan Cox [this message]
2009-01-04 21:15   ` Tollef Fog Heen
2009-01-04 21:18 ` Tollef Fog Heen
     [not found] <200807290254.m6T2sIBG010575@imap1.linux-foundation.org>
     [not found] ` <20080729104331.367fde6b@lxorguk.ukuu.org.uk>
2008-09-21  9:22   ` Tollef Fog Heen
2008-09-21 14:14     ` Alan Cox
2009-01-04 10:19       ` Tollef Fog Heen
2009-01-04 12:19         ` Alan Cox

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=20090104121652.35a33c4c@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=frank@kingswood-consulting.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tfheen@err.no \
    --cc=werner@cornelius-consult.de \
    /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

all inboxes | Powered by JetHome®