From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C71C2C388F3 for ; Tue, 1 Oct 2019 11:48:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A32FB21920 for ; Tue, 1 Oct 2019 11:48:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387420AbfJALsX (ORCPT ); Tue, 1 Oct 2019 07:48:23 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:54963 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725947AbfJALsT (ORCPT ); Tue, 1 Oct 2019 07:48:19 -0400 X-Originating-IP: 86.207.98.53 Received: from localhost (aclermont-ferrand-651-1-259-53.w86-207.abo.wanadoo.fr [86.207.98.53]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 5E57B1BF208; Tue, 1 Oct 2019 11:48:16 +0000 (UTC) Date: Tue, 1 Oct 2019 13:48:16 +0200 From: Alexandre Belloni To: Andy Shevchenko Cc: Petr Mladek , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Hans Verkuil , Mathias Nyman , Jonathan Corbet , Thierry Reding , Jonathan Hunter , John Stultz , Thomas Gleixner Subject: Re: [PATCH v1 1/4] lib/vsprintf: Print time64_t in human readable format Message-ID: <20191001114816.GA4106@piout.net> References: <20190104193009.30907-1-andriy.shevchenko@linux.intel.com> <20190108152528.utr3a5huran52gsf@pathway.suse.cz> <20190110215858.GG2362@piout.net> <20190726132037.GX9224@smile.fi.intel.com> <20190930200809.GK3913@piout.net> <20191001113655.GI32742@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191001113655.GI32742@smile.fi.intel.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/10/2019 14:36:55+0300, Andy Shevchenko wrote: > On Mon, Sep 30, 2019 at 10:08:09PM +0200, Alexandre Belloni wrote: > > > > Maybe be rtc_str should take a struct tm instead of an rtc_time so > > > > time64_to_rtc_time always uses time64_to_tm. > > > > > > Because this one, while sounding plausible, maybe too invasive on current > > > state of affairs. > > > > Well, if the kernel struct tm had an int tm_year instead of long > > tm_year, then you could simply cast a struct rtc_time to a struct tm. > > I don't think so. It will be error prone from endianess prospective on > 64-bit platforms. > I don't get why, as long as the first members of both structs are the same, this should work. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com