Skip to content

Commit

Permalink
Staging: batman-adv: replace manual calculation by msecs_to_jiffies()…
Browse files Browse the repository at this point in the history
… for better readability

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>
  • Loading branch information
Marek Lindner authored and Greg Kroah-Hartman committed Jul 8, 2010
1 parent a14ca61 commit b26b458
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/staging/batman-adv/send.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b26b458

Please sign in to comment.