Lines Matching refs:end
454 char *number(char *buf, char *end, unsigned long long num, in number() argument
518 if (buf < end) in number()
525 if (buf < end) in number()
532 if (buf < end) in number()
537 if (buf < end) in number()
547 if (buf < end) in number()
554 if (buf < end) in number()
560 if (buf < end) in number()
566 if (buf < end) in number()
575 char *special_hex_number(char *buf, char *end, unsigned long long num, int size) in special_hex_number() argument
585 return number(buf, end, num, spec); in special_hex_number()
588 static void move_right(char *buf, char *end, unsigned len, unsigned spaces) in move_right() argument
591 if (buf >= end) /* nowhere to put anything */ in move_right()
593 size = end - buf; in move_right()
615 char *widen_string(char *buf, int n, char *end, struct printf_spec spec) in widen_string() argument
624 move_right(buf - n, end, n, spaces); in widen_string()
628 if (buf < end) in widen_string()
636 static char *string_nocheck(char *buf, char *end, const char *s, in string_nocheck() argument
646 if (buf < end) in string_nocheck()
651 return widen_string(buf, len, end, spec); in string_nocheck()
654 static char *err_ptr(char *buf, char *end, void *ptr, in err_ptr() argument
661 return string_nocheck(buf, end, sym, spec); in err_ptr()
670 return number(buf, end, err, spec); in err_ptr()
674 static char *error_string(char *buf, char *end, const char *s, in error_string() argument
685 return string_nocheck(buf, end, s, spec); in error_string()
704 static int check_pointer(char **buf, char *end, const void *ptr, in check_pointer() argument
711 *buf = error_string(*buf, end, err_msg, spec); in check_pointer()
719 char *string(char *buf, char *end, const char *s, in string() argument
722 if (check_pointer(&buf, end, s, spec)) in string()
725 return string_nocheck(buf, end, s, spec); in string()
728 static char *pointer_string(char *buf, char *end, in pointer_string() argument
739 return number(buf, end, (unsigned long int)ptr, spec); in pointer_string()
809 static char *ptr_to_id(char *buf, char *end, const void *ptr, in ptr_to_id() argument
821 return pointer_string(buf, end, ptr, spec); in ptr_to_id()
826 return pointer_string(buf, end, (const void *)hashval, spec); in ptr_to_id()
833 return error_string(buf, end, str, spec); in ptr_to_id()
836 return pointer_string(buf, end, (const void *)hashval, spec); in ptr_to_id()
839 static char *default_pointer(char *buf, char *end, const void *ptr, in default_pointer() argument
847 return pointer_string(buf, end, ptr, spec); in default_pointer()
849 return ptr_to_id(buf, end, ptr, spec); in default_pointer()
855 char *restricted_pointer(char *buf, char *end, const void *ptr, in restricted_pointer() argument
861 return default_pointer(buf, end, ptr, spec); in restricted_pointer()
872 return error_string(buf, end, "pK-error", spec); in restricted_pointer()
898 return pointer_string(buf, end, ptr, spec); in restricted_pointer()
902 char *dentry_name(char *buf, char *end, const struct dentry *d, struct printf_spec spec, in dentry_name() argument
920 if (check_pointer(&buf, end, d, spec)) { in dentry_name()
943 if (buf < end) in dentry_name()
947 return widen_string(buf, n, end, spec); in dentry_name()
951 char *file_dentry_name(char *buf, char *end, const struct file *f, in file_dentry_name() argument
954 if (check_pointer(&buf, end, f, spec)) in file_dentry_name()
957 return dentry_name(buf, end, f->f_path.dentry, spec, fmt); in file_dentry_name()
961 char *bdev_name(char *buf, char *end, struct block_device *bdev, in bdev_name() argument
966 if (check_pointer(&buf, end, bdev, spec)) in bdev_name()
970 buf = string(buf, end, hd->disk_name, spec); in bdev_name()
973 if (buf < end) in bdev_name()
977 buf = number(buf, end, bdev->bd_partno, spec); in bdev_name()
984 char *symbol_string(char *buf, char *end, void *ptr, in symbol_string() argument
1008 return string_nocheck(buf, end, sym, spec); in symbol_string()
1010 return special_hex_number(buf, end, value, sizeof(void *)); in symbol_string()
1045 char *resource_string(char *buf, char *end, struct resource *res, in resource_string() argument
1092 if (check_pointer(&buf, end, res, spec)) in resource_string()
1121 if (res->start != res->end) { in resource_string()
1123 p = number(p, pend, res->end, *specp); in resource_string()
1142 return string_nocheck(buf, end, sym, spec); in resource_string()
1146 char *hex_string(char *buf, char *end, u8 *addr, struct printf_spec spec, in hex_string() argument
1157 if (check_pointer(&buf, end, addr, spec)) in hex_string()
1179 if (buf < end) in hex_string()
1182 if (buf < end) in hex_string()
1187 if (buf < end) in hex_string()
1197 char *bitmap_string(char *buf, char *end, const unsigned long *bitmap, in bitmap_string() argument
1205 if (check_pointer(&buf, end, bitmap, spec)) in bitmap_string()
1226 if (buf < end) in bitmap_string()
1233 buf = number(buf, end, val, spec); in bitmap_string()
1241 char *bitmap_list_string(char *buf, char *end, const unsigned long *bitmap, in bitmap_list_string() argument
1248 if (check_pointer(&buf, end, bitmap, spec)) in bitmap_list_string()
1253 if (buf < end) in bitmap_list_string()
1259 buf = number(buf, end, rbot, default_dec_spec); in bitmap_list_string()
1263 if (buf < end) in bitmap_list_string()
1265 buf = number(++buf, end, rtop - 1, default_dec_spec); in bitmap_list_string()
1271 char *mac_address_string(char *buf, char *end, u8 *addr, in mac_address_string() argument
1280 if (check_pointer(&buf, end, addr, spec)) in mac_address_string()
1308 return string_nocheck(buf, end, mac_addr, spec); in mac_address_string()
1461 char *ip6_addr_string(char *buf, char *end, const u8 *addr, in ip6_addr_string() argument
1471 return string_nocheck(buf, end, ip6_addr, spec); in ip6_addr_string()
1475 char *ip4_addr_string(char *buf, char *end, const u8 *addr, in ip4_addr_string() argument
1482 return string_nocheck(buf, end, ip4_addr, spec); in ip4_addr_string()
1486 char *ip6_addr_string_sa(char *buf, char *end, const struct sockaddr_in6 *sa, in ip6_addr_string_sa() argument
1544 return string_nocheck(buf, end, ip6_addr, spec); in ip6_addr_string_sa()
1548 char *ip4_addr_string_sa(char *buf, char *end, const struct sockaddr_in *sa, in ip4_addr_string_sa() argument
1579 return string_nocheck(buf, end, ip4_addr, spec); in ip4_addr_string_sa()
1583 char *ip_addr_string(char *buf, char *end, const void *ptr, in ip_addr_string() argument
1588 if (check_pointer(&buf, end, ptr, spec)) in ip_addr_string()
1593 return ip6_addr_string(buf, end, ptr, spec, fmt); in ip_addr_string()
1595 return ip4_addr_string(buf, end, ptr, spec, fmt); in ip_addr_string()
1605 return ip4_addr_string_sa(buf, end, &sa->v4, spec, fmt); in ip_addr_string()
1607 return ip6_addr_string_sa(buf, end, &sa->v6, spec, fmt); in ip_addr_string()
1609 return error_string(buf, end, "(einval)", spec); in ip_addr_string()
1614 return error_string(buf, end, err_fmt_msg, spec); in ip_addr_string()
1618 char *escaped_string(char *buf, char *end, u8 *addr, struct printf_spec spec, in escaped_string() argument
1629 if (check_pointer(&buf, end, addr, spec)) in escaped_string()
1671 buf += string_escape_mem(addr, len, buf, buf < end ? end - buf : 0, flags, NULL); in escaped_string()
1676 static char *va_format(char *buf, char *end, struct va_format *va_fmt, in va_format() argument
1681 if (check_pointer(&buf, end, va_fmt, spec)) in va_format()
1685 buf += vsnprintf(buf, end > buf ? end - buf : 0, va_fmt->fmt, va); in va_format()
1692 char *uuid_string(char *buf, char *end, const u8 *addr, in uuid_string() argument
1701 if (check_pointer(&buf, end, addr, spec)) in uuid_string()
1733 return string_nocheck(buf, end, uuid, spec); in uuid_string()
1737 char *netdev_bits(char *buf, char *end, const void *addr, in netdev_bits() argument
1743 if (check_pointer(&buf, end, addr, spec)) in netdev_bits()
1752 return error_string(buf, end, "(%pN?)", spec); in netdev_bits()
1755 return special_hex_number(buf, end, num, size); in netdev_bits()
1759 char *fourcc_string(char *buf, char *end, const u32 *fourcc, in fourcc_string() argument
1768 return error_string(buf, end, "(%p4?)", spec); in fourcc_string()
1770 if (check_pointer(&buf, end, fourcc, spec)) in fourcc_string()
1793 return string(buf, end, output, spec); in fourcc_string()
1797 char *address_val(char *buf, char *end, const void *addr, in address_val() argument
1803 if (check_pointer(&buf, end, addr, spec)) in address_val()
1818 return special_hex_number(buf, end, num, size); in address_val()
1822 char *date_str(char *buf, char *end, const struct rtc_time *tm, bool r) in date_str() argument
1827 buf = number(buf, end, year, default_dec04_spec); in date_str()
1828 if (buf < end) in date_str()
1832 buf = number(buf, end, mon, default_dec02_spec); in date_str()
1833 if (buf < end) in date_str()
1837 return number(buf, end, tm->tm_mday, default_dec02_spec); in date_str()
1841 char *time_str(char *buf, char *end, const struct rtc_time *tm, bool r) in time_str() argument
1843 buf = number(buf, end, tm->tm_hour, default_dec02_spec); in time_str()
1844 if (buf < end) in time_str()
1848 buf = number(buf, end, tm->tm_min, default_dec02_spec); in time_str()
1849 if (buf < end) in time_str()
1853 return number(buf, end, tm->tm_sec, default_dec02_spec); in time_str()
1857 char *rtc_str(char *buf, char *end, const struct rtc_time *tm, in rtc_str() argument
1865 if (check_pointer(&buf, end, tm, spec)) in rtc_str()
1894 buf = date_str(buf, end, tm, raw); in rtc_str()
1896 if (buf < end) in rtc_str()
1901 buf = time_str(buf, end, tm, raw); in rtc_str()
1907 char *time64_str(char *buf, char *end, const time64_t time, in time64_str() argument
1926 return rtc_str(buf, end, &rtc_time, spec, fmt); in time64_str()
1930 char *time_and_date(char *buf, char *end, void *ptr, struct printf_spec spec, in time_and_date() argument
1935 return rtc_str(buf, end, (const struct rtc_time *)ptr, spec, fmt); in time_and_date()
1937 return time64_str(buf, end, *(const time64_t *)ptr, spec, fmt); in time_and_date()
1939 return error_string(buf, end, "(%pt?)", spec); in time_and_date()
1944 char *clock(char *buf, char *end, struct clk *clk, struct printf_spec spec, in clock() argument
1948 return error_string(buf, end, "(%pC?)", spec); in clock()
1950 if (check_pointer(&buf, end, clk, spec)) in clock()
1957 return string(buf, end, __clk_get_name(clk), spec); in clock()
1959 return ptr_to_id(buf, end, clk, spec); in clock()
1965 char *format_flags(char *buf, char *end, unsigned long flags, in format_flags() argument
1975 buf = string(buf, end, names->name, default_str_spec); in format_flags()
1979 if (buf < end) in format_flags()
1986 buf = number(buf, end, flags, default_flag_spec); in format_flags()
2013 char *format_page_flags(char *buf, char *end, unsigned long flags) in format_page_flags() argument
2019 buf = number(buf, end, flags, default_flag_spec); in format_page_flags()
2020 if (buf < end) in format_page_flags()
2026 buf = format_flags(buf, end, main_flags, pageflag_names); in format_page_flags()
2038 if (buf < end) in format_page_flags()
2043 buf = string(buf, end, pff[i].name, default_str_spec); in format_page_flags()
2044 if (buf < end) in format_page_flags()
2047 buf = number(buf, end, (flags >> pff[i].shift) & pff[i].mask, in format_page_flags()
2052 if (buf < end) in format_page_flags()
2060 char *flags_string(char *buf, char *end, void *flags_ptr, in flags_string() argument
2066 if (check_pointer(&buf, end, flags_ptr, spec)) in flags_string()
2071 return format_page_flags(buf, end, *(unsigned long *)flags_ptr); in flags_string()
2081 return error_string(buf, end, "(%pG?)", spec); in flags_string()
2084 return format_flags(buf, end, flags, names); in flags_string()
2089 char *end) in fwnode_full_name_string() argument
2098 buf = string(buf, end, fwnode_get_name_prefix(__fwnode), in fwnode_full_name_string()
2100 buf = string(buf, end, fwnode_get_name(__fwnode), in fwnode_full_name_string()
2110 char *device_node_string(char *buf, char *end, struct device_node *dn, in device_node_string() argument
2124 return error_string(buf, end, "(%pO?)", spec); in device_node_string()
2127 return error_string(buf, end, "(%pOF?)", spec); in device_node_string()
2129 if (check_pointer(&buf, end, dn, spec)) in device_node_string()
2140 if (buf < end) in device_node_string()
2148 end); in device_node_string()
2154 buf = string(buf, end, p, str_spec); in device_node_string()
2158 buf = number(buf, end, (unsigned int)dn->phandle, default_dec_spec); in device_node_string()
2164 buf = string(buf, end, p, str_spec); in device_node_string()
2172 buf = string_nocheck(buf, end, tbuf, str_spec); in device_node_string()
2177 buf = string(buf, end, p, str_spec); in device_node_string()
2183 buf = string_nocheck(buf, end, ",", str_spec); in device_node_string()
2184 buf = string_nocheck(buf, end, "\"", str_spec); in device_node_string()
2185 buf = string(buf, end, p, str_spec); in device_node_string()
2186 buf = string_nocheck(buf, end, "\"", str_spec); in device_node_string()
2196 return widen_string(buf, buf - buf_start, end, spec); in device_node_string()
2200 char *fwnode_string(char *buf, char *end, struct fwnode_handle *fwnode, in fwnode_string() argument
2209 return error_string(buf, end, "(%pf?)", spec); in fwnode_string()
2211 if (check_pointer(&buf, end, fwnode, spec)) in fwnode_string()
2218 buf = string(buf, end, fwnode_get_name(fwnode), str_spec); in fwnode_string()
2222 buf = fwnode_full_name_string(fwnode, buf, end); in fwnode_string()
2226 return widen_string(buf, buf - buf_start, end, spec); in fwnode_string()
2255 char *rust_fmt_argument(char *buf, char *end, void *ptr);
2389 char *pointer(const char *fmt, char *buf, char *end, void *ptr, in pointer() argument
2398 return symbol_string(buf, end, ptr, spec, fmt); in pointer()
2401 return resource_string(buf, end, ptr, spec, fmt); in pointer()
2403 return hex_string(buf, end, ptr, spec, fmt); in pointer()
2407 return bitmap_list_string(buf, end, ptr, spec, fmt); in pointer()
2409 return bitmap_string(buf, end, ptr, spec, fmt); in pointer()
2415 return mac_address_string(buf, end, ptr, spec, fmt); in pointer()
2425 return ip_addr_string(buf, end, ptr, spec, fmt); in pointer()
2427 return escaped_string(buf, end, ptr, spec, fmt); in pointer()
2429 return uuid_string(buf, end, ptr, spec, fmt); in pointer()
2431 return va_format(buf, end, ptr, spec, fmt); in pointer()
2433 return restricted_pointer(buf, end, ptr, spec); in pointer()
2435 return netdev_bits(buf, end, ptr, spec, fmt); in pointer()
2437 return fourcc_string(buf, end, ptr, spec, fmt); in pointer()
2439 return address_val(buf, end, ptr, spec, fmt); in pointer()
2441 return dentry_name(buf, end, ptr, spec, fmt); in pointer()
2443 return time_and_date(buf, end, ptr, spec, fmt); in pointer()
2445 return clock(buf, end, ptr, spec, fmt); in pointer()
2447 return file_dentry_name(buf, end, ptr, spec, fmt); in pointer()
2450 return bdev_name(buf, end, ptr, spec, fmt); in pointer()
2454 return flags_string(buf, end, ptr, spec, fmt); in pointer()
2456 return device_node_string(buf, end, ptr, spec, fmt + 1); in pointer()
2458 return fwnode_string(buf, end, ptr, spec, fmt + 1); in pointer()
2462 return error_string(buf, end, "(%pA?)", spec); in pointer()
2464 return rust_fmt_argument(buf, end, ptr); in pointer()
2466 return pointer_string(buf, end, ptr, spec); in pointer()
2470 return default_pointer(buf, end, ptr, spec); in pointer()
2471 return err_ptr(buf, end, ptr, spec); in pointer()
2476 return string(buf, end, ptr, spec); in pointer()
2478 return error_string(buf, end, "(einval)", spec); in pointer()
2481 return default_pointer(buf, end, ptr, spec); in pointer()
2733 char *str, *end; in vsnprintf() local
2742 end = buf + size; in vsnprintf()
2745 if (end < buf) { in vsnprintf()
2746 end = ((void *)-1); in vsnprintf()
2747 size = end - buf; in vsnprintf()
2759 if (str < end) { in vsnprintf()
2760 if (copy > end - str) in vsnprintf()
2761 copy = end - str; in vsnprintf()
2781 if (str < end) in vsnprintf()
2788 if (str < end) in vsnprintf()
2792 if (str < end) in vsnprintf()
2800 str = string(str, end, va_arg(args, char *), spec); in vsnprintf()
2804 str = pointer(fmt, str, end, va_arg(args, void *), in vsnprintf()
2811 if (str < end) in vsnprintf()
2866 str = number(str, end, num, spec); in vsnprintf()
2872 if (str < end) in vsnprintf()
2875 end[-1] = '\0'; in vsnprintf()
3038 char *str, *end; in vbin_printf() local
3042 end = (char *)(bin_buf + size); in vbin_printf()
3051 if (str + sizeof(type) <= end) { \ in vbin_printf()
3060 if (str + sizeof(type) <= end) \ in vbin_printf()
3102 if (str + len < end) in vbin_printf()
3124 str = pointer(fmt, str, end, va_arg(args, void *), in vbin_printf()
3126 if (str + 1 < end) in vbin_printf()
3129 end[-1] = '\0'; /* Must be nul terminated */ in vbin_printf()
3197 char *str, *end; in bstr_printf() local
3204 end = buf + size; in bstr_printf()
3222 if (end < buf) { in bstr_printf()
3223 end = ((void *)-1); in bstr_printf()
3224 size = end - buf; in bstr_printf()
3236 if (str < end) { in bstr_printf()
3237 if (copy > end - str) in bstr_printf()
3238 copy = end - str; in bstr_printf()
3258 if (str < end) in bstr_printf()
3264 if (str < end) in bstr_printf()
3268 if (str < end) in bstr_printf()
3278 str = string(str, end, (char *)str_arg, spec); in bstr_printf()
3300 if (str < end) { in bstr_printf()
3302 if (copy > end - str) in bstr_printf()
3303 copy = end - str; in bstr_printf()
3310 str = pointer(fmt, str, end, get_arg(void *), spec); in bstr_printf()
3318 if (str < end) in bstr_printf()
3363 str = number(str, end, num, spec); in bstr_printf()
3370 if (str < end) in bstr_printf()
3373 end[-1] = '\0'; in bstr_printf()