Skip to content

Commit

Permalink
Merge tag 'batadv-next-for-davem-20200427' of git://git.open-mesh.org…
Browse files Browse the repository at this point in the history
…/linux-merge

Simon Wunderlich says:

====================
This cleanup patchset includes the following patches:

 - bump version strings, by Simon Wunderlich

 - fix spelling error, by Sven Eckelmann

 - drop unneeded types.h include, by Sven Eckelmann

 - change random number generation to prandom_u32_max(),
   by Sven Eckelmann

 - remove unused function batadv_arp_change_timeout(), by Yue Haibing
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Apr 27, 2020
2 parents 19f1f46 + e73f94d commit a21643c
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 13 deletions.
4 changes: 2 additions & 2 deletions net/batman-adv/bat_iv_ogm.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,15 @@ batadv_iv_ogm_emit_send_time(const struct batadv_priv *bat_priv)
unsigned int msecs;

msecs = atomic_read(&bat_priv->orig_interval) - BATADV_JITTER;
msecs += prandom_u32() % (2 * BATADV_JITTER);
msecs += prandom_u32_max(2 * BATADV_JITTER);

return jiffies + msecs_to_jiffies(msecs);
}

/* when do we schedule a ogm packet to be sent */
static unsigned long batadv_iv_ogm_fwd_send_time(void)
{
return jiffies + msecs_to_jiffies(prandom_u32() % (BATADV_JITTER / 2));
return jiffies + msecs_to_jiffies(prandom_u32_max(BATADV_JITTER / 2));
}

/* apply hop penalty for a normal link */
Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/bat_v_elp.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static void batadv_v_elp_start_timer(struct batadv_hard_iface *hard_iface)
unsigned int msecs;

msecs = atomic_read(&hard_iface->bat_v.elp_interval) - BATADV_JITTER;
msecs += prandom_u32() % (2 * BATADV_JITTER);
msecs += prandom_u32_max(2 * BATADV_JITTER);

queue_delayed_work(batadv_event_workqueue, &hard_iface->bat_v.elp_wq,
msecs_to_jiffies(msecs));
Expand Down
4 changes: 2 additions & 2 deletions net/batman-adv/bat_v_ogm.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static void batadv_v_ogm_start_queue_timer(struct batadv_hard_iface *hard_iface)
unsigned int msecs = BATADV_MAX_AGGREGATION_MS * 1000;

/* msecs * [0.9, 1.1] */
msecs += prandom_u32() % (msecs / 5) - (msecs / 10);
msecs += prandom_u32_max(msecs / 5) - (msecs / 10);
queue_delayed_work(batadv_event_workqueue, &hard_iface->bat_v.aggr_wq,
msecs_to_jiffies(msecs / 1000));
}
Expand All @@ -107,7 +107,7 @@ static void batadv_v_ogm_start_timer(struct batadv_priv *bat_priv)
return;

msecs = atomic_read(&bat_priv->orig_interval) - BATADV_JITTER;
msecs += prandom_u32() % (2 * BATADV_JITTER);
msecs += prandom_u32_max(2 * BATADV_JITTER);
queue_delayed_work(batadv_event_workqueue, &bat_priv->bat_v.ogm_wq,
msecs_to_jiffies(msecs));
}
Expand Down
5 changes: 0 additions & 5 deletions net/batman-adv/distributed-arp-table.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,6 @@ static inline void batadv_dat_init_own_addr(struct batadv_priv *bat_priv,
{
}

static inline void batadv_arp_change_timeout(struct net_device *soft_iface,
const char *name)
{
}

static inline int batadv_dat_init(struct batadv_priv *bat_priv)
{
return 0;
Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#define BATADV_DRIVER_DEVICE "batman-adv"

#ifndef BATADV_SOURCE_VERSION
#define BATADV_SOURCE_VERSION "2020.1"
#define BATADV_SOURCE_VERSION "2020.2"
#endif

/* B.A.T.M.A.N. parameters */
Expand Down
1 change: 0 additions & 1 deletion net/batman-adv/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <linux/percpu.h>
#include <linux/printk.h>
#include <linux/tracepoint.h>
#include <linux/types.h>

#undef TRACE_SYSTEM
#define TRACE_SYSTEM batadv
Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ struct batadv_priv_bla {
* struct batadv_priv_debug_log - debug logging data
*/
struct batadv_priv_debug_log {
/** @log_buff: buffer holding the logs (ring bufer) */
/** @log_buff: buffer holding the logs (ring buffer) */
char log_buff[BATADV_LOG_BUF_LEN];

/** @log_start: index of next character to read */
Expand Down

0 comments on commit a21643c

Please sign in to comment.