Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1661354

Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human readable format via %pt

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Andy Shevchenko <andy.shevchenko@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human readable format via %pt
Date Thu, 08 Jun 2017 17:00:02 +0200
Message-ID <tQ74K-5AT-7@gated-at.bofh.it> (permalink)
References <tQ5Z1-4WL-35@gated-at.bofh.it> <tQ5Z1-4WL-37@gated-at.bofh.it> <tQ6V4-5vT-19@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ph2uxFaUJExNs/fQ4swwyRsCKLGAUv2acAITQMJ3JkM=; b=bKhNxzVbXH5zRcjJ60vDtDny5APv+jRyCy3cQEMbPQJk3KVRlR+0Zcwmhj4KKPaj6r tl09ekgVBqNHXr/OwyREpsmagdLzjgyfFG6z6B9n2LqhmnZkI+2VSollIgU6UhN6oBmx eK9AIqRVZ9jwQhoWeeXuxhI+T4HejCTqIV3vApLo0biL7C0AesLsv7RK7lbmAm40rpbd DwcMDOzRtzhNQyUmrn7R/keorc6L7k1guLonA4VbCbEB7i4NMjwnoViqHzrWlF40rRLr hMVF8YRw/w3nbRb1AlHoq14UOmUBbfvKy3xzuTdIhkt1X8Klpau9yKTd38lXJ4+Ksngv MZiQ==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ph2uxFaUJExNs/fQ4swwyRsCKLGAUv2acAITQMJ3JkM=; b=sesm6NZxek8uTgxVRELjTE6MXe3ce45AP7Ja+RzPoBYaamImOuAr2uVmA/XcN1ftds F1aaGlg/ibb34Bn4yP83v2UIohsjlEpkx19pbVt4975ytwiXJ9AInnfn1ioYxLkVv5Xp aruzx+lHY2S+VDn/Y0Mg5LB4LRH6XyygulUSSsEisFhuwvBfOWVa9/EBvqsrNuZAmP/E un5cbNS/X0VOwVlFGO7ZqMlESzt8pc+FpZ3sEg7UDnJX5HEkyyAklzlL8LZyVoVk+fqm eS2jWn9QozlDKLYVNhdX4tkjMRlg5UogP2cRkJTHVIuC2LdKMycH6EfeMpFnzJRzEpBP obdA==
X-Gm-Message-State AODbwcC+yU/5AfCe+5QAA94DRp5tmzcaufliFqOh5lpcyxejONpymC1J tNXvID7hKfVl37rw+j1JZEmCU7sj+Q==
X-Received by 10.55.40.151 with SMTP id o23mr41429761qko.210.1496933712826; Thu, 08 Jun 2017 07:55:12 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset="UTF-8"
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 28
Organization linux.* mail to news gateway
X-Original-Cc Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Rasmus Villemoes <rasmus.villemoes@prevas.dk>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Andrew Morton <akpm@linux-foundation.org>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Alessandro Zummo <a.zummo@towertech.it>, Alexandre Belloni <alexandre.belloni@free-electrons.com>, linux-rtc@vger.kernel.org, Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>, Dmitry Torokhov <dmitry.torokhov@gmail.com>, Geert Uytterhoeven <geert@linux-m68k.org>, Guan Xuetao <gxt@mprc.pku.edu.cn>, Ingo Molnar <mingo@kernel.org>, Jason Wessel <jason.wessel@windriver.com>, Jonathan Corbet <corbet@lwn.net>, Jonathan Hunter <jonathanh@nvidia.com>, Krzysztof Kozlowski <krzk@kernel.org>, "Rafael J. Wysocki" <rjw@rjwysocki.net>, Thierry Reding <thierry.reding@gmail.com>
X-Original-Date Thu, 8 Jun 2017 17:55:12 +0300
X-Original-Message-ID <CAHp75VfUU9fO-jnY32caKywf8h3bdst9zBf66Wjz6C5+4z1okA@mail.gmail.com>
X-Original-References <20170608134811.60786-1-andriy.shevchenko@linux.intel.com> <20170608134811.60786-5-andriy.shevchenko@linux.intel.com> <CAK8P3a0JDvd-frxQvOe7RVPBgA6M-RBiw=Tt1dP1EJa+L4qQoQ@mail.gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1661354

Show key headers only | View raw


On Thu, Jun 8, 2017 at 5:49 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Thu, Jun 8, 2017 at 3:47 PM, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
>> There are users which print time and date represented by content of
>> struct rtc_time in human readable format.
>>
>> Instead of open coding that each time introduce %pt[dt][rv] specifier.
>
> I really like the idea, and the implementation seems fine for this use case, but
> before we reserve %pt for rtc_time, could we discuss whether we want
> that for printing struct tm, struct timespec64, time64_t or ktime_t instead?

How many users? For struct tm it's somelike 4 (which want to print its content).

> I can see good reasons for pretty-printing any of them, but the namespace for
> format strings is rather limited.
>
> struct rtc_time is almost the same as struct tm (the former has one extra
> member), so maybe we can actually define them to be the same and
> use one format string for both?

The reason I decide to drop struct tm for now due to they are not
compatible and I have got an interesting bugs.
Verify tm_year member carefully.

-- 
With Best Regards,
Andy Shevchenko

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v1 04/25] lib/vsprintf: Print time and date in human readable format via %pt Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-06-08 15:50 +0200
  Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human  readable format via %pt Arnd Bergmann <arnd@arndb.de> - 2017-06-08 16:50 +0200
    Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human  readable format via %pt Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-06-08 17:00 +0200
      Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human  readable format via %pt Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2017-06-08 17:10 +0200
        Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human  readable format via %pt Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-06-08 20:00 +0200
          Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human  readable format via %pt Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-06-08 20:50 +0200
            Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human readable format via %pt Rasmus Villemoes <linux@rasmusvillemoes.dk> - 2017-06-08 22:50 +0200
              Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human  readable format via %pt Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-06-08 23:30 +0200
                Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human  readable format via %pt Arnd Bergmann <arnd@arndb.de> - 2017-06-08 23:50 +0200
          Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human  readable format via %pt Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2017-06-08 20:50 +0200
      Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human  readable format via %pt Arnd Bergmann <arnd@arndb.de> - 2017-06-08 17:40 +0200
        Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human  readable format via %pt Joe Perches <joe@perches.com> - 2017-06-08 17:50 +0200
        Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human  readable format via %pt Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-06-08 20:10 +0200
          Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human  readable format via %pt Joe Perches <joe@perches.com> - 2017-06-09 01:10 +0200

csiph-web