Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4067723ybl; Mon, 26 Aug 2019 05:06:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaLfW3EaBqRmudYjtGUcJ/yBEdhuSgUD8j6/NqaZYqfBR+f59MmdZNJyDbLicwpptBcyao X-Received: by 2002:a65:6259:: with SMTP id q25mr5952659pgv.145.1566821217171; Mon, 26 Aug 2019 05:06:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566821217; cv=none; d=google.com; s=arc-20160816; b=WqmspQnjFm81VnpUdpBY/CxX1cUFU+4zr+TfUTZK7riyiAb46aHiIYOHxr7iAPEjsC myi9pVr9o8tZqPmN78+cKzMugDVtdjkZKNVfNZqUoTJCz6HOGEY5kFCw1Gi05PyaTrpW 9MjO4w2N2/5K/4TmTFO57INJ/qdxm+r1bd8cIia3P52UI6RImJII1ADtmKiIrCb9Xzcx Sv8KrV5izKAt45uMczpoFqJQ3k2ikBtwyDP2T5upN9Sb4oTe8R6osCxGbEmHQrKpVzY7 5OJCoqwyxdIvfFLQWaWQWYCRb3vp6AS4Lf3CXNHeq0je8u/MXwmqfbAc8r6zP+DblYLA BurA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=JuxNl1R+MQOD5T0bSD1y/dpCrtnyAujIID8hTeJutwo=; b=pVJ7KwiL3fbpZXYWYqt3LaGlhzVB5xBNabhQaaxPeiLK6RgA9cy6GHRJPYviagJuLh f/R99bEvZ4K2VELv+qOp6U93kKFT+C52H9crToA6oQsI7PPOCj0hY+NhBqdkqURDNZFl IzyKtVlcrNbcCPvDRj2djp6ZCD8cyf4c9pwsVD6G7L5/1D1MEirAeYyiXhDPnOe/ChV6 sWAR777uI8r1EJ1YYP63cBHTlHQ3NpV9VpSW2S6J7KHEQIuQTEDZUfOobmjjPfYNySEE H+Anm1vWGisimHR7fIv1v7cMzjxR9la6GWg/Y60gtENEyU6vKdxbAreGbdSUhmWbRXtN jEFg== 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 e2si8983235pgm.99.2019.08.26.05.06.41; Mon, 26 Aug 2019 05:06:57 -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 S1731094AbfHZMFr (ORCPT + 99 others); Mon, 26 Aug 2019 08:05:47 -0400 Received: from mx2.suse.de ([195.135.220.15]:43554 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726962AbfHZMFq (ORCPT ); Mon, 26 Aug 2019 08:05:46 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 62E2AAFCC; Mon, 26 Aug 2019 12:05:45 +0000 (UTC) Date: Mon, 26 Aug 2019 14:05:44 +0200 From: Petr Mladek To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Andrew Morton , Bartosz Golaszewski , Sergey Senozhatsky , Steven Rostedt , Linus Walleij , Jonathan Corbet , linux-doc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 1/2] vsprintf: introduce %dE for error constants Message-ID: <20190826120544.ccbtjkgvk3ao4ak6@pathway.suse.cz> References: <20190824233724.1775-1-uwe@kleine-koenig.org> <20190824165829.7d330367992c62dab87f6652@linux-foundation.org> <20190825091442.GA5817@taurus.defre.kleine-koenig.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190825091442.GA5817@taurus.defre.kleine-koenig.org> User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun 2019-08-25 11:14:42, Uwe Kleine-K?nig wrote: > Hello Andrew, > > On Sat, Aug 24, 2019 at 04:58:29PM -0700, Andrew Morton wrote: > > (cc printk maintainers). > > Ah, I wasn't aware there is something like them. Thanks > > > On Sun, 25 Aug 2019 01:37:23 +0200 Uwe Kleine-K?nig wrote: > > > > > pr_info("probing failed (%dE)\n", ret); > > > > > > expands to > > > > > > probing failed (EIO) > > > > > > if ret holds -EIO (or EIO). This introduces an array of error codes. If > > > the error code is missing, %dE falls back to %d and so prints the plain > > > number. What was the motivation for this patch, please? Did it look like a good idea? Did anyone got tired by searching for the error codes many times a day? Did the idea came from a developer, support, or user, please? > add/remove: 2/0 grow/shrink: 4/2 up/down: 1488/-8 (1480) > Function old new delta > errorcodes - 1200 +1200 > errstr - 200 +200 > vsnprintf 884 960 +76 > set_precision 148 152 +4 > resource_string 1380 1384 +4 > flags_string 400 404 +4 > num_to_str 288 284 -4 > format_decode 1024 1020 -4 > Total: Before=21686, After=23166, chg +6.82% > > But that doesn't seem to include the size increase for all the added > strings which seems to be around another 1300 bytes. This non-trivial increase of the size and the table still includes only part of the error codes. The array is long, created by cpu&paste, the index of each code is not obvious. There are ideas to make the code even more tricky to reduce the size, keep it fast. Both, %dE modifier and the output format (ECODE) is non-standard. Upper letters gain a lot of attention. But the error code is only helper information. Also many error codes are misleading because they are used either wrongly or there was no better available. There is no proof that this approach would be widely acceptable for subsystem maintainers. Some might not like mass and "blind" code changes. Some might not like the output at all. I am not persuaded that all this is worth it. Also I do not like the non-standard solution. Best Regards, Petr