]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Staging: batman-adv: replace manual calculation by msecs_to_jiffies() for better...
authorMarek Lindner <lindner_marek@yahoo.de>
Fri, 25 Jun 2010 22:28:21 +0000 (00:28 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 8 Jul 2010 19:17:32 +0000 (12:17 -0700)
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/batman-adv/send.c

index 8059adbe48dac4dee876289428147b89de04fc54..d4b92ef4b4d32e2df0b9293ceca8555662a063b5 100644 (file)
@@ -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