Lines Matching defs:base
26 const char *_parse_integer_fixup_radix(const char *s, unsigned int *base)
28 if (*base == 0) {
31 *base = 16;
33 *base = 8;
35 *base = 10;
37 if (*base == 16 && s[0] == '0' && _tolower(s[1]) == 'x')
52 unsigned int _parse_integer_limit(const char *s, unsigned int base, unsigned long long *p,
72 if (val >= base)
76 * it in the max base we support (16)
79 if (res > div_u64(ULLONG_MAX - val, base))
82 res = res * base + val;
91 unsigned int _parse_integer(const char *s, unsigned int base, unsigned long long *p)
93 return _parse_integer_limit(s, base, p, INT_MAX);
96 static int _kstrtoull(const char *s, unsigned int base, unsigned long long *res)
101 s = _parse_integer_fixup_radix(s, &base);
102 rv = _parse_integer(s, base, &_res);
121 * @base: The number base to use. The maximum supported base is 16. If base is
122 * given as 0, then the base of the string is automatically detected with the
132 int kstrtoull(const char *s, unsigned int base, unsigned long long *res)
136 return _kstrtoull(s, base, res);
145 * @base: The number base to use. The maximum supported base is 16. If base is
146 * given as 0, then the base of the string is automatically detected with the
156 int kstrtoll(const char *s, unsigned int base, long long *res)
162 rv = _kstrtoull(s + 1, base, &tmp);
169 rv = kstrtoull(s, base, &tmp);
181 int _kstrtoul(const char *s, unsigned int base, unsigned long *res)
186 rv = kstrtoull(s, base, &tmp);
197 int _kstrtol(const char *s, unsigned int base, long *res)
202 rv = kstrtoll(s, base, &tmp);
217 * @base: The number base to use. The maximum supported base is 16. If base is
218 * given as 0, then the base of the string is automatically detected with the
228 int kstrtouint(const char *s, unsigned int base, unsigned int *res)
233 rv = kstrtoull(s, base, &tmp);
248 * @base: The number base to use. The maximum supported base is 16. If base is
249 * given as 0, then the base of the string is automatically detected with the
259 int kstrtoint(const char *s, unsigned int base, int *res)
264 rv = kstrtoll(s, base, &tmp);
275 int kstrtou16(const char *s, unsigned int base, u16 *res)
280 rv = kstrtoull(s, base, &tmp);
291 int kstrtos16(const char *s, unsigned int base, s16 *res)
296 rv = kstrtoll(s, base, &tmp);
307 int kstrtou8(const char *s, unsigned int base, u8 *res)
312 rv = kstrtoull(s, base, &tmp);
323 int kstrtos8(const char *s, unsigned int base, s8 *res)
328 rv = kstrtoll(s, base, &tmp);
392 * Since "base" would be a nonsense argument, this open-codes the
409 int f(const char __user *s, size_t count, unsigned int base, type *res) \
411 /* sign, base 2 representation, newline, terminator */ \
418 return g(buf, base, res); \