Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8322988ybn; Tue, 1 Oct 2019 06:35:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGEE6MdMiU6B0b9kMk6W2fB/QO2eZg7tDfwOTG4QkUNcBb++9tLFZB+CMilLfDl5lQcvMh X-Received: by 2002:a17:906:2542:: with SMTP id j2mr24558398ejb.278.1569936952085; Tue, 01 Oct 2019 06:35:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569936952; cv=none; d=google.com; s=arc-20160816; b=dBiQv+5ZabjhZzd2HMGtGj2l6h9zu1UKaLBYOxjOmg8r81uYl3SnJkyAo3//m5/CHv SihXKNUmjaF8eOEGQS+cR/5pVcX6UM2LJhJ76B/IdmDARhtjXyDLKPCR16YccIkRSFr/ lXM1zNfTR+VesNHr8S3UX80WQaApvcB87cN7PZ+Uan+MSzcPAYKK03Z9yiPPVz2UX1rq CpT8a/vaBRp+47YQnjH5FCD5SrxoBtLjeh+LfVEb5LcrzyOcBq7kWPhWfKEjm/raEO2I NeYLeVPA4AdXNMyKal19zriLx9IGrjseBGL7PCnEidFF7EfG/nJznh1KfnPFbkIZyWeF dp4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=9isjTRhftfdl23itYBcIUrTCyoodj4QknKVmMzCTGKs=; b=M7AM5gzeRfrqCxScU/L5K49D1xU7lWnHobBxEYpD3SnoOc74tdYGVnl56re3deLjgJ 8eWVMDbhRtvHoBqpQk/jiQfA1YIL5r9AW9PpTHz1bJhZs2ZxY3sBBvk9Fx8zmUveHbu2 ASFB8xxo0N/wF80VMVkWzK+kbTeX9ce3dAUsV+UQB54ZQh9Me8QRoRDjw4X8X9Q7bgDT 0DVikwmQmLlmxMVzx0MGsndliQhd2IybC0Y1gnGX6GFEjNXo3cy/YYe5+O/64T28+6Kd DmmflyISh36MqOei+xo/RufpVHN6LnOFyxfss+0w7JJqUM7Ng2BAsw+T3PivZwOJNVEY T2ww== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id op4si8654784ejb.77.2019.10.01.06.35.26; Tue, 01 Oct 2019 06:35:52 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388554AbfJANdu (ORCPT + 99 others); Tue, 1 Oct 2019 09:33:50 -0400 Received: from mga06.intel.com ([134.134.136.31]:18860 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726710AbfJANdu (ORCPT ); Tue, 1 Oct 2019 09:33:50 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Oct 2019 06:33:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,571,1559545200"; d="scan'208";a="392442140" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga006.fm.intel.com with ESMTP; 01 Oct 2019 06:33:36 -0700 Received: from andy by smile with local (Exim 4.92.2) (envelope-from ) id 1iFIHX-0000pt-4N; Tue, 01 Oct 2019 16:33:35 +0300 Date: Tue, 1 Oct 2019 16:33:35 +0300 From: Andy Shevchenko To: Alexandre Belloni 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: <20191001133335.GP32742@smile.fi.intel.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191001121321.GB4106@piout.net> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- With Best Regards, Andy Shevchenko