Add two device node flags, and use OF_DEVICE_NODE_FLAG_MAX instead of sizeof("xxxx"). Suggested-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> Signed-off-by: lijiazi <lijiazi@xxxxxxxxxx> --- 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