Lines Matching defs:base

118  * @base: The number base to use
120 unsigned long long simple_strtoull(const char *cp, char **endp, unsigned int base)
124 if (!base)
125 base = simple_guess_base(cp);
127 if (base == 16 && cp[0] == '0' && TOLOWER(cp[1]) == 'x')
134 if (value >= base)
136 result = result * base + value;
145 long simple_strtol(const char *cp, char **endp, unsigned int base)
148 return -simple_strtoull(cp + 1, endp, base);
150 return simple_strtoull(cp, endp, base);
232 static const char *_parse_integer_fixup_radix(const char *s, unsigned int *base)
234 if (*base == 0) {
237 *base = 16;
239 *base = 8;
241 *base = 10;
243 if (*base == 16 && s[0] == '0' && _tolower(s[1]) == 'x')
257 unsigned int base,
277 if (val >= base)
281 * it in the max base we support (16)
284 if (res > __div_u64(ULLONG_MAX - val, base))
287 res = res * base + val;
295 static int _kstrtoull(const char *s, unsigned int base, unsigned long long *res)
300 s = _parse_integer_fixup_radix(s, &base);
301 rv = _parse_integer(s, base, &_res);
320 * @base: The number base to use. The maximum supported base is 16. If base is
321 * given as 0, then the base of the string is automatically detected with the
331 int kstrtoull(const char *s, unsigned int base, unsigned long long *res)
335 return _kstrtoull(s, base, res);
338 static int _kstrtoul(const char *s, unsigned int base, unsigned long *res)
343 rv = kstrtoull(s, base, &tmp);
357 * @base: The number base to use. The maximum supported base is 16. If base is
358 * given as 0, then the base of the string is automatically detected with the
367 int boot_kstrtoul(const char *s, unsigned int base, unsigned long *res)
375 return kstrtoull(s, base, (unsigned long long *)res);
377 return _kstrtoul(s, base, res);