From patchwork Wed Jun 20 10:01:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 139304 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp576159lji; Wed, 20 Jun 2018 03:01:44 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL14phvCAnszxqqoXAH4JqbmFJLYVpygxmfiztVoc6BakTAcHo7npIIC3vVFCOfqGlQ/d7k X-Received: by 2002:a17:902:24a5:: with SMTP id w34-v6mr22887713pla.52.1529488904261; Wed, 20 Jun 2018 03:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529488904; cv=none; d=google.com; s=arc-20160816; b=eGy45CQqSpZ6rALDC/dXgTIXX1EwTijflFAGnEJgaMQnJjjamoww5yVP4XOmukutFT ogzpdoI0GKqDX4qIzGL77KaVRgtnYRlgIC3ZnuVAkoaLr0sNJCWJondMXOzXzdvIjPCA y+8ScEQdPOVBN4hPL7kye+97o1n28I6ZILlt1OuaiHw+m0aL6YbdIzCK84Ylsf7Pa2QL FynTkkO10xdjkWhtPjfCze/a0Ffz63+qKNCdFumiUL/oZSpjMfQMPP+iGupM34EOTi85 dOlxHriUgLLqQE2tFexAPzJNRmf1PKMg++WD/O0xKY5bC4ZZUpR4bJXUbiyyCXHFJUPx lYCA== 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 :arc-authentication-results; bh=bDL3KrknBVWVIpFI1xzRawqzaBbsDbG4uQ8yMVej4Us=; b=Et0JghdwPJYOldcQVN38bZFT0iG2amf+Hsgru4adiLw+zngRs9EoVUt050jFcH5AJQ enyZW3g+rCj0rojuCcLb+In2YzTgMNUiltQvkYefcttT0TEtOz1MRzpGzDYaweGQ8Xsz F2EqaOv1K5dUFtVyn4sdhS/kutGpKT5kzez6ENLMwBOw4kRoIqKgev43zGmCgrwIBZ/D uddKg2dKiwdOv+WWzlG7sCc0jfOMViLJ0J3Qwm2dyvMZp4/sFp0s60jdGY+SjQzzEt+m hw7vHhT2+pVMz6JgkRBqhDiMnecIlXQw4j8fh3sIoqITfNPS+SwbNIMN+q+fW/xYLmjR 82zw== 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 n22-v6si1899501pff.370.2018.06.20.03.01.44; Wed, 20 Jun 2018 03:01:44 -0700 (PDT) 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 S1751340AbeFTKBm (ORCPT + 30 others); Wed, 20 Jun 2018 06:01:42 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:50515 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754014AbeFTKBi (ORCPT ); Wed, 20 Jun 2018 06:01:38 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0MC1IG-1fMkE31NeS-008rUW; Wed, 20 Jun 2018 12:01:35 +0200 From: Arnd Bergmann To: Al Viro , Andrew Morton Cc: y2038@lists.linaro.org, Arnd Bergmann , Deepa Dinamani , linux-kernel@vger.kernel.org Subject: [PATCH] adfs: use timespec64 for time conversion Date: Wed, 20 Jun 2018 12:01:07 +0200 Message-Id: <20180620100133.4035614-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:TnexxAo5hjAMo7G2Vm6zeOeHtHvRti584NXnMeIunRoT9c+ilsQ jivjcIW2MFmhHn20JR5FYEu+W8HdgB5X3a0uyt2vDxXuSRgVQtX69LS6THHP23a99jwQC/9 tWvDZxMrrAtS8TzsQQnxlRkc9ZF6skjr7oHqSQJ+NV97zW2QZgAsZi4NfQoh+BjWeAk1EU6 jNBt45iphSXpworT3ICXA== X-UI-Out-Filterresults: notjunk:1; V01:K0:zAcjZA3xhwA=:2TzHoA+gfs8foOBPPYzuO1 PzHd2RNVdgnrUAErp+WQyNyRzy0swMj0vWLMRwzi4PVxQjV1ITV2p2RG1L9ormQBzp+kbeU9w KIo2LbOIhqrA/PNDfxz5X8hjPobxFKMKEQoqIDp0lDZeDWYWfov6oC/k3OAIYQtTApdoiBQXO vl0bsSafXnyzjE8PaRN1UZCqu6hLuIeXfXfDOfTGTq4ihzC/aESphw5JDVVSEQzuJdYBWFKfe fLr4Ic+iNccWSekfpFfpVkrac5qE34LeRdBtqjorctLc4lZXX038l0dR4JDAA+9rXLDigoFr4 d3aQCHxzybcVSwr8V8LM01heoRaQMP2HlAMoXue3PbCYfLt2VyprCMroNNnSy6Yh5ZYhzafSc VjJ1UeIs35gRAMn6CY8/SfsunnKA2X4DKKEhMQvldkoRzkRJURzPQOIAEk+0IRurEM8X2LBAI 44TTRAPZ7KsDCub3zoL2WEudFv425kcr74TRdWU/PRAAVzhGThGL02DAizvKqBNQSYLTPKRP0 RLvCBo+7uYJ5SlnBEV872DAwnwHYP13pFjGp0iIpj3qNyCuPlHHYGCTFZTCaOj7mrNGqC3uL4 Q7E95cF+QVO1Adbo7syPiauZ18Yl5aX7ddUCIPFZLS3nyteqTUcJpSAskFsGJOW9+3kjtbavw XQFePAgm6WBqgdTOUXx9Y0YpqjCI3eR9trtQ8Jpc7UGlIYZ0+GBOcNVAtu0SuGbPhAus= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We just truncate the seconds to 32-bit in one place now, so this can trivially be converted over to using timespec64 consistently. Signed-off-by: Arnd Bergmann --- fs/adfs/inode.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) -- 2.9.0 diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c index c836c425ca94..3f3c3b7ec82e 100644 --- a/fs/adfs/inode.c +++ b/fs/adfs/inode.c @@ -167,7 +167,7 @@ adfs_mode2atts(struct super_block *sb, struct inode *inode) * of time to convert from RISC OS epoch to Unix epoch. */ static void -adfs_adfs2unix_time(struct timespec *tv, struct inode *inode) +adfs_adfs2unix_time(struct timespec64 *tv, struct inode *inode) { unsigned int high, low; /* 01 Jan 1970 00:00:00 (Unix epoch) as nanoseconds since @@ -195,11 +195,11 @@ adfs_adfs2unix_time(struct timespec *tv, struct inode *inode) /* convert from RISC OS to Unix epoch */ nsec -= nsec_unix_epoch_diff_risc_os_epoch; - *tv = ns_to_timespec(nsec); + *tv = ns_to_timespec64(nsec); return; cur_time: - *tv = timespec64_to_timespec(current_time(inode)); + *tv = current_time(inode); return; too_early: @@ -242,7 +242,6 @@ adfs_unix2adfs_time(struct inode *inode, unsigned int secs) struct inode * adfs_iget(struct super_block *sb, struct object_info *obj) { - struct timespec ts; struct inode *inode; inode = new_inode(sb); @@ -271,9 +270,7 @@ adfs_iget(struct super_block *sb, struct object_info *obj) ADFS_I(inode)->stamped = ((obj->loadaddr & 0xfff00000) == 0xfff00000); inode->i_mode = adfs_atts2mode(sb, inode); - ts = timespec64_to_timespec(inode->i_mtime); - adfs_adfs2unix_time(&ts, inode); - inode->i_mtime = timespec_to_timespec64(ts); + adfs_adfs2unix_time(&inode->i_mtime, inode); inode->i_atime = inode->i_mtime; inode->i_ctime = inode->i_mtime;