Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751366AbdFYRYQ (ORCPT ); Sun, 25 Jun 2017 13:24:16 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:51867 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750773AbdFYRYP (ORCPT ); Sun, 25 Jun 2017 13:24:15 -0400 Subject: Re: [PATCH] lib: vsprintf: add printf format conversion %M for errno strings To: "Enrico Weigelt, metux IT consult" , linux-kernel@vger.kernel.org References: <20170625171230.7613-1-enrico.weigelt@gr13.net> From: Randy Dunlap Message-ID: <37d0f40f-2ea8-1fad-2cc7-2d8d45b1a43f@infradead.org> Date: Sun, 25 Jun 2017 10:24:14 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20170625171230.7613-1-enrico.weigelt@gr13.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1321 Lines: 47 On 06/25/2017 10:12 AM, Enrico Weigelt, metux IT consult wrote: > Adding a new format conversion for *printf() and friends. > > If CONFIG_ERRNO_PRINTF_VERBOSE is enabled, prints human-readable > strerror()-like texts, otherwise just the number. > --- > lib/Kconfig | 19 +++++++ > lib/vsprintf.c | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- > 2 files changed, 189 insertions(+), 2 deletions(-) > > diff --git a/lib/Kconfig b/lib/Kconfig > index 0c8b78a9ae2e..b28ab2162435 100644 > --- a/lib/Kconfig > +++ b/lib/Kconfig > @@ -7,6 +7,25 @@ config BINARY_PRINTF > > menu "Library routines" > > +config ERRNO_PRINTF > + bool "printf conversion %M for errno codes" > + default n > + help > + This option adds an %M modifier for *printf() for errno values. > + (and callers like printk() etc) > + > + In conjunction with ERRNO_PRINTF_VERBOSE, it prints human readable > + strerror()-like textsm, otherwise just numeric values text, values. > + > +config ERRNO_PRINTF_VERBOSE > + bool "Verbose errno strings" > + default y > + depends on ERRNO_PRINTF > + help > + Enable verbose error strings for ERRNO_PRINTF. > + > + Small embedded systems might disable it for reducing kernel size. > + > config RAID6_PQ > tristate > -- ~Randy