Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8341410ybn; Tue, 1 Oct 2019 06:51:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqzq9J5jVJQucQBScZkydxw2lpTtetxsDGSK7igyFg6oLqhl0V6XJoinx3dpG/DmVS6o+eyO X-Received: by 2002:a17:906:349a:: with SMTP id g26mr23485836ejb.77.1569937897707; Tue, 01 Oct 2019 06:51:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569937897; cv=none; d=google.com; s=arc-20160816; b=VzQmU5fl5XisNjhUDJNc8HTbER6XI6QqDjANKmlgiPCO9LesJlHDKmNsT7yZ23oaiy 8RkA/Newdv5hA3JeOLiFmw4CKxC9jg0uLMWWX9oe7LPqOT67zBHnKFHK9JeEZV8VOf7h 6f2oJx0DeYit0COWEnqRosn0ylkQZgllTpWubwvw/GT0b3yV8QOWr6YhFqByHJO9rBJ1 Jq8NwJJld1cW5LdOCakGKBXW5QUSrnCkf4BKcKJJp8MkmzXJrpk8QEK1McsdVlxeiJCL 9luXPxomfSlezlnB7G16HmGhZJK5zgoPY7P6BhcET79gM6K5MEa1aVEgLbOK1tBxmQhK Qy/g== 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=8ULdIlUCen1pST6JeWTJI2PC0bvTGccwEBSJOBxzedA=; b=poIAQSOO3cA2JyVWOjPUeBUFL2JTKGTWZ9zLWfJur9j3TugScEqhziQi+ZiZmFoGGL fgvfcEEejAfp3KS2oa0/KxZfJuCK7o/YULgGegXA8i+g3NTU5yBK04vi9tPo2oYC/16a buv7dUzwxjfpwUuNmqmNdz5OCEOggTubsia0L81d26oGIhzAtS3Moq1cXGAOVquNlnhA sI5bvM3xi3dBo4Pzy9kl+pnL2z7xarSrI0+4AbA32E9Z2BupAE7A+K62LkcBsOCLRIo+ Q82PVSSDjtsNja8MP5fp9LMwWfyssZaoi3eg++duG/+Y+nyzXvcbzuBvku4cRh6n+YFN kIow== 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 ng7si8981128ejb.91.2019.10.01.06.51.13; Tue, 01 Oct 2019 06:51:37 -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 S2388757AbfJANuM (ORCPT + 99 others); Tue, 1 Oct 2019 09:50:12 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:52815 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388661AbfJANuL (ORCPT ); Tue, 1 Oct 2019 09:50:11 -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 relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 219EEE000E; Tue, 1 Oct 2019 13:50:07 +0000 (UTC) Date: Tue, 1 Oct 2019 15:50:06 +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: <20191001135006.GC4106@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> <20191001121321.GB4106@piout.net> <20191001133335.GP32742@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191001133335.GP32742@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 16:33:35+0300, Andy Shevchenko wrote: > On Tue, Oct 01, 2019 at 02:13:21PM +0200, Alexandre Belloni wrote: > > 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. > > We can, but: > - it will require to change all `printf("%ld", tm_year)` cases at the same > time in entire kernel (and also some functions might start producing > warnings when some variable will be cut to int) > - it is out of scope of this series > > So, I will leave it untouched for now. > That's fine, I was not asking to do it as a prerequisite ;) -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com