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.
42 * Convert non-negative integer string representation in explicitly given radix
45 * Return number of characters consumed maybe or-ed with overflow bit.
48 * Don't you dare use this function.
58 while (max_chars--) { in _parse_integer_limit()
64 val = c - '0'; in _parse_integer_limit()
66 val = lc - 'a' + 10; in _parse_integer_limit()
77 if (res > div_u64(ULLONG_MAX - val, base)) in _parse_integer_limit()
101 return -ERANGE; in _kstrtoull()
103 return -EINVAL; in _kstrtoull()
108 return -EINVAL; in _kstrtoull()
114 * kstrtoull - convert a string to an unsigned long long
115 * @s: The start of the string. The string must be null-terminated, and may also
118 * @base: The number base to use. The maximum supported base is 16. If base is
120 * conventional semantics - If it begins with 0x the number will be parsed as a
121 * hexadecimal (case insensitive), if it otherwise begins with 0, it will be
125 * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
137 * kstrtoll - convert a string to a long long
138 * @s: The start of the string. The string must be null-terminated, and may also
141 * @base: The number base to use. The maximum supported base is 16. If base is
143 * conventional semantics - If it begins with 0x the number will be parsed as a
144 * hexadecimal (case insensitive), if it otherwise begins with 0, it will be
148 * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
156 if (s[0] == '-') { in kstrtoll()
160 if ((long long)-tmp > 0) in kstrtoll()
161 return -ERANGE; in kstrtoll()
162 *res = -tmp; in kstrtoll()
168 return -ERANGE; in kstrtoll()
175 /* Internal, do not use. */
185 return -ERANGE; in _kstrtoul()
191 /* Internal, do not use. */
201 return -ERANGE; in _kstrtol()
208 * kstrtouint - convert a string to an unsigned int
209 * @s: The start of the string. The string must be null-terminated, and may also
212 * @base: The number base to use. The maximum supported base is 16. If base is
214 * conventional semantics - If it begins with 0x the number will be parsed as a
215 * hexadecimal (case insensitive), if it otherwise begins with 0, it will be
219 * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
231 return -ERANGE; in kstrtouint()
238 * kstrtoint - convert a string to an int
239 * @s: The start of the string. The string must be null-terminated, and may also
242 * @base: The number base to use. The maximum supported base is 16. If base is
244 * conventional semantics - If it begins with 0x the number will be parsed as a
245 * hexadecimal (case insensitive), if it otherwise begins with 0, it will be
249 * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
261 return -ERANGE; in kstrtoint()
276 return -ERANGE; in kstrtou16()
291 return -ERANGE; in kstrtos16()
306 return -ERANGE; in kstrtou8()
321 return -ERANGE; in kstrtos8()
328 * kstrtobool - convert common user inputs into boolean values
333 * [oO][NnFf] for "on" and "off". Otherwise it will return -EINVAL. Value
339 return -EINVAL; in kstrtobool()
342 case 'y': in kstrtobool()
343 case 'Y': in kstrtobool()
344 case '1': in kstrtobool()
347 case 'n': in kstrtobool()
348 case 'N': in kstrtobool()
349 case '0': in kstrtobool()
352 case 'o': in kstrtobool()
353 case 'O': in kstrtobool()
355 case 'n': in kstrtobool()
356 case 'N': in kstrtobool()
359 case 'f': in kstrtobool()
360 case 'F': in kstrtobool()
371 return -EINVAL; in kstrtobool()
376 * Since "base" would be a nonsense argument, this open-codes the
384 count = min(count, sizeof(buf) - 1); in kstrtobool_from_user()
386 return -EFAULT; in kstrtobool_from_user()
398 count = min(count, sizeof(buf) - 1); \
400 return -EFAULT; \