diff mbox series

batman-adv: compat: Fix prandom.h include for older LTS kernels

Message ID 20201015191009.34021-1-sven@narfation.org
State Accepted, archived
Delegated to: Simon Wunderlich
Headers show
Series batman-adv: compat: Fix prandom.h include for older LTS kernels | expand

Commit Message

Sven Eckelmann Oct. 15, 2020, 7:10 p.m. UTC
The longterm stable kernels 4.4.x and 4.9.x were missing the
linux/prandom.h for a long time but the commit c0842fbc1b18 ("random32:
move the pseudo-random 32-bit definitions to prandom.h") was recently
backported. Due to this change, it was no longer possible for batman-adv to
find the prandom_u32_max definition. This resulted in a build error:

  net/batman-adv/bat_iv_ogm.c:284:18: error: undefined identifier 'prandom_u32_max'
  net/batman-adv/bat_iv_ogm.c:292:43: error: undefined identifier 'prandom_u32_max'
  net/batman-adv/bat_iv_ogm.c: In function ‘batadv_iv_ogm_emit_send_time’:
  net/batman-adv/bat_iv_ogm.c:284:11: error: implicit declaration of function ‘prandom_u32_max’ [-Werror=implicit-function-declaration]
    msecs += prandom_u32_max(2 * BATADV_JITTER);

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 compat-include/linux/prandom.h | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/compat-include/linux/prandom.h b/compat-include/linux/prandom.h
index 2863a57d..9d30d2d9 100644
--- a/compat-include/linux/prandom.h
+++ b/compat-include/linux/prandom.h
@@ -12,6 +12,8 @@ 
 
 #include <linux/version.h>
 #if LINUX_VERSION_IS_GEQ(5, 8, 1) || \
+    (LINUX_VERSION_IS_GEQ(4, 4, 233) && LINUX_VERSION_IS_LESS(4, 5, 0)) || \
+    (LINUX_VERSION_IS_GEQ(4, 9, 233) && LINUX_VERSION_IS_LESS(4, 10, 0)) || \
     (LINUX_VERSION_IS_GEQ(4, 14, 193) && LINUX_VERSION_IS_LESS(4, 15, 0)) || \
     (LINUX_VERSION_IS_GEQ(4, 19, 138) && LINUX_VERSION_IS_LESS(4, 20, 0)) || \
     (LINUX_VERSION_IS_GEQ(5, 4, 57) && LINUX_VERSION_IS_LESS(5, 5, 0)) || \