Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
commit 194b581c677d267ce71b9bcd86fa1642a5e9e3d1 Author: Sven Eckelmann sven@narfation.org Date: Sun Jun 21 14:42:50 2015 +0200
batman-adv: Backport kstrtou64 for Linux < 2.6.39
Signed-off-by: Sven Eckelmann sven@narfation.org Signed-off-by: Marek Lindner mareklindner@neomailbox.ch
194b581c677d267ce71b9bcd86fa1642a5e9e3d1 compat-include/linux/kernel.h | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/compat-include/linux/kernel.h b/compat-include/linux/kernel.h index 2015f7f..663f9e9 100644 --- a/compat-include/linux/kernel.h +++ b/compat-include/linux/kernel.h @@ -36,6 +36,18 @@ _r = -ERANGE;\ _r;\ }) + +#define kstrtou64(cp, base, v)\ +({\ + unsigned long long _v;\ + int _r;\ + _r = strict_strtoull(cp, base, &_v);\ + *(v) = (uint64_t)_v;\ + if ((unsigned long long)*(v) != _v)\ + _r = -ERANGE;\ + _r;\ +}) + #define kstrtoul strict_strtoul #define kstrtol strict_strtol