Received: by 10.223.185.116 with SMTP id b49csp1123177wrg; Tue, 20 Feb 2018 13:49:03 -0800 (PST) X-Google-Smtp-Source: AH8x2246l3mIMI0O3dUydcubVkZTruMQuBopSpFcSM9uc9Iif2o94GkhuokDYdhvtYdES23vkDrR X-Received: by 2002:a17:902:6805:: with SMTP id h5-v6mr965424plk.46.1519163343173; Tue, 20 Feb 2018 13:49:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519163343; cv=none; d=google.com; s=arc-20160816; b=aYN6Wc3cJVO550AqAjtSKkxgy2Ryjo90dMaAPNkOL5jWkMyrL9kXRS6PQ6hKyMViQW HtmyFzGHdToYoIQ3WL9WugpXzxtY3P1pIVZ9BCn1xhKmP050aXEevneHtZul58H2qVpS V7dU5Cjmn+YrCo4f4EGXE14LokUuvWIuHpLnSHQ3WK4iw7M2zgNfUHvTLJhy64k76aYC LYYGR9VAWNDyt0AwbCHmppScWAx/We8014liKdv8aNH6bP6GVV47jQe/imRsnSTFkMnY E8yxYcy6aF83a5yrfMxSN5luxbd0dwhQdup7MKEBifWeoD1gJOBiZ6LJBZbplpRq3vax 06LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=rOpsc+gKKzwiV7DnWDGVyvxw9zsLQR5uIZqGpdrJeTE=; b=EtWrc6NiJlN6f7ES6LJV8dyeHFu8bCa5Gigv78Ux0jVUEa2kHXQk6Dp2V08sWjSLal 9FY+RO5eAroGhbD5pUogsEUTF8N0mt7ksWx1pPrR2xyAtvSBq0pDTFeOohpfEgnq2tEc yiEVFnU5rElDQ9k6YuLyqX9DdqmubpQNy3ZwZAigvBbAg88JOzNNzUi7npSERiM96/KI Oh51rpGutwyinWNW15RUocbnnpLdScas+KqvIlfSVU6Z2vXB0KgeMAGYloK18UVl/6hT hwrNfLRHOtuz6eLhUSEoZTOH+8ZJvDn0r6NeixWuUbQdtSJ2ESMsZBS2ArfXG3DbqHs4 VO4w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y14si3395734pgs.760.2018.02.20.13.48.48; Tue, 20 Feb 2018 13:49:03 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751367AbeBTVoL (ORCPT + 99 others); Tue, 20 Feb 2018 16:44:11 -0500 Received: from mga04.intel.com ([192.55.52.120]:7625 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750820AbeBTVoG (ORCPT ); Tue, 20 Feb 2018 16:44:06 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Feb 2018 13:44:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,541,1511856000"; d="scan'208";a="19075756" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 20 Feb 2018 13:44:02 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 34F6727F; Tue, 20 Feb 2018 23:44:00 +0200 (EET) From: Andy Shevchenko To: Rasmus Villemoes , Greg Kroah-Hartman , Andrew Morton , linux-kernel@vger.kernel.org, Alessandro Zummo , Alexandre Belloni , linux-rtc@vger.kernel.org, Arnd Bergmann , Joe Perches , Mark Salyzyn Cc: Andy Shevchenko Subject: [PATCH v2 00/21] lib, rtc: Print rtc_time via %ptR[dt][rv] Date: Tue, 20 Feb 2018 23:43:39 +0200 Message-Id: <20180220214400.66749-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At some point I have noticed too many users of struct rtc_time that printing its content field by field. In this series I introduce %ptR[dt][rv] specifier to make life a bit easier. There are still users of detailed output of the struct rtc_time, but we can introduce an additional extension for them in the future if needed, otherwise they might be converted to the proposed output format. Some of the changes slightly modify the output. In those cases we are on the safe side since they are pure debug. Nevertheless I tried to leave numbers to be the same or quite close: in some cases year is printed + 1900, though month is left in the range [0,11] instead of [1,12]. I didn't compile everything there, though I did a basic smoke test on some x86 hardware. So, I rely on kbuild test robot as well :-) Most of the users currently are RTC drivers, thus the patch series is assumed to go via RTC tree. The patch series depends on earlier send clean up of lib/vsprintf [1]. [1]: https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1612716.html Changelog v2: - split out lib/vsprintf changes to separate series - build it optionally depending on introduced PRINTK_PEXT_TIMEDATE - for now support only struct rtc_time - make an additional letter for different time representations - make above letter capital to reduce confusion on %ptr vs. %ptR - drop kdb patch since it's a candidate for time64_t support Andy Shevchenko (21): lib/vsprintf: Print time and date in human readable format via %pt rtc: Switch to use %ptR rtc: at91rm9200: Switch to use %ptR rtc: at91sam9: Switch to use %ptR rtc: m41t80: Switch to use %ptR rtc: m48t59: Switch to use %ptR rtc: mcp795: Switch to use %ptR rtc: pcf50633: Switch to use %ptR rtc: pic32: Switch to use %ptR rtc: pm8xxx: Switch to use %ptR rtc: puv3: Switch to use %ptR rtc: rk808: Switch to use %ptR rtc: rx6110: Switch to use %ptR rtc: rx8025: Switch to use %ptR rtc: s3c: Switch to use %ptR rtc: s5m: Switch to use %ptR rtc: tegra: Switch to use %ptR ds1302: Switch to use %ptR Input: hp_sdc_rtc - Switch to use %ptR mk68/mac: Switch to use %ptR PM: Switch to use %ptR Documentation/core-api/printk-formats.rst | 31 +++++++ arch/m68k/Kconfig.machine | 1 + arch/m68k/mac/misc.c | 8 +- drivers/base/power/trace.c | 4 +- drivers/char/Kconfig | 2 + drivers/char/ds1302.c | 39 +++----- drivers/char/rtc.c | 7 +- drivers/input/misc/Kconfig | 1 + drivers/input/misc/hp_sdc_rtc.c | 8 +- drivers/rtc/Kconfig | 1 + drivers/rtc/hctosys.c | 8 +- drivers/rtc/interface.c | 8 +- drivers/rtc/rtc-at91rm9200.c | 15 +--- drivers/rtc/rtc-at91sam9.c | 16 +--- drivers/rtc/rtc-m41t80.c | 6 +- drivers/rtc/rtc-m48t59.c | 8 +- drivers/rtc/rtc-mcp795.c | 18 ++-- drivers/rtc/rtc-pcf50633.c | 8 +- drivers/rtc/rtc-pic32.c | 18 +--- drivers/rtc/rtc-pm8xxx.c | 16 ++-- drivers/rtc/rtc-proc.c | 36 ++------ drivers/rtc/rtc-puv3.c | 18 +--- drivers/rtc/rtc-rk808.c | 20 ++--- drivers/rtc/rtc-rx6110.c | 12 +-- drivers/rtc/rtc-rx8025.c | 19 +--- drivers/rtc/rtc-s3c.c | 21 ++--- drivers/rtc/rtc-s5m.c | 27 ++---- drivers/rtc/rtc-sysfs.c | 12 +-- drivers/rtc/rtc-tegra.c | 30 +------ kernel/power/Kconfig | 1 + lib/Kconfig | 8 ++ lib/test_printf.c | 6 ++ lib/vsprintf.c | 145 ++++++++++++++++++++++++++++++ 33 files changed, 287 insertions(+), 291 deletions(-) -- 2.15.1