Received: by 10.223.185.116 with SMTP id b49csp1138957wrg; Fri, 16 Feb 2018 13:12:08 -0800 (PST) X-Google-Smtp-Source: AH8x2252Eu8HeRqtYCFID8j9802S2F3CpCB6BgeVpFM7BEZ/FImmXiebsBh+KVlAnue3TiApyekt X-Received: by 2002:a17:902:2823:: with SMTP id e32-v6mr7029703plb.44.1518815528482; Fri, 16 Feb 2018 13:12:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518815528; cv=none; d=google.com; s=arc-20160816; b=zekrXwKZIoc8vvF3Tm6i8PR/Mr7yZeR/d8WQh41LdFACRBtxspDjFDy9U201zg0VMN HeKOquKISrfHaWD4i20JJMt3FEuqfOAJpzXG0z+dYYRkkw6y5zv4kStieFFpmK2UxpZn xvUo38Ht2602Ccij04t641ofxWNOO7Xqjg9e5BD+vZJ76AtKwE7x0iEaLY42kXOps+Rf GzfV/h5Q/FRs7p6iqBKQl7yhWkzi8OFlx3LPquCe/Ma2jfTq2UhiDwTCYzznA32a18Mo NZKPDpAJA1hG36xo8dKLtffAa8E0PSmMmOd6xXgqk3wIUukSvra2M+hSGX3USugHldtl kL7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=EMohXVrJxkFwjlRwcd5Q2Im7TwAfvD5OPkPv83orLrI=; b=tBMdbww5ep3hDPDbELvKpstXgz6UM4uULOpEAURpYQMdoPBN48Sxqff7FVLeH1rVhm kCe3YpR+iJbqkAtotH3eHDo1j9dLCq7iyhtjFGWXK57mN96hdnH3BA3VJFSbyEFyJcFr bhOKYfxszOZxZyZZD4QcWw4g/LuOpFHrQZl6pXBv2GWaFcoNdRIDSugL+M7//qReH5Ux 9Z09a5sVXd95R6WSlqfxacoZOowlNlvyhmAYCZlvUWvFQsCBP1yqFrruylg8+AD69FFy 4+zhITMP7t4fCh+KFnYwBmlDwndzysC5KOtR6Tn6kWf5OZ8tthTBXsikGqPxjHvXpUz0 eAWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d15-v6si1593439plr.551.2018.02.16.13.11.54; Fri, 16 Feb 2018 13:12:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750869AbeBPVHS (ORCPT + 99 others); Fri, 16 Feb 2018 16:07:18 -0500 Received: from mga12.intel.com ([192.55.52.136]:28372 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750727AbeBPVHQ (ORCPT ); Fri, 16 Feb 2018 16:07:16 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Feb 2018 13:07:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,520,1511856000"; d="scan'208";a="35372227" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 16 Feb 2018 13:07:13 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 1B9FFFB; Fri, 16 Feb 2018 23:07:13 +0200 (EET) From: Andy Shevchenko To: "Tobin C . Harding" , linux@rasmusvillemoes.dk, Petr Mladek , Joe Perches , linux-kernel@vger.kernel.org, Andrew Morton Cc: Andy Shevchenko Subject: [PATCH v2 3/9] lib/vsprintf: Make strspec global Date: Fri, 16 Feb 2018 23:07:05 +0200 Message-Id: <20180216210711.79901-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180216210711.79901-1-andriy.shevchenko@linux.intel.com> References: <20180216210711.79901-1-andriy.shevchenko@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are places where default specification to print strings is in use. Make it global and convert existing users. Signed-off-by: Andy Shevchenko --- lib/vsprintf.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 8f29af063d8a..0c23b006b495 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -693,6 +693,11 @@ char *symbol_string(char *buf, char *end, void *ptr, #endif } +static const struct printf_spec default_str_spec = { + .field_width = -1, + .precision = -1, +}; + static const struct printf_spec default_dec_spec = { .base = 10, .precision = -1, @@ -1461,10 +1466,6 @@ char *format_flags(char *buf, char *end, unsigned long flags, const struct trace_print_flags *names) { unsigned long mask; - const struct printf_spec strspec = { - .field_width = -1, - .precision = -1, - }; const struct printf_spec numspec = { .flags = SPECIAL|SMALL, .field_width = -1, @@ -1477,7 +1478,7 @@ char *format_flags(char *buf, char *end, unsigned long flags, if ((flags & mask) != mask) continue; - buf = string(buf, end, names->name, strspec); + buf = string(buf, end, names->name, default_str_spec); flags &= ~mask; if (flags) { @@ -1535,22 +1536,18 @@ char *device_node_gen_full_name(const struct device_node *np, char *buf, char *e { int depth; const struct device_node *parent = np->parent; - static const struct printf_spec strspec = { - .field_width = -1, - .precision = -1, - }; /* special case for root node */ if (!parent) - return string(buf, end, "/", strspec); + return string(buf, end, "/", default_str_spec); for (depth = 0; parent->parent; depth++) parent = parent->parent; for ( ; depth >= 0; depth--) { - buf = string(buf, end, "/", strspec); + buf = string(buf, end, "/", default_str_spec); buf = string(buf, end, device_node_name_for_depth(np, depth), - strspec); + default_str_spec); } return buf; } -- 2.15.1