From patchwork Wed Feb 28 05:57:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 129920 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp645607lja; Tue, 27 Feb 2018 21:58:10 -0800 (PST) X-Google-Smtp-Source: AH8x22414I6ciym+I0rhiHAlSdlxlXtiAYfz8XdRLlcGpdmUo1tHqPKJYXXMkjT93F4C+cYlAder X-Received: by 2002:a17:902:63:: with SMTP id 90-v6mr16546994pla.125.1519797490445; Tue, 27 Feb 2018 21:58:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519797490; cv=none; d=google.com; s=arc-20160816; b=r+iHQwbDtc2saI/lfJzls1p1NHh2Tz4dt64BTyox1cSmGAMO1VLziFect0nRkGEMU7 qwLhqsvhAODOYMf7oS1OPeMp9dEZ+k1PpasU/Bod4IWmyXtI2C+uP7oxNf1J8nVwU8Pj OTagJm+ly7dSMAOPCSTbzOBImWrTzycD2SkRKSOBCJg4iA+cwvK5csVShO4n4NpZCHBk RHq4ORDnqC7dMEKJxT+JFjs6cnl3JqSY9K7fKhytGF57j2HqnXgj5Vm+PplCyPQKMgiw Zb2W4zuwzJNgemaKZ4i0MBksaCVRc0M6dcPIbIguDKlBZJu8eAJcXLrECRGsptszYa9F MTTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=z1DRlau2rEdhS1z4lsfUdJTUlYn6bPpks+7Qv4XeAV8=; b=v9klwj/7Bh3qEBe8Ub2/9s4ef23nBJcE83K+piXuJ1jfd0u5i9/I7sH5yCtG6h1y9l aCDrUZQkvUcFTKQuvTZPXBSzHVJVuvRlq3hlf+qAqCVUjR5IbiBG9H/678QGBmW4g7JC dYu9+5jNYuP1SIlgBJs0P5dO/UpuRYBg7ayEp1J2adNpSUdFwMHeSK6BfoXqRLVlRPMn hjbbTmEiJZ56aMsddsEaP4KqSBJjUoOYVN8i1uQg8z2f2sUy7g33b84iSTHiuzCuVOhd IaD8uOzxXDkhRT2LSicrydg37VGdqWvQPC8OLdvIt1krTOmBC1i7Ph6icO30ccg0m8XU pWDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZeDrdzqo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r26si584659pgd.654.2018.02.27.21.58.10; Tue, 27 Feb 2018 21:58:10 -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; dkim=pass header.i=@linaro.org header.s=google header.b=ZeDrdzqo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751721AbeB1F6H (ORCPT + 28 others); Wed, 28 Feb 2018 00:58:07 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:43843 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750756AbeB1F6F (ORCPT ); Wed, 28 Feb 2018 00:58:05 -0500 Received: by mail-pg0-f65.google.com with SMTP id e9so574721pgs.10 for ; Tue, 27 Feb 2018 21:58:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=z1DRlau2rEdhS1z4lsfUdJTUlYn6bPpks+7Qv4XeAV8=; b=ZeDrdzqod39j8QPWv/uOpfI7C8t3dhdO9lNUjNVKwHlTxsoA23YZnDlsx0k+oZ8sfH OfDlbvwjb+a8b57bdruJIIvJ5/N2iawvHXypEMD7pnS/6XunFrP9bDbs69LmyPIPtWdy JFZbzMRBMmsd5y03I578nf2QbKN5dBHgwLdtk= 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; bh=z1DRlau2rEdhS1z4lsfUdJTUlYn6bPpks+7Qv4XeAV8=; b=NYrlexmWZmCEeOj3s7mJJ5gQyRTp6lQv2Um6+vA2DPGHnecgXzCl6TqN4SoT34sN3i Qj15uemMQC+kF7uWaY391au6oAfuBhB9DxHQjPKb4MvkpfKoPAobLfNWFJGCuvYaY+Ud 3KdrnXanAAowoOy0/SDf+DjSiJqi5RyExNUb3hrCAoqaZieDAPzurAEEuzRXx6gX9beF fi1Cwg136vYQgMTBVaNLBiRS7s5KYMs4SVY0VKVVlVvEsXGo7iIzpdOcqqtc5JIO1XFh YMxcvArqyRbguz7nsD4RVz0b+F+RCVIAsv7Y4UPOnrbUcNBWKc1IYt3W9KtV+9dVijqZ hiTQ== X-Gm-Message-State: APf1xPC+vgcHfY1HddnvEKu+eexxtY9YmgrdaXT0QAGxtXTQzjspOqAH z8JxjLU4nY6fkzozHfZGrzxsHQ== X-Received: by 10.101.96.73 with SMTP id b9mr12827273pgv.339.1519797485458; Tue, 27 Feb 2018 21:58:05 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id e23sm1441266pfi.76.2018.02.27.21.58.01 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Feb 2018 21:58:04 -0800 (PST) From: Baolin Wang To: john.stultz@linaro.org, nicstange@gmail.com, arnd@arndb.de Cc: adi-buildroot-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, broonie@kernel.org, baolin.wang@linaro.org Subject: [PATCH] blackfin: time: Use read_persistent_clock64() instead of read_persistent_clock() Date: Wed, 28 Feb 2018 13:57:22 +0800 Message-Id: <6d0c9ea91b9e33757073a05756e2ac1078168945.1519796369.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since struct timespec is not y2038 safe on 32bit machines, this patch converts read_persistent_clock() to read_persistent_clock64() using struct timespec64. Signed-off-by: Baolin Wang --- arch/blackfin/kernel/time-ts.c | 6 ++++-- arch/blackfin/kernel/time.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) -- 1.7.9.5 diff --git a/arch/blackfin/kernel/time-ts.c b/arch/blackfin/kernel/time-ts.c index 0135055..95a80ab 100644 --- a/arch/blackfin/kernel/time-ts.c +++ b/arch/blackfin/kernel/time-ts.c @@ -357,9 +357,11 @@ void bfin_coretmr_clockevent_init(void) #endif /* CONFIG_TICKSOURCE_CORETMR */ -void read_persistent_clock(struct timespec *ts) +void read_persistent_clock64(struct timespec64 *ts) { - time_t secs_since_1970 = (365 * 37 + 9) * 24 * 60 * 60; /* 1 Jan 2007 */ + /* 1 Jan 2007 */ + time64_t secs_since_1970 = (365 * 37 + 9) * 24 * 60 * 60; + ts->tv_sec = secs_since_1970; ts->tv_nsec = 0; } diff --git a/arch/blackfin/kernel/time.c b/arch/blackfin/kernel/time.c index 3126b92..48a6684 100644 --- a/arch/blackfin/kernel/time.c +++ b/arch/blackfin/kernel/time.c @@ -132,9 +132,11 @@ irqreturn_t timer_interrupt(int irq, void *dummy) return IRQ_HANDLED; } -void read_persistent_clock(struct timespec *ts) +void read_persistent_clock64(struct timespec64 *ts) { - time_t secs_since_1970 = (365 * 37 + 9) * 24 * 60 * 60; /* 1 Jan 2007 */ + /* 1 Jan 2007 */ + time64_t secs_since_1970 = (365 * 37 + 9) * 24 * 60 * 60; + ts->tv_sec = secs_since_1970; ts->tv_nsec = 0; }