From: Andrew Lunn <andrew@lunn.ch>
To: gregkh@suse.de
Cc: b.a.t.m.a.n@lists.open-mesh.net
Subject: [B.A.T.M.A.N.] [PATCH 07/17] Staging: batman-adv: Fixes rounding issues in vis.c
Date: Sat, 2 Jan 2010 11:30:42 +0100 [thread overview]
Message-ID: <1262428252-26439-7-git-send-email-andrew@lunn.ch> (raw)
In-Reply-To: <1262428252-26439-6-git-send-email-andrew@lunn.ch>
From: Linus Lüssing <linus.luessing@web.de>
This patches fixes two rounding issues in vis.c for sending and
purging vis packets. Before, the timers and timeouts always got
rounded down to seconds, though we want a precision in
milliseconds.
This also fixes a kernel panic that occures when lowering the
timer for sending vis packets (vis_interval) to less than 1000ms
in main.c manually.
Signed-off-by: Linus Lüssing <linus.luessing@web.de>
Acked-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
drivers/staging/batman-adv/vis.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/batman-adv/vis.c b/drivers/staging/batman-adv/vis.c
index ac7c7c5..0eb23d2 100644
--- a/drivers/staging/batman-adv/vis.c
+++ b/drivers/staging/batman-adv/vis.c
@@ -377,7 +377,7 @@ static void purge_vis_packets(void)
if (info == my_vis_info) /* never purge own data. */
continue;
if (time_after(jiffies,
- info->first_seen + (VIS_TIMEOUT/1000)*HZ)) {
+ info->first_seen + (VIS_TIMEOUT*HZ)/1000)) {
hash_remove_bucket(vis_hash, &hashit);
free_info(info);
}
@@ -556,5 +556,5 @@ void vis_quit(void)
static void start_vis_timer(void)
{
queue_delayed_work(bat_event_workqueue, &vis_timer_wq,
- (atomic_read(&vis_interval)/1000) * HZ);
+ (atomic_read(&vis_interval) * HZ) / 1000);
}
--
1.6.5.7
next prev parent reply other threads:[~2010-01-02 10:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-02 10:30 [B.A.T.M.A.N.] [PATCH 01/17] Staging: batman-adv: Remove NULL pointer check Andrew Lunn
2010-01-02 10:30 ` [B.A.T.M.A.N.] [PATCH 02/17] Staging: batman-adv: update README for latest kernel Andrew Lunn
2010-01-02 10:30 ` [B.A.T.M.A.N.] [PATCH 03/17] Staging: batman-adv: Replace KERN_DEBUG with bat_dbg Andrew Lunn
2010-01-02 10:30 ` [B.A.T.M.A.N.] [PATCH 04/17] Staging: batman-adv: initialize static hash iterators Andrew Lunn
2010-01-02 10:30 ` [B.A.T.M.A.N.] [PATCH 05/17] Staging: batman-adv: consistent spelling of "neighbors" Andrew Lunn
2010-01-02 10:30 ` [B.A.T.M.A.N.] [PATCH 06/17] Staging: batman-adv: Use forw_bcast_list_lock always with disabled interrupts Andrew Lunn
2010-01-02 10:30 ` Andrew Lunn [this message]
2010-01-02 10:30 ` [B.A.T.M.A.N.] [PATCH 08/17] Staging: batman-adv: fix minor orig table layout bug Andrew Lunn
2010-01-02 10:30 ` [B.A.T.M.A.N.] [PATCH 09/17] Staging: batman-adv: moving vis output formats out of the kernel Andrew Lunn
2010-01-02 10:30 ` [B.A.T.M.A.N.] [PATCH 10/17] Staging: batman-adv: remove obsoleted vis_format /proc file Andrew Lunn
2010-01-02 10:30 ` [B.A.T.M.A.N.] [PATCH 11/17] Staging: batman-adv: splitting /proc vis file into vis_server and vis_data Andrew Lunn
2010-01-02 10:30 ` [B.A.T.M.A.N.] [PATCH 12/17] Staging: batman-adv: check all kmalloc()s Andrew Lunn
2010-01-02 10:30 ` [B.A.T.M.A.N.] [PATCH 13/17] Staging: batman-adv: receive packets directly using skbs Andrew Lunn
2010-01-02 10:30 ` [B.A.T.M.A.N.] [PATCH 14/17] Staging: batman-adv: Allow the MAC address to be set Andrew Lunn
2010-01-02 10:30 ` [B.A.T.M.A.N.] [PATCH 15/17] Staging: batman-adv: Use printk(%pM) for MAC addresses Andrew Lunn
2010-01-02 10:30 ` [B.A.T.M.A.N.] [PATCH 16/17] Staging: batman-adv: Remove compat.h Andrew Lunn
2010-01-02 10:30 ` [B.A.T.M.A.N.] [PATCH 17/17] Staging: batman-adv: Dont deactivate aggregation on wrong input Andrew Lunn
2010-01-05 22:40 ` [B.A.T.M.A.N.] [PATCH 02/17] Staging: batman-adv: update README for latest kernel Greg KH
2010-01-06 6:22 ` Andrew Lunn
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=1262428252-26439-7-git-send-email-andrew@lunn.ch \
--to=andrew@lunn.ch \
--cc=b.a.t.m.a.n@lists.open-mesh.net \
--cc=gregkh@suse.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;
as well as URLs for NNTP newsgroup(s).