Lines Matching +full:use +full:- +full:case

1 // SPDX-License-Identifier: GPL-2.0
4 * If an integer doesn't fit into specified type, -E is returned.
7 * kstrtou*() functions do not accept sign "-".
13 * If -E is returned, result is not touched.
43 * Convert non-negative integer string representation in explicitly given radix
46 * Return number of characters consumed maybe or-ed with overflow bit.
49 * Don't you dare use this function.
60 while (max_chars--) { in _parse_integer_limit()
66 val = c - '0'; in _parse_integer_limit()
68 val = lc - 'a' + 10; in _parse_integer_limit()
79 if (res > div_u64(ULLONG_MAX - val, base)) in _parse_integer_limit()
104 return -ERANGE; in _kstrtoull()
106 return -EINVAL; in _kstrtoull()
111 return -EINVAL; in _kstrtoull()
117 * kstrtoull - convert a string to an unsigned long long
118 * @s: The start of the string. The string must be null-terminated, and may also
121 * @base: The number base to use. The maximum supported base is 16. If base is
123 * conventional semantics - If it begins with 0x the number will be parsed as a
124 * hexadecimal (case insensitive), if it otherwise begins with 0, it will be
128 * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
141 * kstrtoll - convert a string to a long long
142 * @s: The start of the string. The string must be null-terminated, and may also
145 * @base: The number base to use. The maximum supported base is 16. If base is
147 * conventional semantics - If it begins with 0x the number will be parsed as a
148 * hexadecimal (case insensitive), if it otherwise begins with 0, it will be
152 * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
161 if (s[0] == '-') { in kstrtoll()
165 if ((long long)-tmp > 0) in kstrtoll()
166 return -ERANGE; in kstrtoll()
167 *res = -tmp; in kstrtoll()
173 return -ERANGE; in kstrtoll()
180 /* Internal, do not use. */
190 return -ERANGE; in _kstrtoul()
196 /* Internal, do not use. */
206 return -ERANGE; in _kstrtol()
213 * kstrtouint - convert a string to an unsigned int
214 * @s: The start of the string. The string must be null-terminated, and may also
217 * @base: The number base to use. The maximum supported base is 16. If base is
219 * conventional semantics - If it begins with 0x the number will be parsed as a
220 * hexadecimal (case insensitive), if it otherwise begins with 0, it will be
224 * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
237 return -ERANGE; in kstrtouint()
244 * kstrtoint - convert a string to an int
245 * @s: The start of the string. The string must be null-terminated, and may also
248 * @base: The number base to use. The maximum supported base is 16. If base is
250 * conventional semantics - If it begins with 0x the number will be parsed as a
251 * hexadecimal (case insensitive), if it otherwise begins with 0, it will be
255 * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
268 return -ERANGE; in kstrtoint()
284 return -ERANGE; in kstrtou16()
300 return -ERANGE; in kstrtos16()
316 return -ERANGE; in kstrtou8()
332 return -ERANGE; in kstrtos8()
339 * kstrtobool - convert common user inputs into boolean values
344 * [oO][NnFf] for "on" and "off". Otherwise it will return -EINVAL. Value
351 return -EINVAL; in kstrtobool()
354 case 'y': in kstrtobool()
355 case 'Y': in kstrtobool()
356 case 't': in kstrtobool()
357 case 'T': in kstrtobool()
358 case '1': in kstrtobool()
361 case 'n': in kstrtobool()
362 case 'N': in kstrtobool()
363 case 'f': in kstrtobool()
364 case 'F': in kstrtobool()
365 case '0': in kstrtobool()
368 case 'o': in kstrtobool()
369 case 'O': in kstrtobool()
371 case 'n': in kstrtobool()
372 case 'N': in kstrtobool()
375 case 'f': in kstrtobool()
376 case 'F': in kstrtobool()
387 return -EINVAL; in kstrtobool()
392 * Since "base" would be a nonsense argument, this open-codes the
400 count = min(count, sizeof(buf) - 1); in kstrtobool_from_user()
402 return -EFAULT; in kstrtobool_from_user()
414 count = min(count, sizeof(buf) - 1); \
416 return -EFAULT; \