From patchwork Mon Nov 6 14:06:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 118059 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2805228qgn; Mon, 6 Nov 2017 06:07:26 -0800 (PST) X-Google-Smtp-Source: ABhQp+TcqpOkYYVN0IgGPLxBkcfc9OXGj6F/hnNNBX29xKMtzIdgu0nbNEjrVSqwtioMc+9bBMZW X-Received: by 10.101.90.193 with SMTP id d1mr15412377pgt.423.1509977245938; Mon, 06 Nov 2017 06:07:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509977245; cv=none; d=google.com; s=arc-20160816; b=i2gb2OMC1Qdxy1Hb6jcZiHq5cdCdXNVlR3dEcjfcctg3FlionYk3/rQ6MZsDA4YiwB PhjYnm0qOiEIL/4ybQ8Oi/07ErSNQDNtOnVlt7UN46K9eveCCpxwEQpwA5P9bDF/MkGC Fx0Nd1alTtSBkuNO3HIEoZcBDv1FeIJReIvtBnneijcbDcfuShmCOtzASm6aDquunCdL 7boxJn9E6V3ahA65Kw91wM+wA1CsUEWA5SsICFwSuoafM0jYh5SOqAf0EFj3/8pFTYwO 0uGtmvHtTFNSeDEAKRZpO4/HMd5jqCsTqPAHiIYZYHtV8XapIYF2Bg5OXPUp9aawDA2k 6asw== 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=YDfYFqLzprZU8E1jxPD9Q/Q0RCt8Au5TZXBbLUcmYkc=; b=Bs876Y8JfPoCEA9aP1B2IYLG6XDSeov8XsVCizP4g7sIAea2KZzfnPyfhvUtmn04TE HPvVK94UioswfIAyKbS9ccf9E6bpD42nWY2G5WYPloqkrOX7TpAKrAZHwlqlJsFi4+wL opFx9+qKCBgr9/EY6vVltukatxAbYLYnZLKO9wQ3OCPTXTw27oELABZCPyGHD0PoRK41 RqlM2UmSNEBJFH5QCAGJZP6VT9TVYh18whREfh4RdfRviAKf6Jmog+lxvdjSr2ZNZAKT IoH/R1k+Q/uzKQ1CVZfmzLPaS05g6y28YVm2CvKcKBzvsY3RbzyeKNPgvMoESty9MK7Y dM1g== 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 s2si11356771pgp.169.2017.11.06.06.07.25; Mon, 06 Nov 2017 06:07:25 -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; 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 S932337AbdKFOHY (ORCPT + 26 others); Mon, 6 Nov 2017 09:07:24 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:57091 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753325AbdKFOHW (ORCPT ); Mon, 6 Nov 2017 09:07:22 -0500 Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0M3jdZ-1f2qo41qGP-00rFzG; Mon, 06 Nov 2017 15:07:13 +0100 From: Arnd Bergmann To: Mauro Carvalho Chehab Cc: Arnd Bergmann , Hans Verkuil , Arvind Yadav , Sakari Ailus , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: av7110: avoid 2038 overflow in debug print Date: Mon, 6 Nov 2017 15:06:50 +0100 Message-Id: <20171106140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2hYuDGvDGpKwiXjT92k4YTSExpBloXVfQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using the deprecated do_gettimeofday() in print_time() will overflow in 2038 on 32-bit architectures. It'sbetter to use a structure that is safe everywhere. While we're at it, fix the missing leading zeroes on the sub-second portion. Signed-off-by: Arnd Bergmann --- drivers/media/pci/ttpci/av7110.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.9.0 diff --git a/drivers/media/pci/ttpci/av7110.c b/drivers/media/pci/ttpci/av7110.c index f89fb23f6c57..6d415bdeef18 100644 --- a/drivers/media/pci/ttpci/av7110.c +++ b/drivers/media/pci/ttpci/av7110.c @@ -347,9 +347,9 @@ static int DvbDmxFilterCallback(u8 *buffer1, size_t buffer1_len, static inline void print_time(char *s) { #ifdef DEBUG_TIMING - struct timeval tv; - do_gettimeofday(&tv); - printk("%s: %d.%d\n", s, (int)tv.tv_sec, (int)tv.tv_usec); + struct timespec64 ts; + ktime_get_real_ts64(&ts); + printk("%s: %lld.%09ld\n", s, (s64)ts.tv_sec, ts.tv_nsec); #endif }