Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp4274292rwb; Sun, 7 Aug 2022 20:03:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR6irZN1ryMD201wH1YQpw4IIBwkQaLjxmEDwzwQnBbV4o/+QNey80eQ9Ng5ZwFI70F/m6af X-Received: by 2002:a50:ec0c:0:b0:43c:fd26:404d with SMTP id g12-20020a50ec0c000000b0043cfd26404dmr16383564edr.359.1659927830293; Sun, 07 Aug 2022 20:03:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659927830; cv=none; d=google.com; s=arc-20160816; b=TnpJg4ZGCSNDp9fQ4u9siPi41TVVifBlY+w/uQD9x1ZePaESN+Br3ouBJgW6e0rBSg Hfh3b4u4J/QkArR0K9A0DhXMouUg4u5kPZy/DUbZbep8C5vO9d+9DX/IisQyaW9h++gK wypNCs6O3ifdy+8sSPzfZli7XVjxvNWcv+cpBMvpj+/QywzNPpGawwIrBHKDYesnzT/A L9yyztRDM4DN8f7EuhQMvwIs5jcq+BSTmLNJJeR3Ms5dYUHIbVvUtjYbN8GLAAKgP2XX d75G5NsqZGmEKKCPlVvEu5X85ySn/v3shbqh9igFGOkul780ew6o9kwTiBaFVOg0YN8o MG4Q== 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=XMPtB3chMhlXpXIghsTgAd24SoNYbzppATzU+ECsSLw=; b=zdwGBThp4JBEfUnfmLyfRaJBvh0FOVauFeCgHYNLNAwGCZPPA2Cji+iT3MywhqKMbS 1gO+JzTyzh4LXAsa+Jv73mjXGv4DGzNR+UVBMPmPkjVgRs56L45EW4fJaq5dug0XXPLo 4LoPXMPYgd52cK462NTBeyY6bUlig0SXBHfHpw2vRs+Fs96tGb+Nku9D9McLGaNTQdSG ostqzNVGfHmnNIH56JNnv6egCrv9Nh92RuA2W0+51GqMvo6e5o1/kYDy/Qi9NI3xuyGF S0+gQmbxbBZRRvDIFyUJ11mwLhp4rNpGr/XVppkq4hXaeGq578ranfL+xse7N8X00elj DDuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=oCAkoSLb; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id du5-20020a17090772c500b007309e3750acsi2106955ejc.652.2022.08.07.20.03.25; Sun, 07 Aug 2022 20:03:50 -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=@infradead.org header.s=casper.20170209 header.b=oCAkoSLb; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244023AbiHHCnU (ORCPT + 99 others); Sun, 7 Aug 2022 22:43:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242539AbiHHClm (ORCPT ); Sun, 7 Aug 2022 22:41:42 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C177C25ED for ; Sun, 7 Aug 2022 19:41:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=XMPtB3chMhlXpXIghsTgAd24SoNYbzppATzU+ECsSLw=; b=oCAkoSLbXX9r3HlgG8il8G41x5 Ed2SKexRgOfHJPUy4mgqJXrHIj5sYv+OX3S0rxJNEn1/GG9MGIJvcg4VbW3TnVgDEsaSSmDu0woHd 9iTPTf5oSqEqMr4B3KU3+SxJjQXLeHJOnPjXxQjMw1lYzugr5jjmRJdahHqyzb2pbI1UlOqawOgUL B9v8DhOPf9AzLS4Yau1UQ8wo+HZPn8vowSQBtvcBpuXHJK97yI7Z68io7xQtYhrYavqBYOiU/gAQH kTKN4iktY/YbqljHCix/r4Y3L7GdOWxhc0p6swUFODfnE2a7XIPIPxRJXHlvmJOMU8L8+yP0OWCfs k8URUZoQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oKshy-00DVRx-0m; Mon, 08 Aug 2022 02:41:34 +0000 From: "Matthew Wilcox (Oracle)" To: linux-kernel@vger.kernel.org, pmladek@suse.com, Kent Overstreet Cc: Rasmus Villemoes Subject: [PATCH v5 17/32] vsprintf: time_and_date() no longer takes printf_spec Date: Mon, 8 Aug 2022 03:41:13 +0100 Message-Id: <20220808024128.3219082-18-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220808024128.3219082-1-willy@infradead.org> References: <20220808024128.3219082-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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 From: Kent Overstreet 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 Cc: Petr Mladek Cc: Rasmus Villemoes --- lib/vsprintf.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 2042c17f571e..784f7cb64926 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -1736,14 +1736,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]) { @@ -1781,7 +1781,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; @@ -1799,21 +1799,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?)"); } } @@ -2297,7 +2296,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.35.1