Lines Matching refs:fmt
921 const char *fmt) in dentry_name() argument
928 switch (fmt[1]) { in dentry_name()
930 depth = fmt[1] - '0'; in dentry_name()
970 struct printf_spec spec, const char *fmt) in file_dentry_name() argument
975 return dentry_name(buf, end, f->f_path.dentry, spec, fmt); in file_dentry_name()
980 struct printf_spec spec, const char *fmt) in bdev_name() argument
1003 struct printf_spec spec, const char *fmt) in symbol_string() argument
1010 if (fmt[1] == 'R') in symbol_string()
1015 if (*fmt == 'B' && fmt[1] == 'b') in symbol_string()
1017 else if (*fmt == 'B') in symbol_string()
1019 else if (*fmt == 'S' && (fmt[1] == 'b' || (fmt[1] == 'R' && fmt[2] == 'b'))) in symbol_string()
1021 else if (*fmt != 's') in symbol_string()
1064 struct printf_spec spec, const char *fmt) in resource_string() argument
1107 int decode = (fmt[0] == 'R') ? 1 : 0; in resource_string()
1165 const char *fmt) in hex_string() argument
1178 switch (fmt[1]) { in hex_string()
1216 struct printf_spec spec, const char *fmt) in bitmap_string() argument
1260 struct printf_spec spec, const char *fmt) in bitmap_list_string() argument
1300 struct printf_spec spec, const char *fmt) in mac_address_string() argument
1311 switch (fmt[1]) { in mac_address_string()
1331 if (fmt[0] == 'M' && i != 5) in mac_address_string()
1340 char *ip4_string(char *p, const u8 *addr, const char *fmt) in ip4_string() argument
1343 bool leading_zeros = (fmt[0] == 'i'); in ip4_string()
1347 switch (fmt[2]) { in ip4_string()
1473 char *ip6_string(char *p, const char *addr, const char *fmt) in ip6_string() argument
1480 if (fmt[0] == 'I' && i != 7) in ip6_string()
1490 struct printf_spec spec, const char *fmt) in ip6_addr_string() argument
1494 if (fmt[0] == 'I' && fmt[2] == 'c') in ip6_addr_string()
1497 ip6_string(ip6_addr, addr, fmt); in ip6_addr_string()
1504 struct printf_spec spec, const char *fmt) in ip4_addr_string() argument
1508 ip4_string(ip4_addr, addr, fmt); in ip4_addr_string()
1515 struct printf_spec spec, const char *fmt) in ip6_addr_string_sa() argument
1523 char fmt6[2] = { fmt[0], '6' }; in ip6_addr_string_sa()
1526 fmt++; in ip6_addr_string_sa()
1527 while (isalpha(*++fmt)) { in ip6_addr_string_sa()
1528 switch (*fmt) { in ip6_addr_string_sa()
1577 struct printf_spec spec, const char *fmt) in ip4_addr_string_sa() argument
1583 char fmt4[3] = { fmt[0], '4', 0 }; in ip4_addr_string_sa()
1585 fmt++; in ip4_addr_string_sa()
1586 while (isalpha(*++fmt)) { in ip4_addr_string_sa()
1587 switch (*fmt) { in ip4_addr_string_sa()
1595 fmt4[2] = *fmt; in ip4_addr_string_sa()
1612 struct printf_spec spec, const char *fmt) in ip_addr_string() argument
1619 switch (fmt[1]) { in ip_addr_string()
1621 return ip6_addr_string(buf, end, ptr, spec, fmt); in ip_addr_string()
1623 return ip4_addr_string(buf, end, ptr, spec, fmt); in ip_addr_string()
1633 return ip4_addr_string_sa(buf, end, &sa->v4, spec, fmt); in ip_addr_string()
1635 return ip6_addr_string_sa(buf, end, &sa->v6, spec, fmt); in ip_addr_string()
1641 err_fmt_msg = fmt[0] == 'i' ? "(%pi?)" : "(%pI?)"; in ip_addr_string()
1647 const char *fmt) in escaped_string() argument
1661 switch (fmt[count++]) { in escaped_string()
1705 struct printf_spec spec, const char *fmt) in va_format() argument
1713 buf += vsnprintf(buf, end > buf ? end - buf : 0, va_fmt->fmt, va); in va_format()
1721 struct printf_spec spec, const char *fmt) in uuid_string() argument
1732 switch (*(++fmt)) { in uuid_string()
1766 struct printf_spec spec, const char *fmt) in netdev_bits() argument
1774 switch (fmt[1]) { in netdev_bits()
1788 struct printf_spec spec, const char *fmt) in fourcc_string() argument
1795 if (fmt[1] != 'c' || fmt[2] != 'c') in fourcc_string()
1825 struct printf_spec spec, const char *fmt) in address_val() argument
1833 switch (fmt[1]) { in address_val()
1885 struct printf_spec spec, const char *fmt) in rtc_str() argument
1895 switch (fmt[count]) { in rtc_str()
1907 switch (fmt[count++]) { in rtc_str()
1935 struct printf_spec spec, const char *fmt) in time64_str() argument
1953 return rtc_str(buf, end, &rtc_time, spec, fmt); in time64_str()
1958 const char *fmt) in time_and_date() argument
1960 switch (fmt[1]) { in time_and_date()
1962 return rtc_str(buf, end, (const struct rtc_time *)ptr, spec, fmt); in time_and_date()
1964 return time64_str(buf, end, *(const time64_t *)ptr, spec, fmt); in time_and_date()
1972 const char *fmt) in clock() argument
1980 switch (fmt[1]) { in clock()
2080 struct printf_spec spec, const char *fmt) in flags_string() argument
2088 switch (fmt[1]) { in flags_string()
2135 struct printf_spec spec, const char *fmt) in device_node_string() argument
2147 if (fmt[0] != 'F') in device_node_string()
2157 fmt++; in device_node_string()
2158 if (fmt[0] == '\0' || strcspn(fmt,"fnpPFcC") > 0) in device_node_string()
2159 fmt = "f"; in device_node_string()
2161 for (pass = false; strspn(fmt,"fnpPFcC"); fmt++, pass = true) { in device_node_string()
2169 switch (*fmt) { in device_node_string()
2225 struct printf_spec spec, const char *fmt) in fwnode_string() argument
2232 if (*fmt != 'w') in fwnode_string()
2238 fmt++; in fwnode_string()
2240 switch (*fmt) { in fwnode_string()
2406 char *pointer(const char *fmt, char *buf, char *end, void *ptr, in pointer() argument
2409 switch (*fmt) { in pointer()
2415 return symbol_string(buf, end, ptr, spec, fmt); in pointer()
2418 return resource_string(buf, end, ptr, spec, fmt); in pointer()
2420 return hex_string(buf, end, ptr, spec, fmt); in pointer()
2422 switch (fmt[1]) { in pointer()
2424 return bitmap_list_string(buf, end, ptr, spec, fmt); in pointer()
2426 return bitmap_string(buf, end, ptr, spec, fmt); in pointer()
2432 return mac_address_string(buf, end, ptr, spec, fmt); in pointer()
2442 return ip_addr_string(buf, end, ptr, spec, fmt); in pointer()
2444 return escaped_string(buf, end, ptr, spec, fmt); in pointer()
2446 return uuid_string(buf, end, ptr, spec, fmt); in pointer()
2448 return va_format(buf, end, ptr, spec, fmt); in pointer()
2452 return netdev_bits(buf, end, ptr, spec, fmt); in pointer()
2454 return fourcc_string(buf, end, ptr, spec, fmt); in pointer()
2456 return address_val(buf, end, ptr, spec, fmt); in pointer()
2458 return dentry_name(buf, end, ptr, spec, fmt); in pointer()
2460 return time_and_date(buf, end, ptr, spec, fmt); in pointer()
2462 return clock(buf, end, ptr, spec, fmt); in pointer()
2464 return file_dentry_name(buf, end, ptr, spec, fmt); in pointer()
2467 return bdev_name(buf, end, ptr, spec, fmt); in pointer()
2471 return flags_string(buf, end, ptr, spec, fmt); in pointer()
2473 return device_node_string(buf, end, ptr, spec, fmt + 1); in pointer()
2475 return fwnode_string(buf, end, ptr, spec, fmt + 1); in pointer()
2485 switch (fmt[1]) { in pointer()
2518 int format_decode(const char *fmt, struct printf_spec *spec) in format_decode() argument
2520 const char *start = fmt; in format_decode()
2545 for (; *fmt ; ++fmt) { in format_decode()
2546 if (*fmt == '%') in format_decode()
2551 if (fmt != start || !*fmt) in format_decode()
2552 return fmt - start; in format_decode()
2560 ++fmt; in format_decode()
2562 switch (*fmt) { in format_decode()
2578 if (isdigit(*fmt)) in format_decode()
2579 spec->field_width = skip_atoi(&fmt); in format_decode()
2580 else if (*fmt == '*') { in format_decode()
2583 return ++fmt - start; in format_decode()
2589 if (*fmt == '.') { in format_decode()
2590 ++fmt; in format_decode()
2591 if (isdigit(*fmt)) { in format_decode()
2592 spec->precision = skip_atoi(&fmt); in format_decode()
2595 } else if (*fmt == '*') { in format_decode()
2598 return ++fmt - start; in format_decode()
2605 if (*fmt == 'h' || _tolower(*fmt) == 'l' || in format_decode()
2606 *fmt == 'z' || *fmt == 't') { in format_decode()
2607 qualifier = *fmt++; in format_decode()
2608 if (unlikely(qualifier == *fmt)) { in format_decode()
2611 ++fmt; in format_decode()
2614 ++fmt; in format_decode()
2621 switch (*fmt) { in format_decode()
2624 return ++fmt - start; in format_decode()
2628 return ++fmt - start; in format_decode()
2632 return ++fmt - start; in format_decode()
2636 return ++fmt - start; in format_decode()
2667 WARN_ONCE(1, "Please remove unsupported %%%c in format string\n", *fmt); in format_decode()
2669 return fmt - start; in format_decode()
2692 return ++fmt - start; in format_decode()
2741 int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) in vsnprintf() argument
2761 while (*fmt) { in vsnprintf()
2762 const char *old_fmt = fmt; in vsnprintf()
2763 int read = format_decode(fmt, &spec); in vsnprintf()
2765 fmt += read; in vsnprintf()
2815 str = pointer(fmt, str, end, va_arg(args, void *), in vsnprintf()
2817 while (isalnum(*fmt)) in vsnprintf()
2818 fmt++; in vsnprintf()
2910 int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) in vscnprintf() argument
2914 i = vsnprintf(buf, size, fmt, args); in vscnprintf()
2938 int snprintf(char *buf, size_t size, const char *fmt, ...) in snprintf() argument
2943 va_start(args, fmt); in snprintf()
2944 i = vsnprintf(buf, size, fmt, args); in snprintf()
2962 int scnprintf(char *buf, size_t size, const char *fmt, ...) in scnprintf() argument
2967 va_start(args, fmt); in scnprintf()
2968 i = vscnprintf(buf, size, fmt, args); in scnprintf()
2989 int vsprintf(char *buf, const char *fmt, va_list args) in vsprintf() argument
2991 return vsnprintf(buf, INT_MAX, fmt, args); in vsprintf()
3007 int sprintf(char *buf, const char *fmt, ...) in sprintf() argument
3012 va_start(args, fmt); in sprintf()
3013 i = vsnprintf(buf, INT_MAX, fmt, args); in sprintf()
3044 int vbin_printf(u32 *bin_buf, size_t size, const char *fmt, va_list args) in vbin_printf() argument
3077 while (*fmt) { in vbin_printf()
3078 int read = format_decode(fmt, &spec); in vbin_printf()
3080 fmt += read; in vbin_printf()
3093 if (*fmt == 'p') in vbin_printf()
3119 switch (*fmt) { in vbin_printf()
3129 if (!isalnum(*fmt)) { in vbin_printf()
3133 str = pointer(fmt, str, end, va_arg(args, void *), in vbin_printf()
3141 while (isalnum(*fmt)) in vbin_printf()
3142 fmt++; in vbin_printf()
3203 int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf) in bstr_printf() argument
3236 while (*fmt) { in bstr_printf()
3237 const char *old_fmt = fmt; in bstr_printf()
3238 int read = format_decode(fmt, &spec); in bstr_printf()
3240 fmt += read; in bstr_printf()
3295 switch (*fmt) { in bstr_printf()
3304 if (!isalnum(*fmt)) { in bstr_printf()
3319 str = pointer(fmt, str, end, get_arg(void *), spec); in bstr_printf()
3321 while (isalnum(*fmt)) in bstr_printf()
3322 fmt++; in bstr_printf()
3402 int bprintf(u32 *bin_buf, size_t size, const char *fmt, ...) in bprintf() argument
3407 va_start(args, fmt); in bprintf()
3408 ret = vbin_printf(bin_buf, size, fmt, args); in bprintf()
3423 int vsscanf(const char *buf, const char *fmt, va_list args) in vsscanf() argument
3438 while (*fmt) { in vsscanf()
3443 if (isspace(*fmt)) { in vsscanf()
3444 fmt = skip_spaces(++fmt); in vsscanf()
3449 if (*fmt != '%' && *fmt) { in vsscanf()
3450 if (*fmt++ != *str++) in vsscanf()
3455 if (!*fmt) in vsscanf()
3457 ++fmt; in vsscanf()
3462 if (*fmt == '*') { in vsscanf()
3465 while (!isspace(*fmt) && *fmt != '%' && *fmt) { in vsscanf()
3467 if (*fmt == '[') in vsscanf()
3469 fmt++; in vsscanf()
3478 if (isdigit(*fmt)) { in vsscanf()
3479 field_width = skip_atoi(&fmt); in vsscanf()
3486 if (*fmt == 'h' || _tolower(*fmt) == 'l' || in vsscanf()
3487 *fmt == 'z') { in vsscanf()
3488 qualifier = *fmt++; in vsscanf()
3489 if (unlikely(qualifier == *fmt)) { in vsscanf()
3492 fmt++; in vsscanf()
3495 fmt++; in vsscanf()
3500 if (!*fmt) in vsscanf()
3503 if (*fmt == 'n') { in vsscanf()
3506 ++fmt; in vsscanf()
3516 switch (*fmt++) { in vsscanf()
3563 bool negate = (*fmt == '^'); in vsscanf()
3570 ++fmt; in vsscanf()
3572 for ( ; *fmt && *fmt != ']'; ++fmt, ++len) in vsscanf()
3573 set_bit((u8)*fmt, set); in vsscanf()
3576 if (!*fmt || !len) in vsscanf()
3578 ++fmt; in vsscanf()
3702 int sscanf(const char *buf, const char *fmt, ...) in sscanf() argument
3707 va_start(args, fmt); in sscanf()
3708 i = vsscanf(buf, fmt, args); in sscanf()