Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751945AbdFHOtp (ORCPT ); Thu, 8 Jun 2017 10:49:45 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:33088 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751742AbdFHOtn (ORCPT ); Thu, 8 Jun 2017 10:49:43 -0400 MIME-Version: 1.0 In-Reply-To: <20170608134811.60786-5-andriy.shevchenko@linux.intel.com> References: <20170608134811.60786-1-andriy.shevchenko@linux.intel.com> <20170608134811.60786-5-andriy.shevchenko@linux.intel.com> From: Arnd Bergmann Date: Thu, 8 Jun 2017 16:49:42 +0200 X-Google-Sender-Auth: 3kJJ0Hx0KZ7LQANesTkk6O9WBNk Message-ID: Subject: Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human readable format via %pt To: Andy Shevchenko Cc: Rasmus Villemoes , Greg Kroah-Hartman , Andrew Morton , Linux Kernel Mailing List , Alessandro Zummo , Alexandre Belloni , linux-rtc@vger.kernel.org, Bartlomiej Zolnierkiewicz , Dmitry Torokhov , Geert Uytterhoeven , Guan Xuetao , Ingo Molnar , Jason Wessel , Jonathan Corbet , Jonathan Hunter , Krzysztof Kozlowski , "Rafael J. Wysocki" , Thierry Reding Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 807 Lines: 19 On Thu, Jun 8, 2017 at 3:47 PM, Andy Shevchenko 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? 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? Arnd