Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8225356ybn; Tue, 1 Oct 2019 05:14:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZm6S3l7OTx6YvIJtvJZ1tSvCyenIDY49j3S38wy2us1UlDWiMz/Pg6OOpF9E2AsE5YKP3 X-Received: by 2002:a50:9e26:: with SMTP id z35mr25010848ede.265.1569932093397; Tue, 01 Oct 2019 05:14:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569932093; cv=none; d=google.com; s=arc-20160816; b=joz6rAI4E6HfwweTWDWZUVUPKZWkofuPehPFVYRWuMdSs4bqwA/yMI7sHHOoSm63jb hAFsJMxYLQ8eDjNwr8S0aw+0QJcwESaeijYbIEhd74loM6Qd5sH/dNtQZHhgFhiHCure Nl7fRt9yNfdG85GvmHmluL118CaOeou5KpRWubTpGzvIu/ZPMazDJICkaUyWWqeSKfRG oU2Dct0OA+CZcQsV8CLTPSvOqvRJDmQv/swp6+yCkmOXbjtUCcvxV7v4iQaChw6x6hQD Ibt83yorb62lvLHn9CcTJoIETuG/1qt1grd0/cKOE7cQejTJX/sPYXc+6M1Q0HD3+ed6 3T9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=U8EcQGP4TRFBWRdgrBZsAFPzMAnHZfF6WMrGT4RmHrk=; b=KPyj3/srqv3/BBEKR9HDK4HclZiTYZ/M6Ozl9k+F5O64UlVBWhmbZbX5a+2tSApt5S cZGp5VpCwT1dWrUA7oo0CZc5GWM6DqNlK/AkhN0HhhAWbF07UCbyzBzpKIpzIV3h4y4z CIZ4vFSWffRy2cc8slqDPqqbNgMtIhg+iP2Gi4+L8QwcZUQcfhT96yv5oclRdv8JQX+A x8o9m1QoFZK7r5aIC7TMhn3aSd+3KzvfNHhHQ2PAXl4eYsOf+lDn2RKbUsZluzkcVw+r 89tH9zxd28vVJnuGKbssuSOvOgKhBCusujBv8omJz/8InYCKe/TSmeyEHSwNcvsNh5JF xztw== 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 um16si8657912ejb.12.2019.10.01.05.14.28; Tue, 01 Oct 2019 05:14:53 -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; 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 S1732942AbfJAMNZ (ORCPT + 99 others); Tue, 1 Oct 2019 08:13:25 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:58383 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726131AbfJAMNZ (ORCPT ); Tue, 1 Oct 2019 08:13:25 -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 relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 77129FF808; Tue, 1 Oct 2019 12:13:22 +0000 (UTC) Date: Tue, 1 Oct 2019 14:13:21 +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: <20191001121321.GB4106@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> <20191001114816.GA4106@piout.net> <20191001121154.GL32742@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191001121154.GL32742@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 15:11:54+0300, Andy Shevchenko wrote: > On Tue, Oct 01, 2019 at 01:48:16PM +0200, Alexandre Belloni wrote: > > 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. > > On BE 64-bit we will always get tm_year == 0, won't we? > Not if you have int tm_year in struct tm. I guess we can change the kernel struct tm because it is not part of the ABI. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com