From patchwork Fri Mar 9 18:42:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 131213 Delivered-To: patches@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1324203lja; Fri, 9 Mar 2018 10:43:03 -0800 (PST) X-Received: by 10.101.98.205 with SMTP id m13mr24947321pgv.100.1520620983288; Fri, 09 Mar 2018 10:43:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520620983; cv=none; d=google.com; s=arc-20160816; b=Wwb5u3Y2tygcVpf1aYnXmwolIfNhOySDFikZTDF/zweN/xcFA8Yphfs4ZvSts2yb/f n8ZU4BnbirpYNVgQ2FN56ciWVyIAoMvqn89QUD4MmIDjpU04K30d8IAWirlCwDaGbBZ6 UIrojn+o9HrS4lnlHylR/a6fQyn8BuLN5xvo5nZLTb0ZrNKOBqZj0znG+vtNwgsmm4vd NGmVQ/tXCDC3q7L3Yc4WuooEfWJIu1XxaECtn/J1zvSgt0hL9kJiPA3Yz8ZGLHZJ717z oZoBglbAQpMtHfIsPS6ab4N4OI9ftglRq74j1ql4g7USHhp68YZaZMjiTjDjPBS2Qb9x mVTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=kK/wr9HIlYK3wMgDQeXGvMJaQgIQSbQanTu0A/BFDPQ=; b=cWiXAwRIa2VEBYMLzTXUVzy573Wrags+PLIlbfcerzA9GHAv+ktNwmkkJ5lfoVPlYl bYFALNq/Ec+/Epnk/eZyfkbtVzWW7s/b2YOvARLNEDo8bMk1XrLIbFItzeqMUfGaIeQ7 iQDSDGVjpWt0UPfZAHAHfdbYFrGGM5tDlA2BXIPUhjjhBI8gNXAevoLF5Co2E1kURd1o gsWEa9X5fLWFEgKQIaLtVwj72TYm61S7acOXScEqWXNgIShS1nQ1pOAdGLCqlFnkXahs pP8UZBZ4CFGDGEG6ujyY15aPIwolkvSUYXezgoXTeeovCQOoN5Ty1T4EDAystveHi2DN MBFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yr7YUdkh; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id k11-v6sor764963pls.94.2018.03.09.10.43.03 for (Google Transport Security); Fri, 09 Mar 2018 10:43:03 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yr7YUdkh; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kK/wr9HIlYK3wMgDQeXGvMJaQgIQSbQanTu0A/BFDPQ=; b=Yr7YUdkhxqj0eHxfTxicf+tLgBLvDSiqj1V/0S6tmOJOeez3ZRPFGuLmIyUQDOtkJq LqYdO3GpynOGAU97kS5MbB9l7va5oD10E7Z/gWbRhWtzTBzofbfMx83S++Xpk7gaIbeE NvPKwgxIsuQXUxkv1JQqh2dZdvp8lEsCS6qZ4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kK/wr9HIlYK3wMgDQeXGvMJaQgIQSbQanTu0A/BFDPQ=; b=Xv0lhNZ5VnaZcRofD3ZUaMuWvDIjW36nbRcswRXfLRzrRBIu5zTrc0aIhDS0sKIU/K g5xgkBNhQEnrLvfvFamx1xg5vfLmj2oikbzBB/Q560gmAg7mnCVwsPh8YPHSBYEYLSMl XGQ6GJ8H5eqvETgZ3iQuZpIWYh5+2V8NEmgMdri+y4x5gWDmya11i2okLwLvan3hYiRL 7co7w7oYakpuccEZWW/AjVU1rDPrfEMMUeTdj81Bel3QjiLXo/rHELRTbSJ6u7Ws4h97 q75BEb1b1bLHhOkZ/4bcuV/mxoBq+sPTk9Igp4QnvTCABHBAvervth7Mi+4MmWIpbhyy GSFw== X-Gm-Message-State: APf1xPBYbPqBbbEbiizNFnO4yT6ObH9pL4LVwi0eov8W7QB/s3yaw3gI Kqurr2y5nWMkdDm81I8FmNzUpsyA X-Google-Smtp-Source: AG47ELuC+ADm+mSj85N2Uxe8U7xZhMlIgy8HC6tsOntc6Fg0gV7vUSGekx5hsOjQNm2xdGUIZD67FA== X-Received: by 2002:a17:902:8f89:: with SMTP id z9-v6mr29117043plo.370.1520620982794; Fri, 09 Mar 2018 10:43:02 -0800 (PST) Return-Path: Received: from localhost.localdomain ([2601:1c2:600:5100:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id y5sm4333162pfd.85.2018.03.09.10.43.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 10:43:01 -0800 (PST) From: John Stultz To: lkml Cc: Benjamin Gaignard , Arnd Bergmann , Thomas Gleixner , Ingo Molnar , x86@kernel.org, Miroslav Lichvar , Richard Cochran , Prarit Bhargava , Stephen Boyd , Alexandre Belloni , John Stultz Subject: [PATCH 4/4] x86: rtc: Stop using rtc deprecated functions Date: Fri, 9 Mar 2018 10:42:50 -0800 Message-Id: <1520620971-9567-5-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520620971-9567-1-git-send-email-john.stultz@linaro.org> References: <1520620971-9567-1-git-send-email-john.stultz@linaro.org> From: Benjamin Gaignard rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Cc: Arnd Bergmann Cc: Thomas Gleixner Cc: Ingo Molnar Cc: x86@kernel.org Cc: Miroslav Lichvar Cc: Richard Cochran Cc: Prarit Bhargava Cc: Stephen Boyd Cc: Alexandre Belloni Signed-off-by: Benjamin Gaignard Signed-off-by: John Stultz --- arch/x86/kernel/rtc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/arch/x86/kernel/rtc.c b/arch/x86/kernel/rtc.c index 69ac9cb..f7b82ed 100644 --- a/arch/x86/kernel/rtc.c +++ b/arch/x86/kernel/rtc.c @@ -41,11 +41,11 @@ EXPORT_SYMBOL(rtc_lock); */ int mach_set_rtc_mmss(const struct timespec *now) { - unsigned long nowtime = now->tv_sec; + unsigned long long nowtime = now->tv_sec; struct rtc_time tm; int retval = 0; - rtc_time_to_tm(nowtime, &tm); + rtc_time64_to_tm(nowtime, &tm); if (!rtc_valid_tm(&tm)) { retval = mc146818_set_time(&tm); if (retval) @@ -53,7 +53,7 @@ int mach_set_rtc_mmss(const struct timespec *now) __func__, retval); } else { printk(KERN_ERR - "%s: Invalid RTC value: write of %lx to RTC failed\n", + "%s: Invalid RTC value: write of %llx to RTC failed\n", __func__, nowtime); retval = -EINVAL; }