From patchwork Fri Apr 20 15:19:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10352973 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E2E06602B1 for ; Fri, 20 Apr 2018 15:19:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBA7F223B3 for ; Fri, 20 Apr 2018 15:19:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BFA46287A7; Fri, 20 Apr 2018 15:19:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 12312223B3 for ; Fri, 20 Apr 2018 15:19:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755383AbeDTPTp (ORCPT ); Fri, 20 Apr 2018 11:19:45 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:43968 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755483AbeDTPTo (ORCPT ); Fri, 20 Apr 2018 11:19:44 -0400 Received: by mail-qt0-f196.google.com with SMTP id l11-v6so10054406qtj.10 for ; Fri, 20 Apr 2018 08:19:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=YgwftRTX4BH/5b4tOJjqPsBxGxo6BCB985JVEy7iFHU=; b=ShaPJzvBcoTesXukDcHfMEOQV+MV4MWXI8qz9VBlJtxAc/q4qzoX3cXdaWA+zmgL+z Rb+Yx5Nt2ir8RauYfOs6HGd9HAkVI/3JNa1gEJAeBFgMT0r6rtdr+e0Ons7nSNSvWSSG HH/lCFCFDmP2ojEPzIklj4rmE9FMWiURAH+pgVBDppqUP1+4SPwhtlyhhd7QNYxtJgEX UvID5GBo5vrjoVmOAaQbmM/yfX26jEIbXPxrWyFhyCSfXPp/bgXT0aRMbItIxGwmtnVl iOkKTnVgETKpYBYkjHFiGkxUmtjmdh0rv90KXLMqVp3RpZStclMgaQwvh+7ofeFzr3UJ jrFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=YgwftRTX4BH/5b4tOJjqPsBxGxo6BCB985JVEy7iFHU=; b=kq9TiTIPa9y4MYLV7eI28KTmhkwEgK+x+RpHvG9m1OlqAcKIM5cO5KHxI5iov8KcRy ooZ0dQdB+B4yASfol6NF2MJkHyNl8qzOdyw4RA5hXuXd5pPa+4wWmHrf2aiN1w9sJCAA 9LnNwvpwH++/Q4fDIbbu88mozE+UJXwDo5dJIZ4eyFEOB+dXIcjTb0q1hmHb40uc+kzz x+Jw70b1FwDDTI5tEKgTm+BusKshF3eGrxt3IZ+Aa81bh8Wca/UuQjZGAq48ozYO4m3B 9i3M6apANgVTHrbev8F2EHaH58mUztIT4t/yzqAfAT9tsxk49f+0pNvu2wY6f4ORsgwG hyCQ== X-Gm-Message-State: ALQs6tD8x6LKKvsQFvdQsvlfXM8AnxuY2ntf2t9SJsUpgwoAPSG7dcSJ pvFrRNEiFPH4IhaUTnIHCTbImvDmmWMPBQLiLl4= X-Google-Smtp-Source: AB8JxZqKa4hWQslM2u7E7MJKGMPQXwF2Z+E8fs4/KWjG6+OC943csvKnZtRTqV0vDn/N+xqDD9hp3rNOD4m7alE/P7Y= X-Received: by 10.55.180.1 with SMTP id d1mr10552557qkf.283.1524237584114; Fri, 20 Apr 2018 08:19:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.185.25 with HTTP; Fri, 20 Apr 2018 08:19:43 -0700 (PDT) In-Reply-To: References: From: Arnd Bergmann Date: Fri, 20 Apr 2018 17:19:43 +0200 X-Google-Sender-Auth: RALBTQ7WQsbzkViMwVNu-3jouTM Message-ID: Subject: Re: [PATCH] sh: time: Remove the read_persistent_clock() To: Baolin Wang Cc: Yoshinori Sato , Rich Felker , Mark Brown , Linux-sh list Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Apr 19, 2018 at 8:06 AM, Baolin Wang wrote: > The read_persistent_clock() uses a timespec, which is not year 2038 safe > on 32bit systems. Moreover on sh platform, we have RTC drivers that can > be used to compensate the system suspend time. Thus we can remove the > read_persistent_clock() safely. > > Signed-off-by: Baolin Wang Hi Baolin and sh maintainers. I have done a similar patch but never got around to posting it. Please see my patch below. Note that the patch is whitespace broken, I can send a proper version to the sh maintainers if they want to merge it, or I can apply my patch to my y2038 tree myself. Arnd commit cade6829ca223d9761863e74595d677b3dc14ecd Author: Arnd Bergmann Date: Wed Jan 24 16:18:50 2018 +0100 sh: remove unused rtc_sh_get/set_time infrastructure All platforms are now converted to RTC drivers, so this has become obsolete. The board_time_init() callback still has one caller, but could otherwise also get killed. This removes one more usage of the deprecated timespec structure, which overflows in y2038. Signed-off-by: Arnd Bergmann diff --git a/arch/sh/include/asm/rtc.h b/arch/sh/include/asm/rtc.h index c63555ee1255..fe55fbb181aa 100644 --- a/arch/sh/include/asm/rtc.h +++ b/arch/sh/include/asm/rtc.h @@ -4,8 +4,6 @@ void time_init(void); extern void (*board_time_init)(void); -extern void (*rtc_sh_get_time)(struct timespec *); -extern int (*rtc_sh_set_time)(const time_t); #define RTC_CAP_4_DIGIT_YEAR (1 << 0) diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c index fcd5e41977d1..eb0a91270499 100644 --- a/arch/sh/kernel/time.c +++ b/arch/sh/kernel/time.c @@ -22,75 +22,6 @@ #include #include -/* Dummy RTC ops */ -static void null_rtc_get_time(struct timespec *tv) -{ - tv->tv_sec = mktime(2000, 1, 1, 0, 0, 0); - tv->tv_nsec = 0; -} - -static int null_rtc_set_time(const time_t secs) -{ - return 0; -} - -void (*rtc_sh_get_time)(struct timespec *) = null_rtc_get_time; -int (*rtc_sh_set_time)(const time_t) = null_rtc_set_time; - -void read_persistent_clock(struct timespec *ts) -{ - rtc_sh_get_time(ts); -} - -#ifdef CONFIG_GENERIC_CMOS_UPDATE -int update_persistent_clock(struct timespec now) -{ - return rtc_sh_set_time(now.tv_sec); -} -#endif - -static int rtc_generic_get_time(struct device *dev, struct rtc_time *tm) -{ - struct timespec tv; - - rtc_sh_get_time(&tv); - rtc_time_to_tm(tv.tv_sec, tm); - return 0; -} - - &rtc_generic_ops, - sizeof(rtc_generic_ops)); - - - return PTR_ERR_OR_ZERO(pdev); -} -device_initcall(rtc_generic_init); - void (*board_time_init)(void); static void __init sh_late_time_init(void) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html