Lines Matching +full:num +full:- +full:addresses

1 // SPDX-License-Identifier: GPL-2.0-only
8 /* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */
10 * Wirzenius wrote this portably, Torvalds fucked it up :-)
15 * - changed to provide snprintf and vsnprintf functions
17 * - scnprintf and vscnprintf
23 #include <linux/clk-provider.h>
65 prefix_chars = cp - startp; in simple_strntoull()
67 rv = _parse_integer_limit(cp, base, &result, max_chars - prefix_chars); in simple_strntoull()
82 * simple_strtoull - convert a string to an unsigned long long
97 * simple_strtoul - convert a string to an unsigned long
111 * simple_strtol - convert a string to a signed long
120 if (*cp == '-') in simple_strtol()
121 return -simple_strtoul(cp + 1, endp, base); in simple_strtol()
132 * case cp[0] == '-' && max_chars == 1. in simple_strntoll()
136 if (*cp == '-' && max_chars > 0) in simple_strntoll()
137 return -simple_strntoull(cp + 1, max_chars - 1, endp, base); in simple_strntoll()
143 * simple_strtoll - convert a string to a signed long long
162 i = i*10 + *((*s)++) - '0'; in skip_atoi()
179 * It turns out there is precisely one 26 bit fixed-point
181 * holds for all x in [0, 10^8-1], namely a = 0x28f5c29. The actual
185 * For dividing a number in the range [10^4, 10^6-1] by 100, we still
186 * need a 32x32->64 bit multiply, so we simply use the same constant.
188 * For dividing a number in the range [100, 10^4-1] by 100, there are
212 * below. All other callers pass a non-zero value of r.
225 *((u16 *)buf) = decpair[r - 100*q]; in put_dec_trunc8()
234 *((u16 *)buf) = decpair[q - 100*r]; in put_dec_trunc8()
243 *((u16 *)buf) = decpair[r - 100*q]; in put_dec_trunc8()
263 *((u16 *)buf) = decpair[r - 100*q]; in put_dec_full8()
268 *((u16 *)buf) = decpair[q - 100*r]; in put_dec_full8()
273 *((u16 *)buf) = decpair[r - 100*q]; in put_dec_full8()
303 *((u16 *)buf) = decpair[r - 100*q]; in put_dec_full4()
314 * (second call in the put_dec code, assuming n is all-ones).
321 put_dec_full4(buf, x - q * 10000); in put_dec_helper4()
328 * Performs no 64-bit division and hence should be fast on 32-bit machines.
358 else while (buf[-1] == '0') in put_dec()
359 --buf; in put_dec()
372 int num_to_str(char *buf, int size, unsigned long long num, unsigned int width) in num_to_str() argument
374 /* put_dec requires 2-byte alignment of the buffer. */ in num_to_str()
375 char tmp[sizeof(num) * 3] __aligned(2); in num_to_str()
378 /* put_dec() may work incorrectly for num = 0 (generate "", not "0") */ in num_to_str()
379 if (num <= 9) { in num_to_str()
380 tmp[0] = '0' + num; in num_to_str()
383 len = put_dec(tmp, num) - tmp; in num_to_str()
390 width = width - len; in num_to_str()
398 buf[idx + width] = tmp[len - idx - 1]; in num_to_str()
407 #define ZEROPAD 16 /* pad with zero, must be 16 == '0' - ' ' */
411 static_assert(ZEROPAD == ('0' - ' '));
445 #define FIELD_WIDTH_MAX ((1 << 23) - 1)
446 #define PRECISION_MAX ((1 << 15) - 1)
449 char *number(char *buf, char *end, unsigned long long num, in number() argument
452 /* put_dec requires 2-byte alignment of the buffer. */ in number()
453 char tmp[3 * sizeof(num)] __aligned(2); in number()
458 bool is_zero = num == 0LL; in number()
469 if ((signed long long)num < 0) { in number()
470 sign = '-'; in number()
471 num = -(signed long long)num; in number()
472 field_width--; in number()
475 field_width--; in number()
478 field_width--; in number()
483 field_width -= 2; in number()
485 field_width--; in number()
490 if (num < spec.base) in number()
491 tmp[i++] = hex_asc_upper[num] | locase; in number()
493 int mask = spec.base - 1; in number()
499 tmp[i++] = (hex_asc_upper[((unsigned char)num) & mask] | locase); in number()
500 num >>= shift; in number()
501 } while (num); in number()
503 i = put_dec(tmp, num) - tmp; in number()
510 field_width -= precision; in number()
512 while (--field_width >= 0) { in number()
541 while (--field_width >= 0) { in number()
548 while (i <= --precision) { in number()
554 while (--i >= 0) { in number()
560 while (--field_width >= 0) { in number()
570 char *special_hex_number(char *buf, char *end, unsigned long long num, int size) in special_hex_number() argument
578 spec.precision = -1; in special_hex_number()
580 return number(buf, end, num, spec); in special_hex_number()
588 size = end - buf; in move_right()
594 if (len > size - spaces) in move_right()
595 len = size - spaces; in move_right()
617 spaces = spec.field_width - n; in widen_string()
619 move_right(buf - n, end, n, spaces); in widen_string()
622 while (spaces--) { in widen_string()
637 while (lim--) { in string_nocheck()
659 * Somebody passed ERR_PTR(-1234) or some other non-existing in err_ptr()
660 * Efoo - or perhaps CONFIG_SYMBOLIC_ERRNAME=n. Fall back to in err_ptr()
677 if (spec.precision == -1) in error_string()
707 return -EFAULT; in check_pointer()
729 if (spec.field_width == -1) { in pointer_string()
784 } else if (ret == -EALREADY) { in initialize_ptr_random()
800 return -EAGAIN; in __ptr_to_hashval()
830 * as they are not actual addresses. in ptr_to_id()
835 /* When debugging early boot use non-cryptographically secure hash. */ in ptr_to_id()
859 /* Handle as %p, hash and do _not_ leak addresses. */ in restricted_pointer()
869 if (spec.field_width == -1) in restricted_pointer()
871 return error_string(buf, end, "pK-error", spec); in restricted_pointer()
885 !uid_eq(cred->euid, cred->uid) || in restricted_pointer()
886 !gid_eq(cred->egid, cred->gid)) in restricted_pointer()
911 depth = fmt[1] - '0'; in dentry_name()
924 p = READ_ONCE(d->d_parent); in dentry_name()
925 array[i] = READ_ONCE(d->d_name.name); in dentry_name()
933 s = array[--i]; in dentry_name()
940 s = array[--i]; in dentry_name()
956 return dentry_name(buf, end, f->f_path.dentry, spec, fmt); in file_dentry_name()
968 hd = bdev->bd_disk; in bdev_name()
969 buf = string(buf, end, hd->disk_name, spec); in bdev_name()
970 if (bdev->bd_partno) { in bdev_name()
971 if (isdigit(hd->disk_name[strlen(hd->disk_name)-1])) { in bdev_name()
976 buf = number(buf, end, bdev->bd_partno, spec); in bdev_name()
1014 .field_width = -1,
1015 .precision = -1,
1020 .precision = -1,
1026 .precision = -1,
1032 .precision = -1,
1039 .precision = -1,
1057 .precision = -1, in resource_string()
1063 .precision = -1, in resource_string()
1069 .precision = -1, in resource_string()
1073 .field_width = -1, in resource_string()
1078 /* 32-bit res (sizeof==4): 10 chars in dec, 10 in hex ("0x" + 8) in resource_string()
1079 * 64-bit res (sizeof==8): 20 chars in dec, 18 in hex ("0x" + 16) */ in resource_string()
1081 #define FLAG_BUF_SIZE (2 * sizeof(res->flags)) in resource_string()
1082 #define DECODED_BUF_SIZE sizeof("[mem - 64bit pref window disabled]") in resource_string()
1083 #define RAW_BUF_SIZE sizeof("[mem - flags 0x]") in resource_string()
1095 if (res->flags & IORESOURCE_IO) { in resource_string()
1098 } else if (res->flags & IORESOURCE_MEM) { in resource_string()
1101 } else if (res->flags & IORESOURCE_IRQ) { in resource_string()
1104 } else if (res->flags & IORESOURCE_DMA) { in resource_string()
1107 } else if (res->flags & IORESOURCE_BUS) { in resource_string()
1115 if (decode && res->flags & IORESOURCE_UNSET) { in resource_string()
1119 p = number(p, pend, res->start, *specp); in resource_string()
1120 if (res->start != res->end) { in resource_string()
1121 *p++ = '-'; in resource_string()
1122 p = number(p, pend, res->end, *specp); in resource_string()
1126 if (res->flags & IORESOURCE_MEM_64) in resource_string()
1128 if (res->flags & IORESOURCE_PREFETCH) in resource_string()
1130 if (res->flags & IORESOURCE_WINDOW) in resource_string()
1132 if (res->flags & IORESOURCE_DISABLED) in resource_string()
1136 p = number(p, pend, res->flags, default_flag_spec); in resource_string()
1164 separator = '-'; in hex_string()
1185 if (separator && i != len - 1) { in hex_string()
1210 chunksz = nr_bits & (CHUNKSZ - 1); in bitmap_string()
1214 i = ALIGN(nr_bits, CHUNKSZ) - CHUNKSZ; in bitmap_string()
1215 for (; i >= 0; i -= CHUNKSZ) { in bitmap_string()
1219 chunkmask = ((1ULL << chunksz) - 1); in bitmap_string()
1268 *buf = '-'; in bitmap_list_string()
1294 separator = '-'; in mac_address_string()
1308 p = hex_byte_pack(p, addr[5 - i]); in mac_address_string()
1335 step = -1; in ip4_string()
1340 step = -1; in ip4_string()
1351 int digits = put_dec_trunc8(temp, addr[index]) - temp; in ip4_string()
1359 while (digits--) in ip4_string()
1376 int colonpos = -1; in ip6_compressed_string()
1409 colonpos = -1; in ip6_compressed_string()
1418 i += longest - 1; in ip6_compressed_string()
1503 const u8 *addr = (const u8 *) &sa->sin6_addr; in ip6_addr_string_sa()
1540 p = number(p, pend, ntohs(sa->sin6_port), spec); in ip6_addr_string_sa()
1544 p = number(p, pend, ntohl(sa->sin6_flowinfo & in ip6_addr_string_sa()
1549 p = number(p, pend, sa->sin6_scope_id, spec); in ip6_addr_string_sa()
1563 const u8 *addr = (const u8 *) &sa->sin_addr.s_addr; in ip4_addr_string_sa()
1584 p = number(p, pend, ntohs(sa->sin_port), spec); in ip4_addr_string_sa()
1612 switch (sa->raw.sa_family) { in ip_addr_string()
1614 return ip4_addr_string_sa(buf, end, &sa->v4, spec, fmt); in ip_addr_string()
1616 return ip6_addr_string_sa(buf, end, &sa->v6, spec, fmt); in ip_addr_string()
1680 buf += string_escape_mem(addr, len, buf, buf < end ? end - buf : 0, flags, NULL); in escaped_string()
1693 va_copy(va, *va_fmt->va); in va_format()
1694 buf += vsnprintf(buf, end > buf ? end - buf : 0, va_fmt->fmt, va); in va_format()
1735 *p++ = '-'; in uuid_string()
1749 unsigned long long num; in netdev_bits() local
1757 num = *(const netdev_features_t *)addr; in netdev_bits()
1764 return special_hex_number(buf, end, num, size); in netdev_bits()
1771 char output[sizeof("0123 little-endian (0x01234567)")]; in fourcc_string()
1787 /* Print non-control ASCII characters as-is, dot otherwise */ in fourcc_string()
1791 strcpy(p, *fourcc & BIT(31) ? " big-endian" : " little-endian"); in fourcc_string()
1796 p = special_hex_number(p, output + sizeof(output) - 2, *fourcc, sizeof(u32)); in fourcc_string()
1807 unsigned long long num; in address_val() local
1815 num = *(const dma_addr_t *)addr; in address_val()
1820 num = *(const phys_addr_t *)addr; in address_val()
1825 return special_hex_number(buf, end, num, size); in address_val()
1831 int year = tm->tm_year + (r ? 0 : 1900); in date_str()
1832 int mon = tm->tm_mon + (r ? 0 : 1); in date_str()
1836 *buf = '-'; in date_str()
1841 *buf = '-'; in date_str()
1844 return number(buf, end, tm->tm_mday, default_dec02_spec); in date_str()
1850 buf = number(buf, end, tm->tm_hour, default_dec02_spec); in time_str()
1855 buf = number(buf, end, tm->tm_min, default_dec02_spec); in time_str()
1860 return number(buf, end, tm->tm_sec, default_dec02_spec); in time_str()
1977 for ( ; flags && names->name; names++) { in format_flags()
1978 mask = names->mask; in format_flags()
1982 buf = string(buf, end, names->name, default_str_spec); in format_flags()
2093 for (depth = fwnode_count_parents(fwnode); depth >= 0; depth--) { in fwnode_full_name_string()
2120 str_spec.field_width = -1; in device_node_string()
2152 str_spec.precision = strchrnul(p, '@') - p; in device_node_string()
2157 buf = number(buf, end, (unsigned int)dn->phandle, default_dec_spec); in device_node_string()
2159 case 'P': /* path-spec */ in device_node_string()
2166 tbuf[0] = of_node_check_flag(dn, OF_DYNAMIC) ? 'D' : '-'; in device_node_string()
2167 tbuf[1] = of_node_check_flag(dn, OF_DETACHED) ? 'd' : '-'; in device_node_string()
2168 tbuf[2] = of_node_check_flag(dn, OF_POPULATED) ? 'P' : '-'; in device_node_string()
2169 tbuf[3] = of_node_check_flag(dn, OF_POPULATED_BUS) ? 'B' : '-'; in device_node_string()
2195 return widen_string(buf, buf - buf_start, end, spec); in device_node_string()
2205 str_spec.field_width = -1; in fwnode_string()
2225 return widen_string(buf, buf - buf_start, end, spec); in fwnode_string()
2242 pr_warn("** This system shows unhashed kernel memory addresses **\n"); in no_hash_pointers_enable()
2267 * - 'S' For symbolic direct pointers (or function descriptors) with offset
2268 * - 's' For symbolic direct pointers (or function descriptors) without offset
2269 * - '[Ss]R' as above with __builtin_extract_return_addr() translation
2270 * - 'S[R]b' as above with module build ID (for use in backtraces)
2271 * - '[Ff]' %pf and %pF were obsoleted and later removed in favor of
2272 * %ps and %pS. Be careful when re-using these specifiers.
2273 * - 'B' For backtraced symbolic direct pointers with offset
2274 * - 'Bb' as above with module build ID (for use in backtraces)
2275 * - 'R' For decoded struct resource, e.g., [mem 0x0-0x1f 64bit pref]
2276 * - 'r' For raw struct resource, e.g., [mem 0x0-0x1f flags 0x201]
2277 * - 'b[l]' For a bitmap, the number of bits is determined by the field
2280 * range-list format instead of hex format
2281 * - 'M' For a 6-byte MAC address, it prints the address in the
2282 * usual colon-separated hex notation
2283 * - 'm' For a 6-byte MAC address, it prints the hex address without colons
2284 * - 'MF' For a 6-byte MAC FDDI address, it prints the address
2285 * with a dash-separated hex notation
2286 * - '[mM]R' For a 6-byte MAC address, Reverse order (Bluetooth)
2287 * - 'I' [46] for IPv4/IPv6 addresses printed in the usual way
2288 * IPv4 uses dot-separated decimal without leading 0's (1.2.3.4)
2289 * IPv6 uses colon separated network-order 16 bit hex with leading 0's
2293 * - 'i' [46] for 'raw' IPv4/IPv6 addresses
2295 * IPv4 uses dot-separated decimal with leading 0's (010.123.045.006)
2299 * - '[Ii][4S][hnbl]' IPv4 addresses in host, network, big or little endian order
2300 * - 'I[6S]c' for IPv6 addresses printed as specified by
2302 * - 'E[achnops]' For an escaped buffer, where rules are defined by combination
2305 * a - ESCAPE_ANY
2306 * c - ESCAPE_SPECIAL
2307 * h - ESCAPE_HEX
2308 * n - ESCAPE_NULL
2309 * o - ESCAPE_OCTAL
2310 * p - ESCAPE_NP
2311 * s - ESCAPE_SPACE
2313 * - 'U' For a 16 byte UUID/GUID, it prints the UUID/GUID in the form
2314 * "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
2321 * [0][1][2][3]-[4][5]-[6][7]-[8][9]-[10][11][12][13][14][15]
2323 * [3][2][1][0]-[5][4]-[7][6]-[8][9]-[10][11][12][13][14][15]
2324 * - 'V' For a struct va_format which contains a format string * and va_list *,
2325 * call vsnprintf(->format, *->va_list).
2329 * - 'K' For a kernel pointer that should be hidden from unprivileged users.
2332 * - 'NF' For a netdev_features_t
2333 * - '4cc' V4L2 or DRM FourCC code, with endianness and raw numerical value.
2334 * - 'h[CDN]' For a variable-length buffer, it prints it as a hex string with
2341 * - 'a[pd]' For address types [p] phys_addr_t, [d] dma_addr_t and derivatives
2343 * - 'd[234]' For a dentry name (optionally 2-4 last components)
2344 * - 'D[234]' Same as 'd' but for a struct file
2345 * - 'g' For block_device name (gendisk + partition number)
2346 * - 't[RT][dt][r][s]' For time and date as represented by:
2349 * - 'C' For a clock, it prints the name (Common Clock Framework) or address
2351 * - 'Cn' For a clock, it prints the name (Common Clock Framework) or address
2353 * - 'G' For flags to be printed as a collection of symbolic strings that would
2358 * - 'OF[fnpPcCF]' For a device tree object
2367 * - 'fw[fP]' For a firmware node (struct fwnode_handle) pointer
2371 * - 'x' For printing the address unmodified. Equivalent to "%lx".
2373 * - '[ku]s' For a BPF/tracing related format specifier, e.g. used out of
2379 * Documentation/core-api/printk-formats.rst
2458 /* %pe with a non-ERR_PTR gets treated as plain %p */ in pointer()
2473 * default is to _not_ leak addresses, so hash before printing, in pointer()
2491 * 'z' changed to 'Z' --davidm 1/25/99
2492 * 'Z' changed to 'z' --adobriyan 2017-01-25
2497 * @flags: various flags such as +, -, # tokens..
2510 if (spec->type == FORMAT_TYPE_WIDTH) { in format_decode()
2511 if (spec->field_width < 0) { in format_decode()
2512 spec->field_width = -spec->field_width; in format_decode()
2513 spec->flags |= LEFT; in format_decode()
2515 spec->type = FORMAT_TYPE_NONE; in format_decode()
2520 if (spec->type == FORMAT_TYPE_PRECISION) { in format_decode()
2521 if (spec->precision < 0) in format_decode()
2522 spec->precision = 0; in format_decode()
2524 spec->type = FORMAT_TYPE_NONE; in format_decode()
2529 spec->type = FORMAT_TYPE_NONE; in format_decode()
2536 /* Return the current non-format string */ in format_decode()
2538 return fmt - start; in format_decode()
2541 spec->flags = 0; in format_decode()
2549 case '-': spec->flags |= LEFT; break; in format_decode()
2550 case '+': spec->flags |= PLUS; break; in format_decode()
2551 case ' ': spec->flags |= SPACE; break; in format_decode()
2552 case '#': spec->flags |= SPECIAL; break; in format_decode()
2553 case '0': spec->flags |= ZEROPAD; break; in format_decode()
2562 spec->field_width = -1; in format_decode()
2565 spec->field_width = skip_atoi(&fmt); in format_decode()
2568 spec->type = FORMAT_TYPE_WIDTH; in format_decode()
2569 return ++fmt - start; in format_decode()
2574 spec->precision = -1; in format_decode()
2578 spec->precision = skip_atoi(&fmt); in format_decode()
2579 if (spec->precision < 0) in format_decode()
2580 spec->precision = 0; in format_decode()
2583 spec->type = FORMAT_TYPE_PRECISION; in format_decode()
2584 return ++fmt - start; in format_decode()
2606 spec->base = 10; in format_decode()
2609 spec->type = FORMAT_TYPE_CHAR; in format_decode()
2610 return ++fmt - start; in format_decode()
2613 spec->type = FORMAT_TYPE_STR; in format_decode()
2614 return ++fmt - start; in format_decode()
2617 spec->type = FORMAT_TYPE_PTR; in format_decode()
2618 return ++fmt - start; in format_decode()
2621 spec->type = FORMAT_TYPE_PERCENT_CHAR; in format_decode()
2622 return ++fmt - start; in format_decode()
2624 /* integer number formats - set up the flags and "break" */ in format_decode()
2626 spec->base = 8; in format_decode()
2630 spec->flags |= SMALL; in format_decode()
2634 spec->base = 16; in format_decode()
2639 spec->flags |= SIGN; in format_decode()
2654 spec->type = FORMAT_TYPE_INVALID; in format_decode()
2655 return fmt - start; in format_decode()
2659 spec->type = FORMAT_TYPE_LONG_LONG; in format_decode()
2662 spec->type = FORMAT_TYPE_ULONG + (spec->flags & SIGN); in format_decode()
2664 spec->type = FORMAT_TYPE_SIZE_T; in format_decode()
2666 spec->type = FORMAT_TYPE_PTRDIFF; in format_decode()
2669 spec->type = FORMAT_TYPE_UBYTE + (spec->flags & SIGN); in format_decode()
2672 spec->type = FORMAT_TYPE_USHORT + (spec->flags & SIGN); in format_decode()
2675 spec->type = FORMAT_TYPE_UINT + (spec->flags & SIGN); in format_decode()
2678 return ++fmt - start; in format_decode()
2684 spec->field_width = width; in set_field_width()
2685 if (WARN_ONCE(spec->field_width != width, "field width %d too large", width)) { in set_field_width()
2686 spec->field_width = clamp(width, -FIELD_WIDTH_MAX, FIELD_WIDTH_MAX); in set_field_width()
2693 spec->precision = prec; in set_precision()
2694 if (WARN_ONCE(spec->precision != prec, "precision %d too large", prec)) { in set_precision()
2695 spec->precision = clamp(prec, 0, PRECISION_MAX); in set_precision()
2700 * vsnprintf - Format a string and place it in a buffer
2709 * - ``%n`` is unsupported
2710 * - ``%p*`` is handled by pointer()
2712 * See pointer() or Documentation/core-api/printk-formats.rst for more
2729 unsigned long long num; in vsnprintf() local
2733 /* Reject out-of-range values early. Large positive sizes are in vsnprintf()
2743 end = ((void *)-1); in vsnprintf()
2744 size = end - buf; in vsnprintf()
2757 if (copy > end - str) in vsnprintf()
2758 copy = end - str; in vsnprintf()
2777 while (--spec.field_width > 0) { in vsnprintf()
2788 while (--spec.field_width > 0) { in vsnprintf()
2827 num = va_arg(args, long long); in vsnprintf()
2830 num = va_arg(args, unsigned long); in vsnprintf()
2833 num = va_arg(args, long); in vsnprintf()
2837 num = va_arg(args, ssize_t); in vsnprintf()
2839 num = va_arg(args, size_t); in vsnprintf()
2842 num = va_arg(args, ptrdiff_t); in vsnprintf()
2845 num = (unsigned char) va_arg(args, int); in vsnprintf()
2848 num = (signed char) va_arg(args, int); in vsnprintf()
2851 num = (unsigned short) va_arg(args, int); in vsnprintf()
2854 num = (short) va_arg(args, int); in vsnprintf()
2857 num = (int) va_arg(args, int); in vsnprintf()
2860 num = va_arg(args, unsigned int); in vsnprintf()
2863 str = number(str, end, num, spec); in vsnprintf()
2872 end[-1] = '\0'; in vsnprintf()
2876 return str-buf; in vsnprintf()
2882 * vscnprintf - Format a string and place it in a buffer
2905 return size - 1; in vscnprintf()
2911 * snprintf - Format a string and place it in a buffer
2938 * scnprintf - Format a string and place it in a buffer
2962 * vsprintf - Format a string and place it in a buffer
2982 * sprintf - Format a string and place it in a buffer
3009 * vbin_printf() - VA arguments to binary data
3010 * bstr_printf() - Binary data to text string
3014 * vbin_printf - Parse a format string and place args' binary value in a buffer
3124 end[-1] = '\0'; /* Must be nul terminated */ in vbin_printf()
3162 return (u32 *)(PTR_ALIGN(str, sizeof(u32))) - bin_buf; in vbin_printf()
3168 * bstr_printf - Format a string from binary arguments and place it in a buffer
3218 end = ((void *)-1); in bstr_printf()
3219 size = end - buf; in bstr_printf()
3232 if (copy > end - str) in bstr_printf()
3233 copy = end - str; in bstr_printf()
3252 while (--spec.field_width > 0) { in bstr_printf()
3262 while (--spec.field_width > 0) { in bstr_printf()
3297 if (copy > end - str) in bstr_printf()
3298 copy = end - str; in bstr_printf()
3322 unsigned long long num; in bstr_printf() local
3327 num = get_arg(long long); in bstr_printf()
3331 num = get_arg(unsigned long); in bstr_printf()
3334 num = get_arg(size_t); in bstr_printf()
3337 num = get_arg(ptrdiff_t); in bstr_printf()
3340 num = get_arg(unsigned char); in bstr_printf()
3343 num = get_arg(signed char); in bstr_printf()
3346 num = get_arg(unsigned short); in bstr_printf()
3349 num = get_arg(short); in bstr_printf()
3352 num = get_arg(unsigned int); in bstr_printf()
3355 num = get_arg(int); in bstr_printf()
3358 str = number(str, end, num, spec); in bstr_printf()
3368 end[-1] = '\0'; in bstr_printf()
3374 return str - buf; in bstr_printf()
3379 * bprintf - Parse a format string and place args' binary value in a buffer
3404 * vsscanf - Unformat a buffer into a list of arguments
3414 int num = 0; in vsscanf() local
3454 return num; in vsscanf()
3463 field_width = -1; in vsscanf()
3471 qualifier = -1; in vsscanf()
3491 *va_arg(args, int *) = str - buf; in vsscanf()
3506 if (field_width == -1) in vsscanf()
3510 } while (--field_width > 0 && *str); in vsscanf()
3511 num++; in vsscanf()
3517 if (field_width == -1) in vsscanf()
3523 while (*str && !isspace(*str) && field_width--) in vsscanf()
3526 num++; in vsscanf()
3532 * (1) It does NOT support ranges i.e. '-' is NOT a special in vsscanf()
3552 if (field_width == -1) in vsscanf()
3553 return num; in vsscanf()
3563 return num; in vsscanf()
3572 /* match must be non-empty */ in vsscanf()
3574 return num; in vsscanf()
3576 while (test_bit((u8)*str, set) && field_width--) in vsscanf()
3579 ++num; in vsscanf()
3600 return num; in vsscanf()
3604 return num; in vsscanf()
3613 if (is_sign && digit == '-') { in vsscanf()
3671 num++; in vsscanf()
3678 return num; in vsscanf()
3683 * sscanf - Unformat a buffer into a list of arguments