Received: by 10.223.185.116 with SMTP id b49csp1136111wrg; Fri, 16 Feb 2018 13:09:03 -0800 (PST) X-Google-Smtp-Source: AH8x226jFQAbbhtl22jPP8TqUjfVgszQs8lIC2pplICUzAHQHwFR7+9txu0WTIrsID+GW07PUBky X-Received: by 2002:a17:902:43e4:: with SMTP id j91-v6mr6854370pld.153.1518815343555; Fri, 16 Feb 2018 13:09:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518815343; cv=none; d=google.com; s=arc-20160816; b=S0l9jvtqrCue0+L09loOVb2Jz9qBIpSDwtDbiAiS1IQLhE6LeXdgqeILvlUw0JRmgE CVKy1rfgITEv/NTvrulXJlCpf/4xKbM0ZhMAqc1C11954QHw5lGPv+SX/Jk3CZjMvT2t 00eYK6o/l7hXnQZppk/JEurp9JXCtBI/e+Uk7tmi9M1VoNmy10/5LgbfwQjBjzkAQNd4 lAFVKpHirUBYYdTKD+o/lv3uy/PeLOynK121crL+qGWI058OtWQ/j4Bqlrgj3SJd01wY weEhHFcaaV0YalVy0mIynxoe3ymU18SEhrYCaEt7QC5+wZQF+N80mtVgYs+XWmD9wRQa tIxQ== 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=tbOK/R1GFns8BGmgzq9FvK+EQpvFVaPFovs56EPTLOM=; b=mdWcArEVsbiLcbHf4yZHbvX8kxMY10b/TWXhOGuLrVnPH2WIdxWxw7cFYSFOMHQAdT CRZBO1Vd1V/jlrs250Wu6YnsIIewFz8bietQl1N8mMjT0xfH68ZrRwmTIeiIRvnMSQaa 816Cx9UrPDfYU3PhlBEZDXlmwhXj01a2xVVnbnqeF0D9GLFHMFR/c+8MBKnc+569d6Xw dXwrx4/dNn9oW2E5A6we03jtDAV6jDTa2glWRE59225p33BjDrthqf57oI4zOxe7SeTf TBkPmJwngR0IuaJO47ftWPYea+mXpuS+bUV8IoyaDWR5Uyc6W0CAPPdsqREu/oP46DE6 b9yA== 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 g11si4700217pgq.80.2018.02.16.13.08.49; Fri, 16 Feb 2018 13:09:03 -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 S1750944AbeBPVHV (ORCPT + 99 others); Fri, 16 Feb 2018 16:07:21 -0500 Received: from mga05.intel.com ([192.55.52.43]:50074 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750734AbeBPVHQ (ORCPT ); Fri, 16 Feb 2018 16:07:16 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.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="18315367" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 16 Feb 2018 13:07:14 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 28300FC; 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 4/9] lib/vsprintf: Make flag_spec global Date: Fri, 16 Feb 2018 23:07:06 +0200 Message-Id: <20180216210711.79901-4-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 flags as number is in use. Make it global and convert existing users. Signed-off-by: Andy Shevchenko --- lib/vsprintf.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 0c23b006b495..c789d265311b 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -698,6 +698,12 @@ static const struct printf_spec default_str_spec = { .precision = -1, }; +static const struct printf_spec default_flag_spec = { + .base = 16, + .precision = -1, + .flags = SPECIAL | SMALL, +}; + static const struct printf_spec default_dec_spec = { .base = 10, .precision = -1, @@ -737,11 +743,6 @@ char *resource_string(char *buf, char *end, struct resource *res, .precision = 10, .flags = LEFT, }; - static const struct printf_spec flag_spec = { - .base = 16, - .precision = -1, - .flags = SPECIAL | SMALL, - }; /* 32-bit res (sizeof==4): 10 chars in dec, 10 in hex ("0x" + 8) * 64-bit res (sizeof==8): 20 chars in dec, 18 in hex ("0x" + 16) */ @@ -798,7 +799,7 @@ char *resource_string(char *buf, char *end, struct resource *res, p = string(p, pend, " disabled", str_spec); } else { p = string(p, pend, " flags ", str_spec); - p = number(p, pend, res->flags, flag_spec); + p = number(p, pend, res->flags, default_flag_spec); } *p++ = ']'; *p = '\0'; @@ -1466,12 +1467,6 @@ char *format_flags(char *buf, char *end, unsigned long flags, const struct trace_print_flags *names) { unsigned long mask; - const struct printf_spec numspec = { - .flags = SPECIAL|SMALL, - .field_width = -1, - .precision = -1, - .base = 16, - }; for ( ; flags && names->name; names++) { mask = names->mask; @@ -1489,7 +1484,7 @@ char *format_flags(char *buf, char *end, unsigned long flags, } if (flags) - buf = number(buf, end, flags, numspec); + buf = number(buf, end, flags, default_flag_spec); return buf; } -- 2.15.1