From: Jerry Van Baren <gerald.vanbaren@ge.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Round the serial port clock divisor valuereturned by calc_divisor()
Date: Fri, 11 Jul 2008 11:13:21 -0400 [thread overview]
Message-ID: <48777891.9000709@ge.com> (raw)
In-Reply-To: <42848A5C5A0D1E47B026E644DD49B08E0284BE71@mail>
Hugo Villeneuve wrote:
> u-boot-users-bounces at lists.sourceforge.net wrote:
>> This formula is better at avoiding integer overflow.
>
> This patch doesn?t round the value correctly.
>
> Wolfgang, I will resubmit a new patch shortly today to fix the problem.
>
> Hugo V.
Arrgh, you are right. I know you solved it already, but for the record
I oversimplified:
(gd->baudrate / 2)
should have been:
(gd->baudrate * (MODE_X_DIV / 2))
WRONG:
+ return (CFG_NS16550_CLK + (gd->baudrate / 2)) /
+ (MODE_X_DIV * gd->baudrate);
should have been
+ return (CFG_NS16550_CLK + (gd->baudrate * (MODE_X_DIV / 2))) /
+ (MODE_X_DIV * gd->baudrate);
Sorry,
gvb
prev parent reply other threads:[~2008-07-11 15:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-11 1:25 [U-Boot-Users] [PATCH] Round the serial port clock divisor value returned by calc_divisor() Jerry Van Baren
2008-07-11 13:49 ` [U-Boot-Users] [PATCH] Round the serial port clock divisor valuereturned " Hugo Villeneuve
2008-07-11 15:13 ` Jerry Van Baren [this message]
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=48777891.9000709@ge.com \
--to=gerald.vanbaren@ge.com \
--cc=u-boot@lists.denx.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