Received: by 10.223.185.116 with SMTP id b49csp8594842wrg; Fri, 2 Mar 2018 04:44:47 -0800 (PST) X-Google-Smtp-Source: AG47ELum+jEmp1fiXU7v4IC9FPa5vUQWBeAK7tfFs1TuTwBU9YwxueirTDLfUA4mAQeX499eOY+Y X-Received: by 10.98.67.78 with SMTP id q75mr5479655pfa.98.1519994687717; Fri, 02 Mar 2018 04:44:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519994687; cv=none; d=google.com; s=arc-20160816; b=0vgmfN5gFY6/a+rR/QlWC5J8+e5TZPDUA8BmwtseYOpuUrz31Y2OyGam+JMLY7hnP3 SkHyrlWNTzGrdhfQq6peO7b6YobllTx4Fvlbd/DAqseC/n7gZZPNWYmwhEkS/S29LpUr GIwSkInTXgr+xT6SY1t+M7CYihSWGF9nNWFX3yO9f5V9HC+k0RAFnVkFrjM9RmVHh/I4 m/CXX665rjROphFW7CiPKmFhaEB7tahbS4K4DHExEdBCv7ZEPd6HeFm53FdqlfiBH64b BmNAAtZlQustJC07iHCzgMXrHSNi2wNxVjKKeaVRL1E0xlbAkv7kzvLLbiRUSI3yZ9uL XRhg== 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:arc-authentication-results; bh=I0UI70kqWVgWkKZ1l20tH6BJP0uEvC9dKdd9262dt2o=; b=Y0ZlukjdywK4HRnahCiVJrfmU7/J08CWBvYdWIZJbtH+3hStcDWJq9WJp1sktbpAmB m5/WO68dhv09+V56lOrathq+h93V/GBVM75Rfu6XUHnWtsPi+c0UjKQFwWHVbwwL6u6s AV6miJXxs+rpZGD0vSWGqzSliDPdnz2VY3MUVOk0Pr+2Gc2CE4uLnKxTpRMWjyKzYKB+ RQgG6e0/eqInfBXxI88sFwXrc6E9Lst9HPT55pm2Le4hvxjn0YIExcmekidZDto0NciY n2gJZCtjxKkJncqbnCVfLqoUpERRrQ+U8YEkOmbuIdtNeUrSChJW54FaDVR3xa9+m9HN 9eHg== 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 b61-v6si4716996plc.385.2018.03.02.04.44.33; Fri, 02 Mar 2018 04:44:47 -0800 (PST) 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 S1423956AbeCBI5A (ORCPT + 99 others); Fri, 2 Mar 2018 03:57:00 -0500 Received: from mail.bootlin.com ([62.4.15.54]:49424 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423929AbeCBI44 (ORCPT ); Fri, 2 Mar 2018 03:56:56 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 507CF20881; Fri, 2 Mar 2018 09:56:53 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (242.171.71.37.rev.sfr.net [37.71.171.242]) by mail.bootlin.com (Postfix) with ESMTPSA id EDE7F20650; Fri, 2 Mar 2018 09:56:52 +0100 (CET) Date: Fri, 2 Mar 2018 09:56:54 +0100 From: Alexandre Belloni To: Steve Twiss Cc: "linux-kernel@vger.kernel.org" , "linux-rtc@vger.kernel.org" Subject: Re: [PATCH 000/100] rtc: remove cargo culted code Message-ID: <20180302085654.GA1479@piout.net> References: <6ED8E3B22081A4459DAC7699F3695FB701941570C7@SW-EX-MBX01.diasemi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6ED8E3B22081A4459DAC7699F3695FB701941570C7@SW-EX-MBX01.diasemi.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/03/2018 at 08:46:48 +0000, Steve Twiss wrote: > On Wed, Feb 21, 2018 at 8:54 PM, Alexandre Belloni wrote: > > > subject: [PATCH 000/100] rtc: remove cargo culted code > > mailing list: linux-kernel@vger.kernel.org Filter messages from this mailing list > > > > Hello, > > > > This series: > > - removes useless calls to rtc_valid_tm in .read_time, .set_time and > > .set_alarm > > - removes code setting default values for RTCs (and lets the core > > handle it) > > - removes useless "time is invalid" messages at probe time > > - removes useless indirect calls > > > > Those were mostly copy pasted from other drivers > > Hi Alexandre, > > Acked for: > rtc: da9063: stop validating rtc_time in .read_time > rtc: da9052: stop validating rtc_time in .read_time > rtc: da9055: stop validating rtc_time in .read_time > > Acked-by: Steve Twiss > > Agreed -- rtc_valid_tm() call is cargo cult for the above. > > (By definition) for DA9063 I was trying to be rigorous. > The .read_time function is slightly different here because I can make a copy the alarm time into the RTC time > structure to solve an RTC synchronisation problem internally to the DA9063. > https://elixir.bootlin.com/linux/v4.5.6/source/drivers/rtc/rtc-da9063.c#L253 > > But after some further looking, I have not got any explicit case of how the time read directly from the DA9063 > registers can be incorrectly represented. So there should be no need to check this. > My point is that it is checked later in the core anyway so you end up doing: da9063_rtc_read_time() return rtc_valid_tm(tm); __rtc_read_time() if (err < 0) return err; err = rtc_valid_tm(tm); return err; So the check in da9063_rtc_read_time is always pointless. -- Alexandre Belloni, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com