From: lijiazi <jqqlijiazi@gmail.com>
To: Petr Mladek <pmladek@suse.com>,
Steven Rostedt <rostedt@goodmis.org>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Jonathan Corbet <corbet@lwn.net>,
Rob Herring <robh+dt@kernel.org>,
Frank Rowand <frowand.list@gmail.com>
Cc: devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
lijiazi <lijiazi@xiaomi.com>
Subject: [PATCH v3 3/3] lib/vsprintf: add two device node flags
Date: Mon, 20 Jan 2020 19:38:29 +0800 [thread overview]
Message-ID: <49e5a1c51283b3ea829dc7a04028121764cf5961.1579423564.git.lijiazi@xiaomi.com> (raw)
In-Reply-To: <54fe6854ede6e2f22eb9775837da1ad7a13a3df4.1579423564.git.lijiazi@xiaomi.com>
In-Reply-To: <2d432e67cab2eb51f36f5b2e904a185ef48df6e0.1579423564.git.lijiazi@xiaomi.com>
Add two device node flags, and use OF_DEVICE_NODE_FLAG_MAX instead
of sizeof("xxxx").
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: lijiazi <lijiazi@xiaomi.com>
---
Changes in v3:
- check the flag in the same way as before.
- split v2 to 3 patches.
---
lib/vsprintf.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 7c488a1..b73e584 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1937,7 +1937,7 @@ static noinline_for_stack
char *device_node_string(char *buf, char *end, struct device_node *dn,
struct printf_spec spec, const char *fmt)
{
- char tbuf[sizeof("xxxx") + 1];
+ char tbuf[OF_DEVICE_NODE_FLAG_MAX + 1];
const char *p;
int ret;
char *buf_start = buf;
@@ -2001,7 +2001,9 @@ char *device_node_string(char *buf, char *end, struct device_node *dn,
tbuf[1] = of_node_check_flag(dn, OF_DETACHED) ? 'd' : '-';
tbuf[2] = of_node_check_flag(dn, OF_POPULATED) ? 'P' : '-';
tbuf[3] = of_node_check_flag(dn, OF_POPULATED_BUS) ? 'B' : '-';
- tbuf[4] = 0;
+ tbuf[4] = of_node_check_flag(dn, OF_OVERLAY) ? 'O' : '-';
+ tbuf[5] = of_node_check_flag(dn, OF_OVERLAY_FREE_CSET) ? 'F' : '-';
+ tbuf[OF_DEVICE_NODE_FLAG_MAX] = 0;
buf = string_nocheck(buf, end, tbuf, str_spec);
break;
case 'c': /* major compatible string */
--
2.7.4
next prev parent reply other threads:[~2020-01-20 11:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-20 11:38 [PATCH v3 1/3] lib/vsprintf: add two device node flags for %pOF lijiazi
2020-01-20 11:38 ` [PATCH v3 2/3] lib/vsprintf: introduce OF_DEVICE_NODE_FLAG_MAX lijiazi
2020-01-20 11:38 ` lijiazi [this message]
2020-01-20 14:19 ` [PATCH v3 3/3] lib/vsprintf: add two device node flags Andy Shevchenko
2020-02-10 11:42 ` Petr Mladek
2020-01-20 13:38 ` [PATCH v3 2/3] lib/vsprintf: introduce OF_DEVICE_NODE_FLAG_MAX Sergey Senozhatsky
2020-01-20 14:16 ` Andy Shevchenko
2020-01-20 13:36 ` [PATCH v3 1/3] lib/vsprintf: add two device node flags for %pOF Sergey Senozhatsky
2020-01-20 14:14 ` Andy Shevchenko
2020-01-20 14:47 ` Sergey Senozhatsky
2020-01-20 14:20 ` Andy Shevchenko
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=49e5a1c51283b3ea829dc7a04028121764cf5961.1579423564.git.lijiazi@xiaomi.com \
--to=jqqlijiazi@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=lijiazi@xiaomi.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=pmladek@suse.com \
--cc=robh+dt@kernel.org \
--cc=rostedt@goodmis.org \
--cc=sergey.senozhatsky@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).