From: Linus Lüssing Date: Fri, 25 Jun 2010 22:28:19 +0000 (+0200) Subject: Staging: batman-adv: Avoid rounding issues for local hna timeout X-Git-Tag: firefly_0821_release~9833^2~1255^2~1^2~305 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a14ca61d418433b9e38b0978ceb272191377475b;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Sven Eckelmann Signed-off-by: Greg Kroah-Hartman --- 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");