From: Steven Miao <realmz6@gmail.com>
To: <wg@grandegger.com>, <mkl@pengutronix.de>
Cc: Steven Miao <realmz6@gmail.com>,
"open list:CAN NETWORK DRIVERS" <linux-can@vger.kernel.org>,
"open list:NETWORKING DRIVERS" <netdev@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: [PATCH] socket-can: bit-timing calculation
Date: Mon, 16 Jan 2012 18:50:24 +0800 [thread overview]
Message-ID: <1326711025-6629-1-git-send-email-realmz6@gmail.com> (raw)
just use first found best bit rate prescaler
Signed-off-by: Steven Miao <realmz6@gmail.com>
---
drivers/net/can/dev.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index 25695bd..9d4afe6 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -106,7 +106,7 @@ static int can_calc_bittiming(struct net_device *dev, struct can_bittiming *bt)
/* tseg brp biterror */
if (error < 0)
error = -error;
- if (error > best_error)
+ if (error >= best_error)
continue;
best_error = error;
if (error == 0) {
--
1.7.0.4
next reply other threads:[~2012-01-16 10:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-16 10:50 Steven Miao [this message]
[not found] ` <4F1538F1.8020508@grandegger.com>
[not found] ` <CAMk6uBnoQwuo2LwcSD4hucn9bM9vqEVNEM3L9PLqmX-BgD30iA@mail.gmail.com>
[not found] ` <4F153F16.8060603@grandegger.com>
[not found] ` <CAMk6uBn87VjAJPPXUSG6G6_21Ov1tT6k=NkENm+9ZhRnsXNExQ@mail.gmail.com>
[not found] ` <4F154A3C.3010502@grandegger.com>
[not found] ` <CAMk6uBmJ5DqE3BDtZQBpfbp0s7pC=j0JuVzgbxCPh-jWA76Ofw@mail.gmail.com>
[not found] ` <4F154CB1.4090307@pengutronix.de>
2012-01-17 14:34 ` [PATCH] socket-can: bit-timing calculation Marc Kleine-Budde
2012-01-18 4:45 ` realmz paranoid
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=1326711025-6629-1-git-send-email-realmz6@gmail.com \
--to=realmz6@gmail.com \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=wg@grandegger.com \
/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;
as well as URLs for NNTP newsgroup(s).