vsprintf: prt_u64_minwidth(), prt_u64()
Subsystems (2)
PATCH 1/1 vsprintf: prt_u64_minwidth(), prt_u64()
From: Kent Overstreet <[email protected]>
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 <[email protected]>
Cc Petr Mladek <[email protected]>
Cc Rasmus Villemoes <[email protected]>
Signed-off-by Kent Overstreet <[email protected]>
--- include/linux/kernel.h | 5 ++- lib/vsprintf.c | 95 ++++++++++++++++++++---------------------- 2 files changed, 50 insertions(+), 50 deletions(-)
include/linux/kernel.h +4 -1
@@ -202,12 +202,15 @@ 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,bool zeropad); +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);
lib/vsprintf.c +46 -49
147 lines not on this page · raw message
Signature · 1 line
2.36.1