提交 b26b4584 编写于 作者: M Marek Lindner 提交者: Greg Kroah-Hartman

Staging: batman-adv: replace manual calculation by msecs_to_jiffies() for better readability

Signed-off-by: NMarek Lindner <lindner_marek@yahoo.de>
Signed-off-by: NSven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 a14ca61d
...@@ -42,15 +42,15 @@ static uint8_t hop_penalty(const uint8_t tq) ...@@ -42,15 +42,15 @@ static uint8_t hop_penalty(const uint8_t tq)
/* when do we schedule our own packet to be sent */ /* when do we schedule our own packet to be sent */
static unsigned long own_send_time(struct bat_priv *bat_priv) static unsigned long own_send_time(struct bat_priv *bat_priv)
{ {
return jiffies + return jiffies + msecs_to_jiffies(
(((atomic_read(&bat_priv->orig_interval) - JITTER + atomic_read(&bat_priv->orig_interval) -
(random32() % 2*JITTER)) * HZ) / 1000); JITTER + (random32() % 2*JITTER));
} }
/* when do we schedule a forwarded packet to be sent */ /* when do we schedule a forwarded packet to be sent */
static unsigned long forward_send_time(struct bat_priv *bat_priv) 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 /* send out an already prepared packet to the given address via the
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册