Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1495295ybn; Wed, 25 Sep 2019 19:48:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzA7llZV0FUSG6fa6oHs40LIHgbt98JAUR+es1fWLMa600xMSv5IWDmYF6yafcnWvBsLo+f X-Received: by 2002:aa7:c614:: with SMTP id h20mr1177422edq.209.1569466134648; Wed, 25 Sep 2019 19:48:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569466134; cv=none; d=google.com; s=arc-20160816; b=GzpPRKTokDMLBTIEbPa1HSclqAJ03Dqvk7wOXV2NBwjwaw3x8O7+H0WYUx0WPNB5KX ++ugIEB2lNKK0IXBBN0Zp/J9c/MaccRqWtm5wuKAXeERbAMEowcu9r0yVPNWqjvhiOKW Ffa4a0yadejLLdPs/32xj+9RVmonmSHQmtWPWfs+Kc+DiYFSLT3a2FTaU/jfGwuDbYZ0 tXJriNxdjCSf8DsBU0TxRdX0WWnC/qzUtzfETyc0lirKrenbK+y+/22CWXoB59DTeYMW gnE+JwUIA2g0dyMtZyv6WQ+UzBoejGvzgc1PZDIxFaeN07M4mzoVxLAxz933UZAAoT3O 4WCg== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=s9+ULyf4eZYwg+JRvuUUJNwWAq0Qswv+8RvqeWjPovw=; b=F17LvpOms/DZztClUjb14w73q5aQ+DN22vVnzVMkfIexEAcRfMW/09sm4XA1V9/qlz QAa7J1BE7uB1ihnyffcoNxntVZQKJjB+1ubpKAkwiBw3f7MN4I51eFM/rXmaKSPPPWcz BrT5Wq6OnDhFnbZjzjfGIxw0I3OVXeJrHDCLW9QLGfsnW7/8XkPPonWbRMCjdq+WuDOC EnNYGR0ovEQdsUNUvVVKjksaxaZ4t93IjR7BXhljig11krT90ZIutcWc+J2YTSb6wsCm DU9YbhyjT9Ft62HMRGavoKeevJCqwdWOA8yEbRkjToMNt7I8RqTGQDZPO+umrq/I4Z0Z AKOw== 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 k9si341354ejc.310.2019.09.25.19.48.30; Wed, 25 Sep 2019 19:48:54 -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 S2502499AbfIWUTl (ORCPT + 99 others); Mon, 23 Sep 2019 16:19:41 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:35551 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728647AbfIWUTl (ORCPT ); Mon, 23 Sep 2019 16:19:41 -0400 X-Originating-IP: 90.65.161.137 Received: from localhost (lfbn-1-1545-137.w90-65.abo.wanadoo.fr [90.65.161.137]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 08151C0009; Mon, 23 Sep 2019 20:19:38 +0000 (UTC) Date: Mon, 23 Sep 2019 22:19:38 +0200 From: Alexandre Belloni To: Nick Crews Cc: Pavel Machek , Benson Leung , Alessandro Zummo , Enric Balletbo i Serra , linux-kernel , Duncan Laurie Subject: Re: [PATCH v2 1/2] rtc: wilco-ec: Remove yday and wday calculations Message-ID: <20190923201938.GB4141@piout.net> References: <20190916181215.501-1-ncrews@chromium.org> <20190922161306.GA1999@bug> <20190922190542.GC3185@piout.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 23/09/2019 11:20:42-0600, Nick Crews wrote: > > This is coming from struct tm, it is part of C89 but I think I was not > > born when this decision was made. man rtc properly reports that those > > fields are unused and no userspace tools are actually making use of > > them. Nobody cares about the broken down representation of the time. > > What is done is use the ioctl then mktime to have a UNIX timestamp. > > > > "The mktime function ignores the specified contents of the tm_wday, > > tm_yday, tm_gmtoff, and tm_zone members of the broken-down time > > structure. It uses the values of the other components to determine the > > calendar time; it’s permissible for these components to have > > unnormalized values outside their normal ranges. The last thing that > > mktime does is adjust the components of the brokentime structure, > > including the members that were initially ignored." > > This is very non-obvious and I only knew this from talking to you, > Alexandre. Perhaps we should add this note to the RTC core, > such as in the description for rtc_class_ops? > I'm planning to add documentation on what should be done in an RTC driver, I'll ensure to add something on this topic. > For this patch, do you want me to make any further changes? > No need for any changes, however, I can't apply it right now because we are in the middle of the merge window. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com