From: Jia He <justin.he@arm.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
Petr Mladek <pmladek@suse.com>,
Steven Rostedt <rostedt@goodmis.org>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Jonathan Corbet <corbet@lwn.net>,
Luca Coelho <luciano.coelho@intel.com>,
Kalle Valo <kvalo@codeaurora.org>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
Johannes Berg <johannes.berg@intel.com>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
linux-s390@vger.kernel.org, Jia He <justin.he@arm.com>
Subject: [PATCH 4/4] lib/test_printf: Explicitly add components number to %pD and %pd
Date: Wed, 28 Apr 2021 21:59:29 +0800 [thread overview]
Message-ID: <20210428135929.27011-4-justin.he@arm.com> (raw)
In-Reply-To: <20210428135929.27011-1-justin.he@arm.com>
After changing the default components number from 1 to 4 for %pD
and %pd, it would be better to explicitly add the number in test_printf
cases.
Add a test case of %pd5 to verify if it can be capped by 4 components.
Signed-off-by: Jia He <justin.he@arm.com>
---
lib/test_printf.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/lib/test_printf.c b/lib/test_printf.c
index 27b964ec723d..899cd55d1c90 100644
--- a/lib/test_printf.c
+++ b/lib/test_printf.c
@@ -478,18 +478,20 @@ static struct dentry test_dentry[4] __initdata = {
static void __init
dentry(void)
{
- test("foo", "%pd", &test_dentry[0]);
+ test("foo", "%pd1", &test_dentry[0]);
test("foo", "%pd2", &test_dentry[0]);
- test("(null)", "%pd", NULL);
- test("(efault)", "%pd", PTR_INVALID);
- test("(null)", "%pD", NULL);
- test("(efault)", "%pD", PTR_INVALID);
+ test("(null)", "%pd1", NULL);
+ test("(efault)", "%pd1", PTR_INVALID);
+ test("(null)", "%pD1", NULL);
+ test("(efault)", "%pD1", PTR_INVALID);
- test("romeo", "%pd", &test_dentry[3]);
+ test("romeo", "%pd1", &test_dentry[3]);
test("alfa/romeo", "%pd2", &test_dentry[3]);
test("bravo/alfa/romeo", "%pd3", &test_dentry[3]);
test("/bravo/alfa/romeo", "%pd4", &test_dentry[3]);
+ test("/bravo/alfa/romeo", "%pd", &test_dentry[3]);
+ test("/bravo/alfa/romeo", "%pd5", &test_dentry[3]);
test("/bravo/alfa", "%pd4", &test_dentry[2]);
test("bravo/alfa |bravo/alfa ", "%-12pd2|%*pd2", &test_dentry[2], -12, &test_dentry[2]);
--
2.17.1
prev parent reply other threads:[~2021-04-28 14:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-28 13:59 [PATCH 1/4] iwlwifi: mvm: Explicitly use %pd1 in debugfs entry Jia He
2021-04-28 13:59 ` [PATCH 2/4] lib/vsprintf.c: Make %p{D,d} mean as much components as possible Jia He
2021-04-28 15:10 ` Andy Shevchenko
2021-04-29 8:46 ` Petr Mladek
2021-04-29 8:52 ` Andy Shevchenko
2021-04-29 9:24 ` Petr Mladek
2021-04-30 1:35 ` Justin He
2021-04-28 13:59 ` [PATCH 3/4] s390/hmcdrv: Remove the redundant directory path in debug message Jia He
2021-04-28 13:59 ` Jia He [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210428135929.27011-4-justin.he@arm.com \
--to=justin.he@arm.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=borntraeger@de.ibm.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=johannes.berg@intel.com \
--cc=kuba@kernel.org \
--cc=kvalo@codeaurora.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=luciano.coelho@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox