summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Lüssing <linus.luessing@web.de>2010-06-26 00:28:19 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-07-08 12:17:31 -0700
commita14ca61d418433b9e38b0978ceb272191377475b (patch)
tree4f15a6122c4e1e766548d7cbef7c98110003baf1
parent6e0e9388b5cb0366e93915ab9d0d0bf12b09d5c2 (diff)
Staging: batman-adv: Avoid rounding issues for local hna timeout
With the current default values, this patch is not critical, as LOCAL_HNA_TIMEOUT is a multiple of 1000 anyway. However, if someone would like to change this #define, the person could have some unexpected rounding issues. Therefore doing the multiplication before the division now. Signed-off-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/batman-adv/translation-table.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/batman-adv/translation-table.c b/drivers/staging/batman-adv/translation-table.c
index 9fd32a979324..fdd902d25c7e 100644
--- a/drivers/staging/batman-adv/translation-table.c
+++ b/drivers/staging/batman-adv/translation-table.c
@@ -258,7 +258,7 @@ static void hna_local_purge(struct work_struct *work)
hna_local_entry = hashit.bucket->data;
timeout = hna_local_entry->last_seen +
- ((LOCAL_HNA_TIMEOUT / 1000) * HZ);
+ ((LOCAL_HNA_TIMEOUT * HZ) / 1000);
if ((!hna_local_entry->never_purge) &&
time_after(jiffies, timeout))
hna_local_del(hna_local_entry, "address timed out");