Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751443AbdFYWru (ORCPT ); Sun, 25 Jun 2017 18:47:50 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:58937 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751373AbdFYWrt (ORCPT ); Sun, 25 Jun 2017 18:47:49 -0400 Subject: Re: [PATCH] lib: vsprintf: add printf format conversion %M for errno strings To: "Enrico Weigelt, metux IT consult" , Joe Perches , linux-kernel@vger.kernel.org References: <20170625171230.7613-1-enrico.weigelt@gr13.net> <1498411624.24295.36.camel@perches.com> <6a12988d-bbcc-54e7-be16-eeeb94f88d57@gr13.net> <1498421449.24295.39.camel@perches.com> <71909969-b6be-d116-3372-7add409c1ec1@gr13.net> From: Randy Dunlap Message-ID: <3a8df2e2-114c-9f2c-325a-49f234726b08@infradead.org> Date: Sun, 25 Jun 2017 15:47:45 -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: <71909969-b6be-d116-3372-7add409c1ec1@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: 852 Lines: 25 On 06/25/2017 02:18 PM, Enrico Weigelt, metux IT consult wrote: > On 25.06.2017 22:10, Joe Perches wrote: > >>> Yeah, that's still an open problem. Actually, I still haven't found out, >>> how it's done w/ all the other kernel-internal conversions. >> >> Everything else uses "%p", > > hmm, but errno's aren't pointers. Isn't %p checked for pointer values ? >>> Already was about to do so. Shall I call it strerror() ? >> >> I presume kstrerror >> >> So use something like >> "%d: (%s)", errno, kstrerror(errno) > > Okay, sounds good. but why not just do that in userspace. Sure, you can keep that as your internal kernel patch, but there's not really much need for it to be in the mainline kernel. So when your driver prints "blah: foo bar error 49", just run a little program that converts 49 to . -- ~Randy