From patchwork Tue Sep 15 12:56:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingbo Wen X-Patchwork-Id: 53640 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by patches.linaro.org (Postfix) with ESMTPS id 0915122A22 for ; Tue, 15 Sep 2015 12:57:18 +0000 (UTC) Received: by lbcao8 with SMTP id ao8sf56814519lbc.1 for ; Tue, 15 Sep 2015 05:57:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=fS/8g7InO+ZSfaiR92VdMc99/EmxJUA66V3lOPunJ0Y=; b=OZDDpu9mRg7bovEl3uZZRJEzqqXMfQ5mEpQVIifS5xhdtQOkYywIm4y4jdFFDLnFIs jiZw97D4JpuekSXsq2+SfNkblLYbBNIe5Bvjfub8kRcVnuIhS9xBgK7rE48MHy7xvoQF C8hRpAncVzLkt+NsXZduDJ0/Z/dehmL2FcFTBHFW6q0DXuGcEQGScCNXx5hJtipB+4CK 6GoOqLcdaS0wf1mmdxe7/mepseV5IFM/c3GfHxvtUF4Uwu+1dpLd3e2eYxkC9Ytg73lK 6L1JkbAOco0u/KgW+6ktDcaeVXm+3VyZ0/1zGr87aMf3tDjAZDmpEZoCjnBFOOGhs8gw MQhw== X-Gm-Message-State: ALoCoQngCXm/wGR3trQgjaBWLaGSGwhSicR+Nx4g1pjoGClMwMwdOxFtgZtJJu7xmchmgM788FMe X-Received: by 10.112.130.41 with SMTP id ob9mr3495627lbb.17.1442321836965; Tue, 15 Sep 2015 05:57:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.161 with SMTP id l1ls300086lal.57.gmail; Tue, 15 Sep 2015 05:57:16 -0700 (PDT) X-Received: by 10.152.26.41 with SMTP id i9mr20745872lag.36.1442321836808; Tue, 15 Sep 2015 05:57:16 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id si11si13421999lac.19.2015.09.15.05.57.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Sep 2015 05:57:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by lagj9 with SMTP id j9so108339335lag.2 for ; Tue, 15 Sep 2015 05:57:16 -0700 (PDT) X-Received: by 10.112.180.230 with SMTP id dr6mr9946848lbc.72.1442321836368; Tue, 15 Sep 2015 05:57:16 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1787320lbq; Tue, 15 Sep 2015 05:57:15 -0700 (PDT) X-Received: by 10.182.65.164 with SMTP id y4mr17069789obs.65.1442321835155; Tue, 15 Sep 2015 05:57:15 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h2si9473853oia.60.2015.09.15.05.57.14; Tue, 15 Sep 2015 05:57:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752311AbbIOM5M (ORCPT + 4 others); Tue, 15 Sep 2015 08:57:12 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:36086 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751531AbbIOM5L (ORCPT ); Tue, 15 Sep 2015 08:57:11 -0400 Received: by padhk3 with SMTP id hk3so176319216pad.3 for ; Tue, 15 Sep 2015 05:57:11 -0700 (PDT) X-Received: by 10.68.193.163 with SMTP id hp3mr46953945pbc.136.1442321831261; Tue, 15 Sep 2015 05:57:11 -0700 (PDT) Received: from localhost.localdomain ([202.130.115.78]) by smtp.gmail.com with ESMTPSA id bt5sm9855948pbd.57.2015.09.15.05.57.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 Sep 2015 05:57:09 -0700 (PDT) From: WEN Pingbo To: linux-usb@vger.kernel.org Cc: WEN Pingbo , Y2038 , linux-kernel@vger.kernel.org, Arnd Bergmann , Felipe Balbi Subject: [PATCH] dummy_hcd: replace timeval with timespec64 Date: Tue, 15 Sep 2015 20:56:15 +0800 Message-Id: <1442321775-32324-1-git-send-email-pingbo.wen@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: pingbo.wen@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The millisecond of the last second will be normal if tv_sec is overflowed. But for y2038 consistency and demonstration purpose, and avoiding further risks, we still need to fix it here, to avoid similair problems. Signed-off-by: Pingbo Wen Cc: Y2038 Cc: linux-kernel@vger.kernel.org Cc: Arnd Bergmann Cc: Felipe Balbi --- drivers/usb/gadget/udc/dummy_hcd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c index 1379ad4..7be721dad 100644 --- a/drivers/usb/gadget/udc/dummy_hcd.c +++ b/drivers/usb/gadget/udc/dummy_hcd.c @@ -833,10 +833,10 @@ static const struct usb_ep_ops dummy_ep_ops = { /* there are both host and device side versions of this call ... */ static int dummy_g_get_frame(struct usb_gadget *_gadget) { - struct timeval tv; + struct timespec64 tv; - do_gettimeofday(&tv); - return tv.tv_usec / 1000; + getnstimeofday64(&tv); + return tv.tv_nsec / 1000000L; } static int dummy_wakeup(struct usb_gadget *_gadget)