Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp80918ybl; Tue, 27 Aug 2019 16:12:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqzh6u+5MGIlkSXkzKjwdYnbxo0sAWjf+CGq57VMTQdz16BAmbQyXiX+xYCy4V1B3JbkImm2 X-Received: by 2002:a17:90a:ad94:: with SMTP id s20mr1252209pjq.42.1566947550495; Tue, 27 Aug 2019 16:12:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566947550; cv=none; d=google.com; s=arc-20160816; b=SBPjvOBQxWowo7SJUIqf+wWdQUrf5la5JIaEmhTxBWqbV4t1lrR0S78Io07nXidc/O i2RS+V6u92swzO364l8n/uzE9LXRb/hyUfejoXVmV1UgjMw0f9/eK4CaYH0Mxmlx6xQY +7u/jV7z7S1ezXCKQidsawCIIIRJUVbY4hn51OYjnXRUdmL7iTKxb5bHpt9sf25SAJif KOH5o1olU+NH6UIDvj5MSqxfz1bcGc2V87oGB/Au7xStERm5sapWpkNajGzyZWJVp7pw yLbxx9KkbkNxxNU5kpTWB3KAx9e1qAuH+PybFJqw1X+r863LssvDszC9LKzVA3OMwXbb nhSA== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=i07i7LcsYmI4wQ4lR4XUJ95pHLzyIWIGQ7M7GKCqEVo=; b=Zj/wPJFj45E+lgmmSoQA8Vl0iRkGuk+u7uHvsHIf1U1kEhn82lzhvoOvqbAqFb53Ls OttOJoiyLPbh9xZksl8Jyum0TvHsmdUdUwfVWf+etjd+Wh1Aq7K+wXyjhsU0UjU5UfOc WoGCuyRrUEFcOove4rhhl0uZgkkSbPAGDM9grIkX57rpu2tuMtr28hSm+RHQybG7SECi y/6TSFwJypvqjAGWiQGQgenk5ygXXBSDCxv3BGLpkgYAAo0Bng4uMf/4b0a0JB+6OpZt mO2Ah+G/qbPjxcuQGa8MWqHof1nMI71liQr0noC9LvQKwEO0DUucqNrJKdQIKg+o3P2/ szUA== 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 16si607107pfc.213.2019.08.27.16.12.08; Tue, 27 Aug 2019 16:12:30 -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 S1726474AbfH0XLB (ORCPT + 99 others); Tue, 27 Aug 2019 19:11:01 -0400 Received: from smtprelay0211.hostedemail.com ([216.40.44.211]:34622 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726034AbfH0XLB (ORCPT ); Tue, 27 Aug 2019 19:11:01 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay06.hostedemail.com (Postfix) with ESMTP id DC4C818224D63; Tue, 27 Aug 2019 23:10:59 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::,RULES_HIT:41:355:379:421:599:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2692:2828:3138:3139:3140:3141:3142:3353:3622:3865:3867:3868:3871:3872:3873:3874:4250:4321:5007:6121:7974:8828:10004:10400:10848:11026:11232:11473:11658:11914:12048:12297:12679:12740:12895:13069:13161:13229:13311:13357:13439:13894:14180:14659:14721:21080:21627:30054:30091,0,RBL:23.242.196.136:@perches.com:.lbl8.mailshell.net-62.8.0.180 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: form24_42aa91898ca32 X-Filterd-Recvd-Size: 2375 Received: from XPS-9350.home (cpe-23-242-196-136.socal.res.rr.com [23.242.196.136]) (Authenticated sender: joe@perches.com) by omf16.hostedemail.com (Postfix) with ESMTPA; Tue, 27 Aug 2019 23:10:57 +0000 (UTC) Message-ID: Subject: Re: [PATCH v2] vsprintf: introduce %dE for error constants From: Joe Perches To: Uwe =?ISO-8859-1?Q?Kleine-K=F6nig?= , Sergey Senozhatsky , Jani Nikula , Petr Mladek , Steven Rostedt , Andrew Morton , "Enrico Weigelt, metux IT consult" Cc: Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 27 Aug 2019 16:10:56 -0700 In-Reply-To: <59bfcf90-f7f8-4d55-b5bf-211f6ca67917@kleine-koenig.org> References: <20190827211244.7210-1-uwe@kleine-koenig.org> <04b021b263465c62628964ac402e15fd4cdc13a0.camel@perches.com> <59bfcf90-f7f8-4d55-b5bf-211f6ca67917@kleine-koenig.org> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.32.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2019-08-27 at 23:35 +0200, Uwe Kleine-K?nig wrote: > Hello Joe, > > On 8/27/19 11:22 PM, Joe Perches wrote: > > On Tue, 2019-08-27 at 23:12 +0200, Uwe Kleine-K?nig wrote: > > > The new format specifier %dE introduced with this patch pretty-prints > > > the typical negative error values. So > > > > > > pr_info("probing failed (%dE)\n", ret); > > > > > > yields > > > > > > probing failed (EIO) > > > > > > if ret holds -EIO. This is easier to understand than the for now common > > > > > > probing failed (-5) > > > > I suggest using both outputs like '-5 -EIO' > > rather than a single string > > I like it the way it is implemented as it is more flexible. If you want > to see both, you can still do > > pr_info("probing failed (%d %dE)\n", ret, ret); > > and people (like me) who think that giving only EIO can still do just that. Up to you. Just a suggestion. btw: The test for %E (FORMAT_TYPE_INT) should probably include a test for (spec->flags & SIGN) so that it only is used for %d and %i and disregarded for %x and %u