* If -E is returned, result is not touched.
*/
#include <errno.h>
-#include <linux/ctype.h>
+#include <ctype.h>
#include <linux/kernel.h>
-#include <linux/math64.h>
-#include <linux/export.h>
#include <linux/types.h>
#include "kstrtox.h"
+#define KSTRTOX_OVERFLOW (1U << 31)
+
const char *_parse_integer_fixup_radix(const char *s, unsigned int *base)
{
if (*base == 0) {
* it in the max base we support (16)
*/
if (unlikely(res & (~0ull << 60))) {
- if (res > div_u64(ULLONG_MAX - val, base))
+ if (res > ULLONG_MAX - val / base)
overflow = 1;
}
res = res * base + val;
s++;
return _kstrtoull(s, base, res);
}
-EXPORT_SYMBOL(kstrtoull);
/**
* kstrtoll - convert a string to a long long
}
return 0;
}
-EXPORT_SYMBOL(kstrtoll);
/* Internal, do not use. */
int _kstrtoul(const char *s, unsigned int base, unsigned long *res)
*res = tmp;
return 0;
}
-EXPORT_SYMBOL(_kstrtoul);
/* Internal, do not use. */
int _kstrtol(const char *s, unsigned int base, long *res)
*res = tmp;
return 0;
}
-EXPORT_SYMBOL(_kstrtol);
/**
* kstrtouint - convert a string to an unsigned int
*res = tmp;
return 0;
}
-EXPORT_SYMBOL(kstrtouint);
/**
* kstrtoint - convert a string to an int
*res = tmp;
return 0;
}
-EXPORT_SYMBOL(kstrtoint);
int kstrtou16(const char *s, unsigned int base, u16 *res)
{
*res = tmp;
return 0;
}
-EXPORT_SYMBOL(kstrtou16);
int kstrtos16(const char *s, unsigned int base, s16 *res)
{
*res = tmp;
return 0;
}
-EXPORT_SYMBOL(kstrtos16);
int kstrtou8(const char *s, unsigned int base, u8 *res)
{
*res = tmp;
return 0;
}
-EXPORT_SYMBOL(kstrtou8);
int kstrtos8(const char *s, unsigned int base, s8 *res)
{
*res = tmp;
return 0;
}
-EXPORT_SYMBOL(kstrtos8);
/**
* kstrtobool - convert common user inputs into boolean values
return -EINVAL;
}
-EXPORT_SYMBOL(kstrtobool);