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.
41 * Convert non-negative integer string representation in explicitly given radix
43 * Return number of characters consumed maybe or-ed with overflow bit.
46 * Don't you dare use this function.
61 val = c - '0'; in _parse_integer()
63 val = lc - 'a' + 10; in _parse_integer()
74 if (res > div_u64(ULLONG_MAX - val, base)) in _parse_integer()
93 return -ERANGE; in _kstrtoull()
95 return -EINVAL; in _kstrtoull()
100 return -EINVAL; in _kstrtoull()
106 * kstrtoull - convert a string to an unsigned long long
107 * @s: The start of the string. The string must be null-terminated, and may also
110 * @base: The number base to use. The maximum supported base is 16. If base is
112 * conventional semantics - If it begins with 0x the number will be parsed as a
113 * hexadecimal (case insensitive), if it otherwise begins with 0, it will be
117 * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
129 * kstrtoll - convert a string to a long long
130 * @s: The start of the string. The string must be null-terminated, and may also
133 * @base: The number base to use. The maximum supported base is 16. If base is
135 * conventional semantics - If it begins with 0x the number will be parsed as a
136 * hexadecimal (case insensitive), if it otherwise begins with 0, it will be
140 * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
148 if (s[0] == '-') { in kstrtoll()
152 if ((long long)-tmp > 0) in kstrtoll()
153 return -ERANGE; in kstrtoll()
154 *res = -tmp; in kstrtoll()
160 return -ERANGE; in kstrtoll()
167 /* Internal, do not use. */
177 return -ERANGE; in _kstrtoul()
183 /* Internal, do not use. */
193 return -ERANGE; in _kstrtol()
200 * kstrtouint - convert a string to an unsigned int
201 * @s: The start of the string. The string must be null-terminated, and may also
204 * @base: The number base to use. The maximum supported base is 16. If base is
206 * conventional semantics - If it begins with 0x the number will be parsed as a
207 * hexadecimal (case insensitive), if it otherwise begins with 0, it will be
211 * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
223 return -ERANGE; in kstrtouint()
230 * kstrtoint - convert a string to an int
231 * @s: The start of the string. The string must be null-terminated, and may also
234 * @base: The number base to use. The maximum supported base is 16. If base is
236 * conventional semantics - If it begins with 0x the number will be parsed as a
237 * hexadecimal (case insensitive), if it otherwise begins with 0, it will be
241 * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
253 return -ERANGE; in kstrtoint()
268 return -ERANGE; in kstrtou16()
283 return -ERANGE; in kstrtos16()
298 return -ERANGE; in kstrtou8()
313 return -ERANGE; in kstrtos8()
320 * kstrtobool - convert common user inputs into boolean values
325 * [oO][NnFf] for "on" and "off". Otherwise it will return -EINVAL. Value
331 return -EINVAL; in kstrtobool()
334 case 'y': in kstrtobool()
335 case 'Y': in kstrtobool()
336 case '1': in kstrtobool()
339 case 'n': in kstrtobool()
340 case 'N': in kstrtobool()
341 case '0': in kstrtobool()
344 case 'o': in kstrtobool()
345 case 'O': in kstrtobool()
347 case 'n': in kstrtobool()
348 case 'N': in kstrtobool()
351 case 'f': in kstrtobool()
352 case 'F': in kstrtobool()
362 return -EINVAL; in kstrtobool()
367 * Since "base" would be a nonsense argument, this open-codes the
375 count = min(count, sizeof(buf) - 1); in kstrtobool_from_user()
377 return -EFAULT; in kstrtobool_from_user()
389 count = min(count, sizeof(buf) - 1); \
391 return -EFAULT; \