Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4092370ybe; Mon, 16 Sep 2019 06:38:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqytM9QJb/H4KdoT/4YclT1WvE7yEzYh9hRGWFYa4okJFqQXDf8HtHX+CsQrUUdeioBhW/iA X-Received: by 2002:a17:906:ecea:: with SMTP id qt10mr47574ejb.23.1568641127859; Mon, 16 Sep 2019 06:38:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568641127; cv=none; d=google.com; s=arc-20160816; b=TnXEl9fzq1ViChlsiRL9zySDGCWNc4fNl8y/XDmUpiT7kYZAUiiNFAIFS0fIMRJuL8 zfbYyRaUxxvanRpAf5jsqR9lp45btuxm0aCpnE0Lkp1+PVcM+khshA3WosKfbdfOHmY8 w/QB930A9olYtxzeOFQUx9BEc3JspGTLSN6DmTzJpDkYXxAYvTaPOaT8HSqdQfm4UsNu X01FmZ7hANq3yjogDnrMcTeFh5aJnYj85eD2HwQPDNYQjK0A/XHqEycsjCwHfizefIhL tnk/SamHpScPdJRx/GDrml8SPR1TPhg3GFv+tSFlKLzVBRkCqqWMNaBMUcu/hcSAP8+b DMkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:mime-version:user-agent:date :message-id:subject:autocrypt:openpgp:from:references:cc:to; bh=AHVFWWXJieyvJUsZ/1Zf+XMhRhptlpZ+ib1UA+IyW4s=; b=W0RChL0KQs8atVffzYeKnZ9h7KPRBYuAhqrmkAI7Bw+McQljIc8V+kkXIdJbsFLpfE /gZpSpn3MxvAOKza1vTwk4bt/jIkHuVCmhuFVDsojx21qPeeJ7jOyU1h2NwSRlGigSIh oyCAhNzTz4esiZ8IFvaEImWIC93rIJS8iSblkeT+7C+NKRiHw3frmNfgMgNJoK7AVcbM PrfGkbfs/fa4PCDuwtzvmajEDLef8VqvrRGeqRf3BJkLiUiAUB2dCFLJIh5hqSU+drQ0 L0SzxYqqFsFA1BD9J3heq6lyifCNQs4v/Ocm+j/cfI/BKe2ccE5FWfUP7oROv6+nbJ9Z n3Ew== 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 k24si2729247ejz.284.2019.09.16.06.38.23; Mon, 16 Sep 2019 06:38:47 -0700 (PDT) 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 S1733138AbfIPNgh (ORCPT + 99 others); Mon, 16 Sep 2019 09:36:37 -0400 Received: from antares.kleine-koenig.org ([94.130.110.236]:46656 "EHLO antares.kleine-koenig.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727826AbfIPNgg (ORCPT ); Mon, 16 Sep 2019 09:36:36 -0400 Received: from localhost (localhost [127.0.0.1]) by antares.kleine-koenig.org (Postfix) with ESMTP id DBD4E7B4E09; Mon, 16 Sep 2019 15:36:31 +0200 (CEST) Received: from antares.kleine-koenig.org ([127.0.0.1]) by localhost (antares.kleine-koenig.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dAZ2tzLMjNhC; Mon, 16 Sep 2019 15:36:30 +0200 (CEST) Received: from [IPv6:2a02:8071:b5c2:53f8:3192:99d7:1d59:986] (unknown [IPv6:2a02:8071:b5c2:53f8:3192:99d7:1d59:986]) by antares.kleine-koenig.org (Postfix) with ESMTPSA; Mon, 16 Sep 2019 15:36:30 +0200 (CEST) To: Rasmus Villemoes , Andrew Morton , Jonathan Corbet Cc: Andy Shevchenko , Joe Perches , Petr Mladek , Sergey Senozhatsky , Jani Nikula , Linux Kernel Mailing List , linux-doc@vger.kernel.org References: <20190830214655.6625-1-linux@rasmusvillemoes.dk> <20190909203826.22263-1-linux@rasmusvillemoes.dk> <33592303-091c-c480-460f-e2acd89e99be@kleine-koenig.org> <53331f01-dd77-b448-33ab-cb26dd4b9380@rasmusvillemoes.dk> From: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= Openpgp: preference=signencrypt Autocrypt: addr=uwe@kleine-koenig.org; prefer-encrypt=mutual; keydata= mQINBEwXmCYBEACoJSJcKIlkQcTYia0ymmMOBk2veFoy/a0LlqGUEjQ4WECBL19F2BYX1dSp 5/ZdfKuV605usI6oq4x6k/LKmqZDl6YnqW/YmN/iZVCRunBRfvpTlL4lcNUu5Va/4GBRzBRr rrIhCIVL5zMV6hKywhHKTdOHVSZRftf+eRSBwENKXahmfOMDmekyf585etDPdzkFrLHNVFOC sFOU0gCK0uVPyY0LH13eo4qEEMi88RCOfwYCFQqKXDdo41DWoDPB5OGCMaphIx9wC/nvtdcv MowsGde5iGgmHWK6sdC/O/xaV7fnz1sJzoJB1eT91LkGbdGxsLAT6nqlaNJiJtiBoRhscguV xVbn/I9mnUu7bLmTFBEAlaQGU/J7uQ4w94FXfosNGROt/otqltetMZlPbNvNhKnXv8U6eRyA P3ZMKTJa4hGr3UdYdt4+MIiHcsANWp8T7oLYVxRbHPXPG49IURnhXUoGbscZmpptWcl29ebo qCxL9n3KIyUT3ZB1xHbW3Sk/Dqzf52tQOxZubzrpUJ8zaGIwYVUjfcPFwf3R3zrQvJq7mI4S ddNIE8w3WJOPXDOYx7GjOa+IubhSpCrr74NbN8q9oS3hnsqWw16i3HSUuPuYeZo1t6D5p/mX EVyZ2QrS1kGgGi7bmlQMSFkb6g1T8aWSYuX3PBYq2VntnWAXPwARAQABtClVd2UgS2xlaW5l LUvDtm5pZyA8dXdlQGtsZWluZS1rb2VuaWcub3J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Eh0NmPdE/MnQM7svxsB7xp 8kNRLpvtXNxp6SZUcf7u6vIwvlcrYMeDIaxf4dZSAuFwurOQtVP0gERKFSh1oMI+I0wXeMbO pN3/t3AK3zD7ZykqMstza/jYFEK1gNj7UhnvazBhMaMhCEt8rNqr5/dbgvAD/biSZO6wZrn7 hCaye/ulWpSqZSdx+G9GkTn05lsuHu9zfTwY6B0A6nlrqQSR/yWPvSq1Ud6IOZY1alq7ZSag kC8vBDJg Subject: Re: [PATCH v2] printf: add support for printing symbolic error codes Message-ID: Date: Mon, 16 Sep 2019 15:36:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <53331f01-dd77-b448-33ab-cb26dd4b9380@rasmusvillemoes.dk> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="SkiqegPyPEnRjMQqgAu7sVuPukEetussQ" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SkiqegPyPEnRjMQqgAu7sVuPukEetussQ Content-Type: multipart/mixed; boundary="UGQdcURDR4Z9umBgY0xusGJ3upITYe0PD"; protected-headers="v1" From: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= To: Rasmus Villemoes , Andrew Morton , Jonathan Corbet Cc: Andy Shevchenko , Joe Perches , Petr Mladek , Sergey Senozhatsky , Jani Nikula , Linux Kernel Mailing List , linux-doc@vger.kernel.org Message-ID: Subject: Re: [PATCH v2] printf: add support for printing symbolic error codes References: <20190830214655.6625-1-linux@rasmusvillemoes.dk> <20190909203826.22263-1-linux@rasmusvillemoes.dk> <33592303-091c-c480-460f-e2acd89e99be@kleine-koenig.org> <53331f01-dd77-b448-33ab-cb26dd4b9380@rasmusvillemoes.dk> In-Reply-To: <53331f01-dd77-b448-33ab-cb26dd4b9380@rasmusvillemoes.dk> --UGQdcURDR4Z9umBgY0xusGJ3upITYe0PD Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 9/16/19 3:23 PM, Rasmus Villemoes wrote: > On 16/09/2019 14.23, Uwe Kleine-K=C3=B6nig wrote: >> Hello Rasmus, >> >> On 9/9/19 10:38 PM, Rasmus Villemoes wrote: >>> It has been suggested several times to extend vsnprintf() to be able >>> to convert the numeric value of ENOSPC to print "ENOSPC". This is yet= >>> another attempt. Rather than adding another %p extension, simply teac= h >>> plain %p to convert ERR_PTRs. While the primary use case is >>> >>> if (IS_ERR(foo)) { >>> pr_err("Sorry, can't do that: %p\n", foo); >>> return PTR_ERR(foo); >>> } >>> >>> it is also more helpful to get a symbolic error code (or, worst case,= >>> a decimal number) in case an ERR_PTR is accidentally passed to some >>> %p, rather than the (efault) that check_pointer() would >>> result in. >>> >>> With my embedded hat on, I've made it possible to remove this. >>> >>> I've tested that the #ifdeffery in errcode.c is sufficient to make >>> this compile on arm, arm64, mips, powerpc, s390, x86 - I'm sure the >>> 0day bot will tell me which ones I've missed. >>> >>> The symbols to include have been found by massaging the output of >>> >>> find arch include -iname 'errno*.h' | xargs grep -E 'define\s*E' >>> >>> In the cases where some common aliasing exists >>> (e.g. EAGAIN=3DEWOULDBLOCK on all platforms, EDEADLOCK=3DEDEADLK on m= ost), >>> I've moved the more popular one (in terms of 'git grep -w Efoo | wc) >>> to the bottom so that one takes precedence. >>> >>> Acked-by: Uwe Kleine-K=C3=B6nig >>> Signed-off-by: Rasmus Villemoes >> >> Even with my ack already given I still think having %pE (or %pe) for >> ints holding an error code is sensible.=20 >=20 > I don't understand why you'd want an explicit %p to do what > %p does by itself - in fact, with the current vsnprintf implementation,= > "%pe", ERR_PTR(-EFOO) would already do what you want (since after %p is= > processed, all alphanumeric are skipped whether they were interpreted o= r > not). So we could "reserve" %pe perhaps in order to make the call sites= > a little more readable, but no code change in vsnprintf.c would be > necessary. Sorry, I meant I still consider %de (or %dE) sensible which I suggested at the start of this thread. > Or perhaps you meant introduce a %d extension? I still think= > that's a bad idea, and I've in the meantime found another reason > (covering %d in particular): Netdevices can be given a name containing > exactly one occurrence of %d (or no % at all), and then the actual name= > will be determined based on that pattern. These patterns are settable > from userspace. And everything of course breaks horribly if somebody se= t > a name to "bla%deth" and that got turned into "blaEPERMth". Sure, this should not happen. I don't see imminent danger though. (ethernet IDs are usually positive, right?) I think having a possibility to print error codes in an int is beneficial, as otherwise I'd have to convert to a pointer first when printing the code which is IMHO unnecessary burden. >> So I wonder if it would be a >> good idea to split this patch into one that introduces errcode() and >> then the patch that teaches vsprintf about emitting its return value f= or >> error valued pointers. Then I could rebase my initial patch for %pe on= >> top of your first one. >=20 > Well, I think my patch as-is is simple enough, there's not much point > separating the few lines in vsnprintf() from the introduction of > errcode() (which, realistically, will never have other callers). Fine if your series goes in soon. If not I'd like to use errcode() without having to discuss the changes to how pointers are printed. Best regards Uwe --UGQdcURDR4Z9umBgY0xusGJ3upITYe0PD-- --SkiqegPyPEnRjMQqgAu7sVuPukEetussQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAl1/j9sACgkQwfwUeK3K 7Al53ggAjHEvrHinrtE/1gXaCBSireb20M1K+T3Ed6GUiibBnJigvtT4BDFeKFXK 6Z9oKjuh46TT++uvRhDvgjhEvh8kx00/ZjLaJRZ2ozu8onR2LoicrHWAYz7Zeb/t iIIPO6mFUodpC/kPgxA52y/Y/6XelKg4OQW9Ly/pMHwqnryude4iZ/JxGClMH6pE naOFt8D8RP0n4EGGphyMHcO41rni/Hzr0XQVzX7dZZUAGTzhL4I3g+zIRjfTm1xQ LT9z1lNIXNPKbtdC153hjy3kj+m8LowQzddF6loh+6+LUUXJz9CkPtI+dxsEK47c RyWwu2oNml9RXjid0tPpRgIHb4LEXg== =1Ite -----END PGP SIGNATURE----- --SkiqegPyPEnRjMQqgAu7sVuPukEetussQ--