diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-05-10 15:43:33 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-06-09 15:09:29 -0400 |
commit | 6d583f29cbf61d3d26e0ec180125435c76af6194 (patch) | |
tree | e4ba92baae4e8b2ad10626e4c57605eecca6e10c /include/linux/kernel.h | |
parent | 4807b317b913b31c475e2a5aafbecf3cae3001f6 (diff) |
vsprintf: prt_u64_minwidth(), prt_u64()
This adds two new-style printbuf helpers for printing simple u64s, and
converts num_to_str() to be a simple wrapper around prt_u64_minwidth().
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r-- | include/linux/kernel.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 1906861ece7a..9ba5a53c6ad5 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -202,12 +202,14 @@ static inline void might_fault(void) { } void do_exit(long error_code) __noreturn; +struct printbuf; +extern void prt_u64_minwidth(struct printbuf *out, u64 num, unsigned width); +extern void prt_u64(struct printbuf *out, u64 num); extern int num_to_str(char *buf, int size, unsigned long long num, unsigned int width); /* lib/printf utilities */ -struct printbuf; extern __printf(2, 3) void prt_printf(struct printbuf *out, const char *fmt, ...); extern __printf(2, 0) void prt_vprintf(struct printbuf *out, const char *fmt, va_list); |