Author: marek Date: 2010-06-20 12:22:29 +0200 (Sun, 20 Jun 2010) New Revision: 1713
Modified: trunk/batman-adv/send.c Log: batman-adv: replace manual calculation by msecs_to_jiffies() for better readability
Signed-off-by: Marek Lindner lindner_marek@yahoo.de
Modified: trunk/batman-adv/send.c =================================================================== --- trunk/batman-adv/send.c 2010-06-20 09:50:43 UTC (rev 1712) +++ trunk/batman-adv/send.c 2010-06-20 10:22:29 UTC (rev 1713) @@ -44,15 +44,15 @@ /* 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