[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220519172421.162394-19-kent.overstreet@gmail.com>
Date: Thu, 19 May 2022 13:24:11 -0400
From: Kent Overstreet <kent.overstreet@...il.com>
To: linux-kernel@...r.kernel.org, linux-mm@...r.kernel.org,
pmladek@...e.com, rostedt@...dmis.org, senozhatsky@...omium.org
Cc: Kent Overstreet <kent.overstreet@...il.com>,
andriy.shevchenko@...ux.intel.com, willy@...radead.org
Subject: [PATCH v2 18/28] vsprintf: time_and_date() no longer takes printf_spec
We're attempting to consolidate printf_spec and format string handling
in the top level vpr_buf(), this changes time_and_date() to not
take printf_spec.
Signed-off-by: Kent Overstreet <kent.overstreet@...il.com>
---
lib/vsprintf.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 76947e0d30..837a3f967e 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1735,14 +1735,14 @@ void time_str(struct printbuf *out, const struct rtc_time *tm, bool r)
static noinline_for_stack
void rtc_str(struct printbuf *out, const struct rtc_time *tm,
- struct printf_spec spec, const char *fmt)
+ const char *fmt)
{
bool have_t = true, have_d = true;
bool raw = false, iso8601_separator = true;
bool found = true;
int count = 2;
- if (check_pointer_spec(out, tm, spec))
+ if (check_pointer(out, tm))
return;
switch (fmt[count]) {
@@ -1780,7 +1780,7 @@ void rtc_str(struct printbuf *out, const struct rtc_time *tm,
static noinline_for_stack
void time64_str(struct printbuf *out, const time64_t time,
- struct printf_spec spec, const char *fmt)
+ const char *fmt)
{
struct rtc_time rtc_time;
struct tm tm;
@@ -1798,21 +1798,20 @@ void time64_str(struct printbuf *out, const time64_t time,
rtc_time.tm_isdst = 0;
- rtc_str(out, &rtc_time, spec, fmt);
+ rtc_str(out, &rtc_time, fmt);
}
static noinline_for_stack
-void time_and_date(struct printbuf *out,
- void *ptr, struct printf_spec spec,
+void time_and_date(struct printbuf *out, void *ptr,
const char *fmt)
{
switch (fmt[1]) {
case 'R':
- return rtc_str(out, (const struct rtc_time *)ptr, spec, fmt);
+ return rtc_str(out, (const struct rtc_time *)ptr, fmt);
case 'T':
- return time64_str(out, *(const time64_t *)ptr, spec, fmt);
+ return time64_str(out, *(const time64_t *)ptr, fmt);
default:
- return error_string_spec(out, "(%pt?)", spec);
+ return error_string(out, "(%pt?)");
}
}
@@ -2300,7 +2299,8 @@ void pointer(struct printbuf *out, const char *fmt,
dentry_name(out, ptr, fmt);
return do_width_precision(out, prev_pos, spec);
case 't':
- return time_and_date(out, ptr, spec, fmt);
+ time_and_date(out, ptr, fmt);
+ return do_width_precision(out, prev_pos, spec);
case 'C':
return clock(out, ptr, spec, fmt);
case 'D':
--
2.36.0
Powered by blists - more mailing lists