Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2445493iog; Sun, 19 Jun 2022 18:17:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sFMT3iAzRveKkctYm8kORvCWCPS/uEfh0+V5H9/mCzngkMTmWsZtcMP6xJ4UW7ltaVu6nn X-Received: by 2002:a17:907:3f11:b0:711:d56d:ab57 with SMTP id hq17-20020a1709073f1100b00711d56dab57mr18950112ejc.160.1655687848537; Sun, 19 Jun 2022 18:17:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655687848; cv=none; d=google.com; s=arc-20160816; b=K5mvCRtimJI3NYquTXPa3Z+IniMUlYFywc6PPAhee+ipJ5EM7Xc9YNzTN1O2PwZl21 GpvbbJLfUh9BrBjWjc4hOayhMgPhzn+7H+fPRe76JosqfAAScNyf7hr+D1QPxKGxUC72 ut0Z4rjHyDzN2ilURXd8SMUu0fQRCFspOTxZc/DXmEYbbaFYi2V4N9ZB7QNXIfoyVzBa ozMeH9TLK1rSjnd51pcDMegCM/YgAYJgBMuT0gTo96iEUKx97EQbUXf8pseC2MAtEsWZ 6K5NRiHpXFKVk6svqHkIZN360/1wyP/E6cqErgC0FcX36PbDJ6q4+d7GqqI6qDEiJCbY s6bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7klV3vdNzn8/A87P4NR4f70XoVa4SM0sCvYSYAJUFs4=; b=oNQ0I1ZSRK827X9AE5eBvs0zKg838UbmaoI9Tx1YZR5VeQZV57DZqpGx/Rv8yubgI+ eSCJSNGvQpYcbzijj/1urgBeNvqYhJ4MADQjnIuW6p5s59BP7wPK+cT/Cylz7Tai7BnF BqJk6BhK9PXJLgqKIjmQl+ga09qH0s3aMhrb6y2YH4svnjeyuJK9Wa4V4NVYZTN/vGfF XFrzXn0iu8JUNtzoeKn/dm/jR3u4RijW32d9AfShMB/YpWeZ4nb8JoMUNuIIdgB3IdHe an55idX0GsHDc3aIrp3+a2afLCUjR0ESGaTdPG2m6FdvOjUGkkRIV9biGM+b44j6Xz2w s/Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Z3bzbCoa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb29-20020a1709077e9d00b007122faebbdasi12987784ejc.494.2022.06.19.18.17.04; Sun, 19 Jun 2022 18:17:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Z3bzbCoa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238267AbiFTAob (ORCPT + 99 others); Sun, 19 Jun 2022 20:44:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238140AbiFTAn3 (ORCPT ); Sun, 19 Jun 2022 20:43:29 -0400 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 037DEBC1F for ; Sun, 19 Jun 2022 17:43:20 -0700 (PDT) Received: by mail-qk1-x72b.google.com with SMTP id d23so6897371qke.0 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=ZxyXdAnHzkCF+zKt97gdb31N6Jj3/vs3grU1alWST4X+wwicCYDN+FK4UPz6V016Hd QFAzB67UchmbdC0yYjNEc846VF10vPKzleE55W3UzgWT4x9AtE8B7h+y11YjKyVVO4os 54ox5JMw66FXQNdh3vwZzlyxyX7v35a1/2cbuR3jZ00ikzUhjbA9J/ps0aIOyZY2OPfC r2ARZJYKnCO+EInp7439n5XFRxAZx6zdKu2TbxH4ga+vCX188UH6eiM0UZac3XILrDWB ZsWMtWUaASHOlz1rf03ALuAFsPMrKVO9fJBItcSoNhluUi5B0Hz/hRxQ05yloNCOylul gztg== X-Gm-Message-State: AJIora9XZ+j7wqSxP2HBBJM6EiHwCg9+lARMc3IJIh0yH9923t2nborQ QVWe85HPS3T42dEhs20k4H5o89NfkEWLAw0= 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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': -- 2.36.1