From patchwork Wed Jun 20 14:25:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 139349 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp857526lji; Wed, 20 Jun 2018 07:26:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKPIBYpWk2YS9wNmtpjiEhOFmsY2yk9Q26A70zZua57xsqGrbRN6vAi4tAcusxLUCKOSxY8 X-Received: by 2002:a62:642:: with SMTP id 63-v6mr23260425pfg.222.1529504765374; Wed, 20 Jun 2018 07:26:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529504765; cv=none; d=google.com; s=arc-20160816; b=IXEymxoeCDu1tfMNAGIyeNPJ+t0QnZq4e0cha1hS1ZlL9fk73zf+b9+CRsgk4FW3Oe R0l4aRbL9kPd1gfw0sGM9AUtZF9xSVsr6eIT1YxdaLJKtmdtzdDfMZPQ5zqL8tR51PBb mOIbsQoqBzMW7wzb5Mg090q3RqAat9/dKwWNnOwNRabv6VZx89UjmbjEibNdHGDAJgcl 0X6bIPiHQXqWbdczL3c30k2X5BoNSXKHmi/YZONVAnG1tF0q+A8YDCNsGhqclIN0BA1E UYXdoOmN0sjhbFswEGqhqc1rNjEJ6xdIVOi0S8OCGiWFhdWCQAThj89ppbA+tQWjRh9X kmSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=gINflYBHRXL7qPOxcePJw0r9UYE6djjuRwuTCNOKedg=; b=UOG83QPSJZktgLCZY25CT/hF3kfuy2SBhJf/gD3U5SuaZtSWin8DJRGkLWM9PYLFJB CwO82631v9Ra517unQZ1uwFcX816eGCfRwKb8wtVwQtGJvTVdqE5jil/CQ1snq8zyK/k NP8orf/1Qstsl78wE0DYE2xeNVlXm/uG/r5UzmjnoedQi2PqLZj06AWXjvwJ+OEK6Qr5 dnmRmzdbT8FXGOCdGVxDcoGMnWvTFFysJ0mK5IS6ypthSm7uvu0hkQKNpZYoIgoGqoHd LIOBS5r+vw3baLi4TZYMwYwmzqiUx60Ag8xq/xXvJyXgKrEsYT7VyVi7Z55a8b1W1CuX ay3w== 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 f5-v6si2778400pln.414.2018.06.20.07.26.05; Wed, 20 Jun 2018 07:26:05 -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 S1754168AbeFTO0C (ORCPT + 30 others); Wed, 20 Jun 2018 10:26:02 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:42841 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932153AbeFTO0A (ORCPT ); Wed, 20 Jun 2018 10:26:00 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.129]) with ESMTPA (Nemesis) id 0Lla4p-1g5o1K1gKF-00bO8L; Wed, 20 Jun 2018 16:25:57 +0200 From: Arnd Bergmann To: Andrew Morton Cc: y2038@lists.linaro.org, Al Viro , Jan Kara , Arnd Bergmann , reiserfs-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] [v2] reiserfs: remove obsolete print_time function Date: Wed, 20 Jun 2018 16:25:04 +0200 Message-Id: <20180620142522.27639-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180620142522.27639-1-arnd@arndb.de> References: <20180620142522.27639-1-arnd@arndb.de> X-Provags-ID: V03:K1:XNdbzTUm0j4bJiREs4SG+baP1izgegMxGgbrOBNplV4eiSG81xR RnYfrNZ6VPQKEjgZssURiXMfJzPGRiofkPIUTRvANeFZZ9WwGIbjzzCHrMPs6iEwi1L1O33 +lGRk9hdGnDAr+zvml6R4RSujX9FF04kH5AvlQf0CP1c5oO37PE6UvKINp0axdAundSEdRf dNVmseMyawoWoYjmcrL+Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:A6aV3BrMv6s=:UFBNs0Q9gMo/5pdYFEE279 UOL6v/9N5Ln5BpyOL9jUkrhkMg6YIxFAX14/xF00dqwXLexYgCTDsUENLxkaWBdjOkl+91s7M s+8d/pIvgv71hHW1yTNfv+EQySTR2v25ynAndzfEXjY5+DM0yJwuS9nb/RzEJrkKGF8qt/a4U 0TGjwbyHjp0IR60Fdvu6ajId4LMvixLsTDuDdLJGP8EOKjOXpeLXVHX9eVeUgF1ucdSGDGQdo eFKqAsxcrt/7sLPbV2x8oRW7+59TpSsfKABRUxIQCyMgAT9s2Hgl/aSX/rmfeuACs8A5pzVTg yHwkZz/cO/lCWUKFIokqPHYXLdTMmusnib7RNWO6jrPC/NOy2WkuJHCsoS4sBKzKqafg1j3xY dmbbK/I5uQWpwFzlSVOoqcdzSv2oq5BuFZsuvHf7ZQtZIpXZ4JIkLDRXqy8jjwIlikUSuCxBR RzawwUj6Q54TAy2XkMoCvy7+LFso9Qf1ngImpDC+YGcoYB2AnofPS93DAyqQ66SIzKYfVQwOt UsgP0faxu0tNSVe2xjg+KT1TYNOKQbk5J6N/bCcWS2MfLAbGlKjwP8UR+A0Kj3FVv+SgKQdCF lcHGKV0xlviaKQNrQALVi492DezQwKDdMv87b3L+pXePJbbD4yUqL7cHFIM+qVhSi8J3f/JRo y359Jm0fkBp5ypwoi6xaHnzW1Tv/nfhwIkdrwAgN0HV0sgc6Mwjw0QWcP185QGFuRVKo= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Before linux-2.4.6, print_time() was used to pretty-print an inode time when running reiserfs in user space, after that it has become obsolete and is still a bit incorrect: It behaves differently on 32-bit and 64-bit machines, and uses a static buffer to hold a string, which could lead to undefined behavior if we ever called this from multiple places simultaneously. Since we always want to treat the timestamps as 'unsigned' anyway, simply printing them as an integer is both simpler and safer while avoiding the deprecated time_t type. Signed-off-by: Arnd Bergmann --- v2: after a second look, I decided to remove it instead of fixing it. --- fs/reiserfs/item_ops.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) -- 2.9.0 Reviewed-by: Jan Kara diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c index e3c558d1b78c..3a5a752d96c7 100644 --- a/fs/reiserfs/item_ops.c +++ b/fs/reiserfs/item_ops.c @@ -33,30 +33,22 @@ static int sd_is_left_mergeable(struct reiserfs_key *key, unsigned long bsize) return 0; } -static char *print_time(time_t t) -{ - static char timebuf[256]; - - sprintf(timebuf, "%ld", t); - return timebuf; -} - static void sd_print_item(struct item_head *ih, char *item) { printk("\tmode | size | nlinks | first direct | mtime\n"); if (stat_data_v1(ih)) { struct stat_data_v1 *sd = (struct stat_data_v1 *)item; - printk("\t0%-6o | %6u | %2u | %d | %s\n", sd_v1_mode(sd), + printk("\t0%-6o | %6u | %2u | %d | %u\n", sd_v1_mode(sd), sd_v1_size(sd), sd_v1_nlink(sd), sd_v1_first_direct_byte(sd), - print_time(sd_v1_mtime(sd))); + sd_v1_mtime(sd)); } else { struct stat_data *sd = (struct stat_data *)item; - printk("\t0%-6o | %6llu | %2u | %d | %s\n", sd_v2_mode(sd), + printk("\t0%-6o | %6llu | %2u | %d | %u\n", sd_v2_mode(sd), (unsigned long long)sd_v2_size(sd), sd_v2_nlink(sd), - sd_v2_rdev(sd), print_time(sd_v2_mtime(sd))); + sd_v2_rdev(sd), sd_v2_mtime(sd)); } }