[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vcw9Wn6a2VEhQ00o1FZq=egtiQGjC1=uX1J71wQ9pf-pw@mail.gmail.com>
Date: Wed, 16 Oct 2019 16:49:41 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Rasmus Villemoes <linux@...musvillemoes.dk>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Jonathan Corbet <corbet@....net>,
Joe Perches <joe@...ches.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Uwe Kleine-König <uwe@...ine-koenig.org>,
Petr Mladek <pmladek@...e.com>,
Linux Documentation List <linux-doc@...r.kernel.org>
Subject: Re: [PATCH v5] printf: add support for printing symbolic error names
On Tue, Oct 15, 2019 at 10:07 PM Rasmus Villemoes
<linux@...musvillemoes.dk> wrote:
> +const char *errname(int err)
> +{
> + const char *name = __errname(err > 0 ? err : -err);
Looks like mine comment left unseen.
What about to simple use abs(err) here?
> + if (!name)
> + return NULL;
> +
> + return err > 0 ? name + 1 : name;
> +}
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists