Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp174731ybe; Sun, 1 Sep 2019 22:59:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYSXa2FRIjjbETRC75IsH0As7ffrcYVCGLmNv0MkXwnWSBcYhjfs2jt7HET7WZSHjAeI5r X-Received: by 2002:a62:d445:: with SMTP id u5mr12149559pfl.92.1567403997817; Sun, 01 Sep 2019 22:59:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567403997; cv=none; d=google.com; s=arc-20160816; b=Q8joYBlOijeceQvzy5MccFVlt0zEgwNhy7Vxt4xiA7Y0og7N3pHLyDYUXP1eSm4zYR q7wg7mHTXLaKwaTsKJyp9oXWN9C6FMaRtJJ/djnu5WTOM3V9RlDU2nV/zcwmnKp+Jb0D MGnhpvkESIUeRvRNYks4/AX91zXCbSTHpFqmY0zG6wYx1CQKCGFW3qn9etvNEuXGZlg3 buBkgdFglmBkRsAXjsKiT2Y4W/N5RJnh+5ZrV+Mxl9l/g2Q+ia9e+L8KopcvhT0hqT4W Knr05zNDyazcLc28OHG4j9icLgPIbzF5ejax5cRDJ57/Y06ZsyF6qzOBeqny6YSrkjPh 3hWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=cQcCwi1TdcA5JbXme476cy+QLZFPuzFZlNZnnHOMPlQ=; b=CD45t6MvCq1R0KkVlcXzPvP/Z2+jEIW0hadzZGVgryl1w7xoFCjbdHGIAF/4QrXgnU DdJ22p5O+/BWD5LqbgMMy/L/7/wjt8dzNO05IdvbTBc7Oja3+e7P7d41am4RoQ97vSNa DSu/FwGK+TRI3YsNgShGJzJcXSZ4X4C27XdWOy6FHgC6wKo9q+sc42oqfR0WPMzqp++0 e0dyXCCaraMYoORiCMixaMDHFsqIDIU90Irqf49Mfr0K4l8xqxL6inrKEXiQfOBYIqlB XoK86mfJrfMvwjro9V+UWnM9v4z1fztbBGspos7UkurlpR/osgaaQDsyshF3+hF3Gr1S uvyQ== 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 w1si7830872pgr.519.2019.09.01.22.59.42; Sun, 01 Sep 2019 22:59: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 S1729325AbfIBF6n (ORCPT + 99 others); Mon, 2 Sep 2019 01:58:43 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:34901 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726008AbfIBF6m (ORCPT ); Mon, 2 Sep 2019 01:58:42 -0400 Received: from soja.hi.pengutronix.de ([2001:67c:670:100:3ad5:47ff:feaf:13da]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1i4fMO-0007zm-FU; Mon, 02 Sep 2019 07:58:40 +0200 Subject: Re: [PATCH] [RFC] i2c: imx: make use of format specifier %dE To: Wolfram Sang , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= Cc: Oleksij Rempel , kernel@pengutronix.de, Shawn Guo , Fabio Estevam , NXP Linux Team , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Andrew Morton , Jani Nikula , Enrico Weigelt , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190829042905.4850-1-uwe@kleine-koenig.org> <20190829203912.GU3740@ninjato> From: Oleksij Rempel Message-ID: Date: Mon, 2 Sep 2019 07:58:36 +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: <20190829203912.GU3740@ninjato> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:3ad5:47ff:feaf:13da X-SA-Exim-Mail-From: o.rempel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29.08.19 22:39, Wolfram Sang wrote: > On Thu, Aug 29, 2019 at 06:29:05AM +0200, Uwe Kleine-König wrote: >> I created a patch that teaches printk et al to emit a symbolic error >> name for an error valued integer[1]. With that applied >> >> dev_err(&pdev->dev, "can't enable I2C clock, ret=%dE\n", ret); >> >> emits >> >> ... can't enable I2C clock, ret=EIO >> >> if ret is -EIO. Petr Mladek (i.e. one of the printk maintainers) had >> concerns if this would be well received and worth the effort. He asked >> to present it to a few subsystems. So for now, this patch converting the >> i2c-imx driver shouldn't be applied yet but it would be great to get >> some feedback about if you think that being able to easily printk (for >> example) "EIO" instead of "-5" is a good idea. Would it help you? Do you >> think it helps your users? > > Yes, it would help me. And users, too, I am quite sure. For me, if I mix > up two numbers while debugging, I am hunting ghosts for a while until I > realize my mistake. So: > > Acked-by: Wolfram Sang > > I think the main drawback is that ERRORCODES in vsprintf.c now need > maintenance, but I think it is worth the effort. I'd be interested in > the overhead in size this causes, but I also think it is worth the > effort. (It could even be compiled out if we have some generic Kconfig > symbol for smaller kernels). I like it, at least it will safe me some time. I tested this patch together with the vprintf patch, so result looks like: [ 0.281843] imx-i2c 21a0000.i2c: can't enable I2C clock, ret=EIO [ 0.281891] imx-i2c: probe of 21a0000.i2c failed with error -5 Tested-by: Oleksij Rempel Signed-off-by: Oleksij Rempel Kind regards, Oleksij Rempel -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |