Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7472885ybp; Wed, 16 Oct 2019 09:09:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8FNqIQhOjwoNlhDUWX4HanO+X89H0qHm35AYLRU8d9OA+Dly84EhcVwzWqFSt3mGQIqay X-Received: by 2002:a17:906:2c5b:: with SMTP id f27mr39624138ejh.239.1571242175785; Wed, 16 Oct 2019 09:09:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571242175; cv=none; d=google.com; s=arc-20160816; b=ZROF8Fj3Mn0/oKq+EClnmxQyor+hbeP475/XoUV1XC4eTWd8pejUAogjW9LRzvXgSM 178VKX12NMTFLaOP7RgEC6YyhM47XH9Adaxw0vkt1kPipR5iWpAfYHI8V++JsA5H06ez t1RGcC7ug0msqAMwAiPBudHLZFiJ21H063Sebkl4Qno311kgQVQVG1nruJ9Z/sg5jWov lbusWSDn1fuEjdXnvkagtJGp7kjN3U3PaVuSOHL72s7+FoalMBtp5ZKG0Kphhou5iMtm T5orRwNxttdOmTJanWlyE49ntSF/v1cnEFMXGt6kiobHgu5YCGdzwql1KzHVp2fIjki/ 2+mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=3Tj/U4wMEMDKOxq40ZfhlaqeOV1Hxg6pbeW0d7LJj8I=; b=a/6klVPBKEGTTiDYXfjXDNqTcVMLMGyUwkjzTq2r0rFLmtTftEZBKK5W8O3wpgEdB/ 5ktrpWTf3okmHXOYSXELGM7M32+OVbrHhLpDKcwbcEyWfyqkfgOm9i+/tbSt55x/IMcM NnAs0+qME5V0JQplbhI94bG+d2g5qQd0M+MzIpnU2ZXBD2GvEKvji+U60xWG52hL1Prl 4NcZxw7cysPQIHgZgUNhLuuM2FIdNIM7aZt8q28mdwfR0vfEUoFPbafAAGPQ71Q93xBn QnRvYk5YkLBxvQ49no3EbZDgZS3QXlwyQSJdiDChl79Gy4gOD6bHxR12yUGcQz0jYpQ9 FXtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=S52fEBY2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g20si20046188edb.149.2019.10.16.09.09.13; Wed, 16 Oct 2019 09:09:35 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=S52fEBY2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405526AbfJPNtx (ORCPT + 99 others); Wed, 16 Oct 2019 09:49:53 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:44868 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726689AbfJPNtx (ORCPT ); Wed, 16 Oct 2019 09:49:53 -0400 Received: by mail-pg1-f196.google.com with SMTP id e10so10349440pgd.11; Wed, 16 Oct 2019 06:49:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3Tj/U4wMEMDKOxq40ZfhlaqeOV1Hxg6pbeW0d7LJj8I=; b=S52fEBY2p0KM5qmwTZ0AScYN6EaeIP5Qn5vdDy0tyiOKOqhKpAKQAZRaGWqpAWtY/R q3fL0C5M+VdogzM3v3JFR/UWlOiGUN2FHQGqfw9xfAZoknJKsAQW69gPXvrxKXryvpGx cdEkl8E7vdFS1+49f8MhQXfmjCj44nN12ZYydQLC7QWeCHfy7HxI8PGHvaKNPXnoGAZc +vlfkg33YYXkUs0fXQiXgncqSUyCUKb2k1uoOIgS6W1h4eRxlFaj+xhuZdVZDkpQ+15j wtDqjU2/AGiPb5G2vXDbzRl0optZ1ra7TXmkqHAtXA91eN2ajFQ5PwmSP7eFuFvjlRQy sa0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3Tj/U4wMEMDKOxq40ZfhlaqeOV1Hxg6pbeW0d7LJj8I=; b=EEiajmq4x+dFGwVWDdsVgPNJifm8GzLaiizyERZ+HLm4yQVyaF7ukcJSB1QCeyjwvT bK7xdlVnw5u/khPQqQh7KmFDgW3u3CEMFoofFm342Z+aW4FeMqi7Q/wdMJ2QU4heRcwq KOUCQD95HMGBY+0Ql5tWqSMhxnT3jcfQCZ1OWuVlrjpetTninussgkl0HTmKA+dxBrQt xtAyzNxdCxvth+QuSxtGdNQfsF6GmjA+lWIY8uGT0isN5UzorFWwl4+xCCXkCUCItDmg rVBVwfbhxRg4d9TmWSeBfxarW/TG96ZS2HeP2sfK/Gy18eb/Pap9ZmyPcMcNeNhGyaGA jJpA== X-Gm-Message-State: APjAAAUqedaTlT9wD5W096bbV03vetcMHmQcP4L34f7HotJFiXUbaPPy 7fkN1Cvyd5xFNCxHS+xPXtEDE7orJNyJj/mclUw= X-Received: by 2002:a62:e80b:: with SMTP id c11mr43785802pfi.241.1571233792369; Wed, 16 Oct 2019 06:49:52 -0700 (PDT) MIME-Version: 1.0 References: <20191011133617.9963-1-linux@rasmusvillemoes.dk> <20191015190706.15989-1-linux@rasmusvillemoes.dk> In-Reply-To: <20191015190706.15989-1-linux@rasmusvillemoes.dk> From: Andy Shevchenko Date: Wed, 16 Oct 2019 16:49:41 +0300 Message-ID: Subject: Re: [PATCH v5] printf: add support for printing symbolic error names To: Rasmus Villemoes Cc: Linux Kernel Mailing List , Jonathan Corbet , Joe Perches , Andrew Morton , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Petr Mladek , Linux Documentation List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 15, 2019 at 10:07 PM Rasmus Villemoes 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