From b26b45845b29d83e7537dcd16827a478f6cee346 Mon Sep 17 00:00:00 2001 From: Marek Lindner Date: Sat, 26 Jun 2010 00:28:21 +0200 Subject: [PATCH] Staging: batman-adv: replace manual calculation by msecs_to_jiffies() for better readability Signed-off-by: Marek Lindner Signed-off-by: Sven Eckelmann Signed-off-by: Greg Kroah-Hartman --- drivers/staging/batman-adv/send.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/batman-adv/send.c b/drivers/staging/batman-adv/send.c index 8059adbe48da..d4b92ef4b4d3 100644 --- a/drivers/staging/batman-adv/send.c +++ b/drivers/staging/batman-adv/send.c @@ -42,15 +42,15 @@ static uint8_t hop_penalty(const uint8_t tq) /* when do we schedule our own packet to be sent */ static unsigned long own_send_time(struct bat_priv *bat_priv) { - return jiffies + - (((atomic_read(&bat_priv->orig_interval) - JITTER + - (random32() % 2*JITTER)) * HZ) / 1000); + return jiffies + msecs_to_jiffies( + atomic_read(&bat_priv->orig_interval) - + JITTER + (random32() % 2*JITTER)); } /* when do we schedule a forwarded packet to be sent */ static unsigned long forward_send_time(struct bat_priv *bat_priv) { - return jiffies + (((random32() % (JITTER/2)) * HZ) / 1000); + return jiffies + msecs_to_jiffies(random32() % (JITTER/2)); } /* send out an already prepared packet to the given address via the -- 2.39.5