Message ID | 20220620004233.3805-21-kent.overstreet@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 79585C433EF for <linux-mm@archiver.kernel.org>; Mon, 20 Jun 2022 00:43:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0F56B6B007E; Sun, 19 Jun 2022 20:43:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0A49D6B0085; Sun, 19 Jun 2022 20:43:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EAE4F6B0087; Sun, 19 Jun 2022 20:43:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id DC55C6B007E for <linux-mm@kvack.org>; Sun, 19 Jun 2022 20:43:22 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id BA0F1344A6 for <linux-mm@kvack.org>; Mon, 20 Jun 2022 00:43:22 +0000 (UTC) X-FDA: 79596765444.17.3269F56 Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) by imf31.hostedemail.com (Postfix) with ESMTP id 694B92000E for <linux-mm@kvack.org>; Mon, 20 Jun 2022 00:43:22 +0000 (UTC) Received: by mail-qv1-f46.google.com with SMTP id t16so9021893qvh.1 for <linux-mm@kvack.org>; Sun, 19 Jun 2022 17:43:22 -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=oFSr89aEU92gWcunlU5vS2f7TnOlgJfvUBwY+HXlWFw=; b=cgxYlVJ4GLr3WkdItoWKiuQPJXd0/Yj+V7c1QPL/3/kcDcVxN2pyVSRSVKCySEDzli BNYCNb17DVymCnCJL362udOhu/AJAbK9iwMjJuy9M9l+18C16sPzNhw3Tco8nWT3Qu7W vMhLiaOq69smKx8migXhSCfkKo6rlhgmyYvB1Mvx2m3CAcHjCiiHi1tOoLHuBZS2FaTZ 73/zfoNTLVn4p5wG5pTLFURCPiku9Qa75shYPRR3B+Gq0OXW3D54CnGhCFQA0KxQIELo zNFaycSH2cHnwvWQteHgtf2UnrkymMkegc2Qr3q6snyK1xQjVN0RIbwRRzORQ/SJG8AM AUUA== 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=oFSr89aEU92gWcunlU5vS2f7TnOlgJfvUBwY+HXlWFw=; b=qtQqwYfWccUAU+BnRsQSo82gpeshtlk9Er8x0MppomU0rUNc+X5iHbN4398h9P1ZRt LCstZaoB7xJ0KMXAv3cj8Jj+YNkzP5cP6LD8QiBerkI/2LnbyZyH4veHRVvHrMyJleRg EvqUs3It7DLNRvNKs0SFgSGxIoy2/KZ6TeuyCqrJCdGB78fYFhQp2OL9vczOxmx0/7nb eu2U68yS2rQaMpGZkvwkBbWwasgZxxMbu3mwIJM7M+s3AmeUPR3ACCNa6zH2laf8/DkU 3QWSWqPQ5WxFVUJc/fFhOqQBtCadHcQdQz7RGM3DKMnwJRAjs9FlKr+IJkudFOaKUu7O pixg== X-Gm-Message-State: AJIora8PZuQ2UaHJK46h+jlzOMosJRB/JSERiDXi6E4CAkE8mySnYFhT LeMf4vgILiISYx0isk+qNA== X-Google-Smtp-Source: AGRyM1uM1OOd6wF+UQ3AdfkXj7CcsIPtdmf+wpKlLPB24tvyPh8HWTFZTJz/0aRTR4yVX2WPdDwz8w== X-Received: by 2002:ac8:5a01:0:b0:305:205e:5b61 with SMTP id n1-20020ac85a01000000b00305205e5b61mr17841821qta.218.1655685801680; Sun, 19 Jun 2022 17:43:21 -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 g2-20020ac80702000000b00304f79b2bcfsm9626734qth.49.2022.06.19.17.43.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jun 2022 17:43:20 -0700 (PDT) From: Kent Overstreet <kent.overstreet@gmail.com> To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, pmladek@suse.com Cc: Kent Overstreet <kent.overstreet@gmail.com>, rostedt@goodmis.org, enozhatsky@chromium.org, linux@rasmusvillemoes.dk, willy@infradead.org Subject: [PATCH v4 20/34] vsprintf: flags_string() no longer takes printf_spec Date: Sun, 19 Jun 2022 20:42:19 -0400 Message-Id: <20220620004233.3805-21-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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655685802; a=rsa-sha256; cv=none; b=Y5wgnDcy8jAI0nNbeIDrxIMyJyS7Qm2k3ec/VhnReTumAPkyX8IMKI5Fz87ZWsfC4Kzh1v nm5tUy6uhXBgAumdNtTZlmdVShCR7mwNflYGoMjbPFdmaGhHoSrztTfWfYxWq9uB2zRzpY MzoVriw7SQuGZLmXwRagCOKtqW6QlAA= ARC-Authentication-Results: i=1; imf31.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=cgxYlVJ4; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf31.hostedemail.com: domain of kent.overstreet@gmail.com designates 209.85.219.46 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=1655685802; 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=oFSr89aEU92gWcunlU5vS2f7TnOlgJfvUBwY+HXlWFw=; b=O33wZibeEtuIUzC6TD3dl3GW0U7LySvF+PhgvpFcd+6PDGuybF8mtKQUQkQ1feOETcHgQX UPaEO5u9xyM8scNKWYWcYA2oXFR9udbOhIjbUOVG1c3sEnEs8cp0IK1GyylQ4HpvaIDBjE m3Rfgv36hfFIIMCRAhGnPUyFarYfs2c= X-Rspamd-Queue-Id: 694B92000E X-Rspam-User: Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=cgxYlVJ4; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf31.hostedemail.com: domain of kent.overstreet@gmail.com designates 209.85.219.46 as permitted sender) smtp.mailfrom=kent.overstreet@gmail.com X-Rspamd-Server: rspam06 X-Stat-Signature: 6ku14y7prujuj7aund98htqxajdms9nu X-HE-Tag: 1655685802-500433 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
Printbufs - new data structure for building strings
|
expand
|
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index affe2b0bcc..3900f7a1a5 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -1942,12 +1942,12 @@ void format_page_flags(struct printbuf *out, unsigned long flags) static noinline_for_stack void flags_string(struct printbuf *out, void *flags_ptr, - struct printf_spec spec, const char *fmt) + const char *fmt) { unsigned long flags; const struct trace_print_flags *names; - if (check_pointer_spec(out, flags_ptr, spec)) + if (check_pointer(out, flags_ptr)) return; switch (fmt[1]) { @@ -1962,7 +1962,7 @@ void flags_string(struct printbuf *out, void *flags_ptr, names = gfpflag_names; break; default: - return error_string_spec(out, "(%pG?)", spec); + return error_string(out, "(%pG?)"); } return format_flags(out, flags, names); @@ -2335,7 +2335,8 @@ void pointer(struct printbuf *out, const char *fmt, #endif case 'G': - return flags_string(out, ptr, spec, fmt); + flags_string(out, ptr, fmt); + return do_width_precision(out, prev_pos, spec); case 'O': return device_node_string(out, ptr, spec, fmt + 1); case 'f':
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@gmail.com> --- lib/vsprintf.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)