Commit a21643cf authored by David S. Miller's avatar David S. Miller

Merge tag 'batadv-next-for-davem-20200427' of git://git.open-mesh.org/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: default avatarDavid S. Miller <davem@davemloft.net>
parents 19f1f467 e73f94d1
...@@ -280,7 +280,7 @@ batadv_iv_ogm_emit_send_time(const struct batadv_priv *bat_priv) ...@@ -280,7 +280,7 @@ batadv_iv_ogm_emit_send_time(const struct batadv_priv *bat_priv)
unsigned int msecs; unsigned int msecs;
msecs = atomic_read(&bat_priv->orig_interval) - BATADV_JITTER; 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); return jiffies + msecs_to_jiffies(msecs);
} }
...@@ -288,7 +288,7 @@ batadv_iv_ogm_emit_send_time(const struct batadv_priv *bat_priv) ...@@ -288,7 +288,7 @@ batadv_iv_ogm_emit_send_time(const struct batadv_priv *bat_priv)
/* when do we schedule a ogm packet to be sent */ /* when do we schedule a ogm packet to be sent */
static unsigned long batadv_iv_ogm_fwd_send_time(void) 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 */ /* apply hop penalty for a normal link */
......
...@@ -49,7 +49,7 @@ static void batadv_v_elp_start_timer(struct batadv_hard_iface *hard_iface) ...@@ -49,7 +49,7 @@ static void batadv_v_elp_start_timer(struct batadv_hard_iface *hard_iface)
unsigned int msecs; unsigned int msecs;
msecs = atomic_read(&hard_iface->bat_v.elp_interval) - BATADV_JITTER; 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, queue_delayed_work(batadv_event_workqueue, &hard_iface->bat_v.elp_wq,
msecs_to_jiffies(msecs)); msecs_to_jiffies(msecs));
......
...@@ -88,7 +88,7 @@ static void batadv_v_ogm_start_queue_timer(struct batadv_hard_iface *hard_iface) ...@@ -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; unsigned int msecs = BATADV_MAX_AGGREGATION_MS * 1000;
/* msecs * [0.9, 1.1] */ /* 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, queue_delayed_work(batadv_event_workqueue, &hard_iface->bat_v.aggr_wq,
msecs_to_jiffies(msecs / 1000)); msecs_to_jiffies(msecs / 1000));
} }
...@@ -107,7 +107,7 @@ static void batadv_v_ogm_start_timer(struct batadv_priv *bat_priv) ...@@ -107,7 +107,7 @@ static void batadv_v_ogm_start_timer(struct batadv_priv *bat_priv)
return; return;
msecs = atomic_read(&bat_priv->orig_interval) - BATADV_JITTER; 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, queue_delayed_work(batadv_event_workqueue, &bat_priv->bat_v.ogm_wq,
msecs_to_jiffies(msecs)); msecs_to_jiffies(msecs));
} }
......
...@@ -163,11 +163,6 @@ static inline void batadv_dat_init_own_addr(struct batadv_priv *bat_priv, ...@@ -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) static inline int batadv_dat_init(struct batadv_priv *bat_priv)
{ {
return 0; return 0;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#define BATADV_DRIVER_DEVICE "batman-adv" #define BATADV_DRIVER_DEVICE "batman-adv"
#ifndef BATADV_SOURCE_VERSION #ifndef BATADV_SOURCE_VERSION
#define BATADV_SOURCE_VERSION "2020.1" #define BATADV_SOURCE_VERSION "2020.2"
#endif #endif
/* B.A.T.M.A.N. parameters */ /* B.A.T.M.A.N. parameters */
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <linux/percpu.h> #include <linux/percpu.h>
#include <linux/printk.h> #include <linux/printk.h>
#include <linux/tracepoint.h> #include <linux/tracepoint.h>
#include <linux/types.h>
#undef TRACE_SYSTEM #undef TRACE_SYSTEM
#define TRACE_SYSTEM batadv #define TRACE_SYSTEM batadv
......
...@@ -1086,7 +1086,7 @@ struct batadv_priv_bla { ...@@ -1086,7 +1086,7 @@ struct batadv_priv_bla {
* struct batadv_priv_debug_log - debug logging data * struct batadv_priv_debug_log - debug logging data
*/ */
struct batadv_priv_debug_log { 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]; char log_buff[BATADV_LOG_BUF_LEN];
/** @log_start: index of next character to read */ /** @log_start: index of next character to read */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment