mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Uwe Kleine-König" <uwe@kleine-koenig.org>,
	"Sergey Senozhatsky" <sergey.senozhatsky.work@gmail.com>,
	"Jani Nikula" <jani.nikula@linux.intel.com>,
	"Petr Mladek" <pmladek@suse.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Enrico Weigelt, metux IT consult" <lkml@metux.net>
Cc: Jonathan Corbet <corbet@lwn.net>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] vsprintf: introduce %dE for error constants
Date: Tue, 27 Aug 2019 16:10:56 -0700	[thread overview]
Message-ID: <a828ba39477f1cfb8933b0e6cc704dfa6c315bcc.camel@perches.com> (raw)
In-Reply-To: <59bfcf90-f7f8-4d55-b5bf-211f6ca67917@kleine-koenig.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.

<shrug>  Up to you.  Just a suggestion.

btw:

The test for %<dixu>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



  reply	other threads:[~2019-08-27 23:11 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-27 21:12 Uwe Kleine-König
2019-08-27 21:17 ` Uwe Kleine-König
2019-08-27 21:22 ` Joe Perches
2019-08-27 21:35   ` Uwe Kleine-König
2019-08-27 23:10     ` Joe Perches [this message]
2019-08-28 11:32 ` Petr Mladek
2019-08-28 11:54   ` Jani Nikula
2019-08-28 12:02     ` Sergey Senozhatsky
2019-08-28 12:49       ` Rasmus Villemoes
2019-08-28 12:59         ` Sergey Senozhatsky
2019-08-28 16:22           ` Uwe Kleine-König
2019-08-29  0:27             ` Sergey Senozhatsky
2019-08-28 19:18   ` Uwe Kleine-König
2019-08-29  8:12     ` Petr Mladek
2019-08-29  8:27       ` Juergen Gross
2019-08-29  9:09         ` Rasmus Villemoes
2019-08-29 17:39           ` Uwe Kleine-König
2019-08-30  9:06             ` Petr Mladek
2019-08-30 15:47               ` Uwe Kleine-König
2019-08-30 21:45             ` Rasmus Villemoes
2019-08-29  9:00       ` Rasmus Villemoes
2019-08-28 19:59   ` Uwe Kleine-König
2019-08-28 20:51     ` Mark Brown
2019-08-29 13:39 ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a828ba39477f1cfb8933b0e6cc704dfa6c315bcc.camel@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=jani.nikula@linux.intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@metux.net \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=uwe@kleine-koenig.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®