Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2344864ybl; Mon, 20 Jan 2020 00:58:17 -0800 (PST) X-Google-Smtp-Source: APXvYqyZEO8T1rAbJtNdRPrb+unBGrfSx9nMuwf0r3zFJBb4rJn+QAN3V4l7iF4vKDCCsUCQ17K/ X-Received: by 2002:aca:d6c8:: with SMTP id n191mr12555866oig.103.1579510697301; Mon, 20 Jan 2020 00:58:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579510697; cv=none; d=google.com; s=arc-20160816; b=EcbPQ2iyatfWT8gR4ShYE2OaLge2L+gEJofAXqI5UPj+7+1dlVk6bwa6SECAVZNbqG noDGI42tFw6wK4RUKVeRwZBRYG2yKul+qKFMKt9lkleayXcFZhSildWJRMknzt715iVA g96XJhhtlvTVqf8MC4REHC2/VcBhIZGe65fp+1IT/ARMZLiKfRWyrVgp/1OKjbmDpvQ/ 9tLMXI2LwE3F4v6ap90lGP9j4mGgo3BvTUO5Oa2qtadPTfKnX8mjICqZTDNX3eP/fp43 fchPMPosHZFy8kRcKKGfFxG6hKnPDBnVV2/CgozVU42Awa8dP4t1D/LbgBgjq0MrltDw innw== 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:mime-version :message-id:date:subject:cc:to:from; bh=Mae9sUOpUnqKRWdlCRpEMDJKQR3tdXOSNmKdZ9XHps4=; b=RsEodOITTr4YdqF9lNYe9zYTijMMbz3+k3eX9P4e4czHXXt8oOnkKifr52BCPkjMYY j1+1r0gTxrRAlyFg32qY8oqj0YV+MgNALsMSoBCJ01/2FacnsuoSFPadgfcQO1yhYBQZ zPm6wu5WJ5W7V/iNdU6YC/2ZKnAFAQB48/UXbPUh8Ar8+LYYxAMLbvYP11yCuaabo+2+ 65qaJToTYlD45fRHXuPsJ4UDSRnzAie1mWEFCjAsqtJSXOijD6orRDfZs8ce6nEMCYi7 +me57n3P0mSa0sCaau1b9vOZ36Jp3q8msDKtwYGr9z9q41KCZeE8reHra+6bTJodkxWq 9AqQ== 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 b20si20231893otf.199.2020.01.20.00.58.05; Mon, 20 Jan 2020 00:58:17 -0800 (PST) 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 S1727586AbgATIzs (ORCPT + 99 others); Mon, 20 Jan 2020 03:55:48 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:51201 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726798AbgATIzo (ORCPT ); Mon, 20 Jan 2020 03:55:44 -0500 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1itSqH-0002Vo-QB; Mon, 20 Jan 2020 09:55:29 +0100 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1itSqE-0006rw-Kz; Mon, 20 Jan 2020 09:55:26 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Andy Shevchenko , Rasmus Villemoes , Greg Kroah-Hartman , "Rafael J. Wysocki" Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 0/2] printf: add support for %de Date: Mon, 20 Jan 2020 09:55:06 +0100 Message-Id: <20200120085508.25522-1-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@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 Hello, this is an reiteration of my patch from some time ago that introduced %dE with the same semantic. Back then this resulted in the support for %pe which was less contentious. I still consider %de (now with a small 'e' to match %pe) useful. One concern back then was that drivers/staging/speakup/speakup_bns.c uses sprintf with the format string "\x05%dE" to produce binary data expecting a literal 'E'. This is now addressed: ` can be used to end parsing a format specifier as explained in the commit log of the first patch. Of course the concern to not complicate vsprintf() cannot be addressed as new code is necessary to support this new ability. I still consider %de useful enough, even though you could do pr_info("blablub: %pe\n", ERR_PTR(ret)); with the same effect as pr_info("blablub: %de\n", ret); . The second patch converts some strings in the driver core to use this new format specifier. Uwe Kleine-König (2): printf: add support for printing symbolic error names from numbers driver core: convert probe error messages to use %de drivers/base/dd.c | 10 +++++----- lib/test_printf.c | 8 ++++++++ lib/vsprintf.c | 34 +++++++++++++++++++++++++++++++++- 3 files changed, 46 insertions(+), 6 deletions(-) -- 2.24.0