Lines Matching defs:base

25 const char *_parse_integer_fixup_radix(const char *s, unsigned int *base)
27 if (*base == 0) {
30 *base = 16;
32 *base = 8;
34 *base = 10;
36 if (*base == 16 && s[0] == '0' && _tolower(s[1]) == 'x')
50 unsigned int _parse_integer_limit(const char *s, unsigned int base, unsigned long long *p,
70 if (val >= base)
74 * it in the max base we support (16)
77 if (res > div_u64(ULLONG_MAX - val, base))
80 res = res * base + val;
88 unsigned int _parse_integer(const char *s, unsigned int base, unsigned long long *p)
90 return _parse_integer_limit(s, base, p, INT_MAX);
93 static int _kstrtoull(const char *s, unsigned int base, unsigned long long *res)
98 s = _parse_integer_fixup_radix(s, &base);
99 rv = _parse_integer(s, base, &_res);
118 * @base: The number base to use. The maximum supported base is 16. If base is
119 * given as 0, then the base of the string is automatically detected with the
128 int kstrtoull(const char *s, unsigned int base, unsigned long long *res)
132 return _kstrtoull(s, base, res);
141 * @base: The number base to use. The maximum supported base is 16. If base is
142 * given as 0, then the base of the string is automatically detected with the
151 int kstrtoll(const char *s, unsigned int base, long long *res)
157 rv = _kstrtoull(s + 1, base, &tmp);
164 rv = kstrtoull(s, base, &tmp);
176 int _kstrtoul(const char *s, unsigned int base, unsigned long *res)
181 rv = kstrtoull(s, base, &tmp);
192 int _kstrtol(const char *s, unsigned int base, long *res)
197 rv = kstrtoll(s, base, &tmp);
212 * @base: The number base to use. The maximum supported base is 16. If base is
213 * given as 0, then the base of the string is automatically detected with the
222 int kstrtouint(const char *s, unsigned int base, unsigned int *res)
227 rv = kstrtoull(s, base, &tmp);
242 * @base: The number base to use. The maximum supported base is 16. If base is
243 * given as 0, then the base of the string is automatically detected with the
252 int kstrtoint(const char *s, unsigned int base, int *res)
257 rv = kstrtoll(s, base, &tmp);
267 int kstrtou16(const char *s, unsigned int base, u16 *res)
272 rv = kstrtoull(s, base, &tmp);
282 int kstrtos16(const char *s, unsigned int base, s16 *res)
287 rv = kstrtoll(s, base, &tmp);
297 int kstrtou8(const char *s, unsigned int base, u8 *res)
302 rv = kstrtoull(s, base, &tmp);
312 int kstrtos8(const char *s, unsigned int base, s8 *res)
317 rv = kstrtoll(s, base, &tmp);
375 * Since "base" would be a nonsense argument, this open-codes the
392 int f(const char __user *s, size_t count, unsigned int base, type *res) \
394 /* sign, base 2 representation, newline, terminator */ \
401 return g(buf, base, res); \