From patchwork Mon Jun 20 00:42:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 12886910 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9C85C433EF for ; Mon, 20 Jun 2022 00:43:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 847656B0081; Sun, 19 Jun 2022 20:43:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7F6F76B0085; Sun, 19 Jun 2022 20:43:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6BF716B0087; Sun, 19 Jun 2022 20:43:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 5F2126B0081 for ; Sun, 19 Jun 2022 20:43:20 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 356501201E3 for ; Mon, 20 Jun 2022 00:43:20 +0000 (UTC) X-FDA: 79596765360.24.8008393 Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) by imf10.hostedemail.com (Postfix) with ESMTP id DA173C008C for ; Mon, 20 Jun 2022 00:43:19 +0000 (UTC) Received: by mail-qk1-f170.google.com with SMTP id p63so6869501qkd.10 for ; Sun, 19 Jun 2022 17:43:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7klV3vdNzn8/A87P4NR4f70XoVa4SM0sCvYSYAJUFs4=; b=Z3bzbCoaTUPOIlSJfmP24rQbW9QXTC2u/4OSlp5WsFbVg32IAjNFiVf7vpfBvUqED4 mX8ohRYUETDXPDKpqRWJq7h06hM1H/joHmCP/Qep7+Wg6RJl6T9s9cdHAUy5u2/p4kTQ 6bIFpx6gCBuCrJH8WVnm2K9eTM8FDhQmf1VcfWCVWmTq/q35S+TCxwaSPKAEeeJbpEP2 Rb6I7WqUrcsXBBKUfvKm54t/KKbYLsPivsXZ3Cewri90jbqHE93VSRyzNXSeTx9hEGMU XwFh/U+CohoHOqHWVCXT/0u8g1+SvDXxnM4d2sIsFmG6NEw6Qt0o8Ar2OC8dbDIubw5h Hmkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7klV3vdNzn8/A87P4NR4f70XoVa4SM0sCvYSYAJUFs4=; b=SVXuQFYWEKCYgZVoLThC3fRhWrpcgYANu1ZqnetDi/ew8fLWzQyFC58HidwksZbbkv x7xGwgIW7KRo8FA5H1LHbf4Y4biItq3eqcx5UyCw9VkBZPP9o+cpDuWZKq7x0J/0JF7J 8KM9xPNqtZwwRywQ/mr0vMFKFLQqLB6qyEqkxMOeEMRuA8KxZdZxJ+bKkNwlRB43QkbN a2Z3Uq9eC/CnNzeQg5f8q8nq4d7lihVj7Sz1wZ1GqxPS0SCqMWOXONji9nUb7AEOw727 7aqVjtGqisQ04EkT9UkGQkm8Jmq5zTAvYLjJc8ZiYmmv0KOJRKZxJnw/GcZGSG//E57T BYeg== X-Gm-Message-State: AJIora9KrDkoC/WCULIsrqPRUf91Uz+pSv2V5ufR/+o6azq8urDTi5fC Lp1oWzplyditW+wCdX+s7Q== X-Google-Smtp-Source: AGRyM1umLaPAf/akasIsSgksCEhoGwYZ3ZODEavmbk0rCbtNu+YACEOmp4mlkvsk1Aepg/nAjndhmg== X-Received: by 2002:ae9:e70d:0:b0:6ab:94ad:fe23 with SMTP id m13-20020ae9e70d000000b006ab94adfe23mr9066959qka.739.1655685799180; Sun, 19 Jun 2022 17:43:19 -0700 (PDT) Received: from localhost (c-73-219-103-14.hsd1.vt.comcast.net. [73.219.103.14]) by smtp.gmail.com with ESMTPSA id s7-20020a05620a254700b006a6ab8f761csm11425215qko.62.2022.06.19.17.43.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jun 2022 17:43:17 -0700 (PDT) From: Kent Overstreet To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, pmladek@suse.com Cc: Kent Overstreet , rostedt@goodmis.org, enozhatsky@chromium.org, linux@rasmusvillemoes.dk, willy@infradead.org Subject: [PATCH v4 19/34] vsprintf: time_and_date() no longer takes printf_spec Date: Sun, 19 Jun 2022 20:42:18 -0400 Message-Id: <20220620004233.3805-20-kent.overstreet@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220620004233.3805-1-kent.overstreet@gmail.com> References: <20220620004233.3805-1-kent.overstreet@gmail.com> MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655685799; a=rsa-sha256; cv=none; b=V69J8Xr3AexGUbIzOmS0VKcAt6CbI+s6Dk2/acbrAoLdWkrDLen8WiR3DmAXJKaRPqchfU 6/2DyU/gq940br5vJO9M4P1J4KOLgrqwYPmJGvfjkchzYThUJHCraXmgqu2IT7a9p3D9y1 aUiEQc9UP6JgK09a4XkAbx6efGy4nHU= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Z3bzbCoa; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf10.hostedemail.com: domain of kent.overstreet@gmail.com designates 209.85.222.170 as permitted sender) smtp.mailfrom=kent.overstreet@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655685799; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7klV3vdNzn8/A87P4NR4f70XoVa4SM0sCvYSYAJUFs4=; b=tUnZPZyz2la3DFSPyMdoshwJVTtpvNxkPU1RE4c827F/PIA0So9/RiwwpRSEmF5f2VjwR5 bZNUG9SHRCQU7CyXl2cgXr6r6WsULRpBRoTb8FEN0rTBqmwd8GfSrv/8pt0Q0w5GwM9UG6 6wr+KQOWXbkCnw3EgHw19CmLy5J38Sk= X-Rspamd-Server: rspam01 X-Rspam-User: Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Z3bzbCoa; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf10.hostedemail.com: domain of kent.overstreet@gmail.com designates 209.85.222.170 as permitted sender) smtp.mailfrom=kent.overstreet@gmail.com X-Stat-Signature: nhpd7tqjajrzytdy7kf43jopqqsn44od X-Rspamd-Queue-Id: DA173C008C X-HE-Tag: 1655685799-594160 X-Bogosity: Ham, tests=bogofilter, spamicity=0.044574, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 --- lib/vsprintf.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 486c09b4ad..affe2b0bcc 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -1761,14 +1761,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]) { @@ -1806,7 +1806,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; @@ -1824,21 +1824,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?)"); } } @@ -2322,7 +2321,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':