Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932225AbbDOJf3 (ORCPT ); Wed, 15 Apr 2015 05:35:29 -0400 Received: from pandora.arm.linux.org.uk ([78.32.30.218]:58842 "EHLO pandora.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753986AbbDOJfV (ORCPT ); Wed, 15 Apr 2015 05:35:21 -0400 Date: Wed, 15 Apr 2015 10:35:10 +0100 From: Russell King - ARM Linux To: Xunlei Pang Cc: linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com, Alessandro Zummo , John Stultz , Arnd Bergmann , Xunlei Pang Subject: Re: [PATCH 4/5] drivers/rtc/pl030: Replace deprecated rtc_tm_to_time() and rtc_time_to_tm() Message-ID: <20150415093510.GW12732@n2100.arm.linux.org.uk> References: <1429089611-29776-1-git-send-email-xlpang@126.com> <1429089611-29776-4-git-send-email-xlpang@126.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1429089611-29776-4-git-send-email-xlpang@126.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1184 Lines: 31 On Wed, Apr 15, 2015 at 05:20:10PM +0800, Xunlei Pang wrote: > From: Xunlei Pang > > The driver uses deprecated rtc_tm_to_time() and rtc_time_to_tm(), > which will overflow in year 2106 on 32-bit machines. > > This patch solves this by: > - Replacing rtc_tm_to_time() with rtc_tm_to_time64() > - Replacing rtc_time_to_tm() with rtc_time64_to_tm() > > Cc: Russell King > Signed-off-by: Xunlei Pang NAK. How does this fix anything? The RTC contains 32-bit registers. Even if you convert the struct tm to a 64-bit time, you can only write the lowest 32-bits to the hardware. You can onyl read the lowest 32-bits from the hardware too. This patch solves /nothing/. In fact, it hides the fact that this RTC is unable to represent dates after 2106. -- FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up according to speedtest.net. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/