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: 10043543 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A0508602BF for ; Mon, 6 Nov 2017 14:07:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BEDB29CB1 for ; Mon, 6 Nov 2017 14:07:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F11929CB6; Mon, 6 Nov 2017 14:07:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5887C29CB1 for ; Mon, 6 Nov 2017 14:07:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932115AbdKFOHY (ORCPT ); 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: <20171106140710.1619486-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:V56tmZSDQMjR3B4B/zeKzEVACHaEgewTbEnX0cwEKmpV3/NB+4H PDpU3DTE6u6SgqPNPCCJN90gJC77aqtMWzU3znJKln/d897+0jpel9H+8XL5qLHaPaiytyo eW1JCwVJlmPDS5fQV9rZ+8WWp1Nvnu6GqHiTZHo5ggaVRaVd81KmcEZb2fz4f20IoExKvST fmqhEGKnT4zLJCzLD/QAA== X-UI-Out-Filterresults: notjunk:1; V01:K0:TXwYPXxa8b0=:Z4DOWY7zCpBnDAWf2ZCD0P etKVDxIrLE0yeEyNmgsEkL9RpoBKajI8Rcn4UM0rlMH08ztiXPZy1dV4DsXTOefQNTCcLYvvh ackTd5Jt3AyTftc+33HPuSVDX7hGsJsHSzUd2comQGZblvd1/eROib6477/zxzykI20966RS5 xQZpP7mk8h997KIWvFO4h3P2cQbm4xu3uFYCh7/ZjJ2FzSX9Z1sZ9ymmT5ha1+CYomTnH9hMP gBgOlWCcd21EJcwqDC9/ERDI7qAPv/p/ivcOF629Ax27Nxtm0n/MQmVYO7cjVY3UcFhHkuxlf uIH+jnfqU1+hgDitMJxnxEd9+VBDaNyUuIYa83b4arcqFuNiA+3ypkAj4SHBwVoNbDEi2DL8G VDJ/XxR5MTE13lQwFKRhReqEZxRd1JWiJgKq8fKcpQc/ge88y2NyQ7V0kOuK61UkuqJO2bIFw dGlBdEXZ+DQ4+GY9u8xx8x5yh1LBoIPa48Bz9IBSKg5m0GINfwA+24rNhGuzTbXIVl9UMhmMb QoGfRRTK6arUk4329aiBcH71ZK2+bnhF+gxtKZJSuEUsNcKONgYGXNIQP3nUiRPfNpIz//93C nOBM6xee5NyT0EjSSbtxIS1n7y0Yj34Pu2o7XiX2bSg5zKY+AbaiHULwP/K0biFtA790gvqgB a0bJGQpj1pnF+Bg0Xg4tSf7ZMigXNBVTTQ3edzIkSN7pNRoyr6Ih+un4AXYOqdcvd0XX8RET+ bnBtn2hYuDGvDGpKwiXjT92k4YTSExpBloXVfQ== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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 }