From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F438C433EF for ; Fri, 15 Oct 2021 10:55:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A04E961073 for ; Fri, 15 Oct 2021 10:55:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A04E961073 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id D807E94000F; Fri, 15 Oct 2021 06:55:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D08A3940009; Fri, 15 Oct 2021 06:55:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD08194000F; Fri, 15 Oct 2021 06:55:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0087.hostedemail.com [216.40.44.87]) by kanga.kvack.org (Postfix) with ESMTP id AC7BC940009 for ; Fri, 15 Oct 2021 06:55:50 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 5793718232E58 for ; Fri, 15 Oct 2021 10:55:50 +0000 (UTC) X-FDA: 78698366460.18.F0CEC17 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf11.hostedemail.com (Postfix) with ESMTP id D772FF0000BA for ; Fri, 15 Oct 2021 10:55:49 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id C183B218E0; Fri, 15 Oct 2021 10:55:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1634295348; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=W6/lohsjSUxjrguE3/P7nPSKXMmQaFt9DwfH4To2noQ=; b=Af/wzOractoqBBiTF2xa3qo/5mgF3LLV+Ak8eUX6u9yyXqFUGJAyiVqv8xh/Wx/VfMqYva p/ZgfLmfultTI9ZpmWghxrB/X5p8U24of0JPPQs0cOoW4HC3cUz6XcGv3u11kmYOMIs6XF SwR9IzFifRkHgU3irtMQAszq317PlcY= Received: from suse.cz (unknown [10.100.224.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id A38C0A3B84; Fri, 15 Oct 2021 10:55:48 +0000 (UTC) Date: Fri, 15 Oct 2021 12:55:48 +0200 From: Petr Mladek To: "Matthew Wilcox (Oracle)" Cc: Yafang Shao , Sergey Senozhatsky , linux-mm@kvack.org, Vlastimil Babka , Rasmus Villemoes Subject: Re: [PATCH 5/5] vsprintf: Make %pGp print the hex value Message-ID: References: <20211012182647.1605095-1-willy@infradead.org> <20211012182647.1605095-6-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211012182647.1605095-6-willy@infradead.org> Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b="Af/wzOra"; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf11.hostedemail.com: domain of pmladek@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=pmladek@suse.com X-Stat-Signature: obk15gnd4c6xwgnas8kdncijnmruu3pp X-Rspamd-Queue-Id: D772FF0000BA X-Rspamd-Server: rspam01 X-HE-Tag: 1634295349-988594 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: On Tue 2021-10-12 19:26:47, Matthew Wilcox (Oracle) wrote: > All existing users of %pGp want the hex value as well as the decoded > flag names. This looks awkward (passing the same parameter to printf > twice), so move that functionality into the core. If we want, we > can make that optional with flag arguments to %pGp in the future. It makes sense. Just the selftest code is pain, see below ;-) > diff --git a/lib/test_printf.c b/lib/test_printf.c > index 662c3785aa57..a60b1a749e87 100644 > --- a/lib/test_printf.c > +++ b/lib/test_printf.c > @@ -613,6 +613,10 @@ page_flags_test(int section, int node, int zone, int last_cpupid, > bool append = false; > int i; > > + for (i = 0; i < ARRAY_SIZE(values); i++) > + page_flags |= (values[i] & pft[i].mask) << pft[i].shift; I can't get the idea behind this. IMHO, the value might be zero even when the related flag is set. And the %pGp code seems to always print page flags from page_flags_fields[] when the field width is not zero. Or do I misread the code? Best Regards, Petr