diff --git a/compat.h b/compat.h index a050bb8..fe64820 100644 --- a/compat.h +++ b/compat.h @@ -153,7 +153,14 @@ static inline int batadv_param_set_copystring(const char *val, #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) /* cast last argument of strict_strtoul() because we have a uint32_t */ -#define kstrtou32(cp, base, v) strict_strtoul(cp, base, (unsigned long *)v) +#define kstrtou32(cp, base, v) \ +({\ + unsigned long _v;\ + int _r;\ + _r = strict_strtoul(cp, base, _v);\ + v = (uint32_t)_v;\ + _r;\ +}) #define kstrtoul strict_strtoul #define kstrtol strict_strtol