From patchwork Sat Oct 24 04:00:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingbo Wen X-Patchwork-Id: 55512 Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp26093lbq; Fri, 23 Oct 2015 21:01:27 -0700 (PDT) X-Received: by 10.69.2.164 with SMTP id bp4mr8923074pbd.109.1445659287720; Fri, 23 Oct 2015 21:01:27 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id od8si34579473pbb.102.2015.10.23.21.01.27 for ; Fri, 23 Oct 2015 21:01:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-input-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-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750818AbbJXEAn (ORCPT ); Sat, 24 Oct 2015 00:00:43 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:32977 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750713AbbJXEAm (ORCPT ); Sat, 24 Oct 2015 00:00:42 -0400 Received: by pabrc13 with SMTP id rc13so134309083pab.0 for ; Fri, 23 Oct 2015 21:00:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OA7mZXnY1G3KI21pF717FyIydcClEbpWPSshQvCfbMc=; b=TMIVUdtNFR9vaSsfbjTNgi+5JcIH85Qz3mnPmck1vrVIjrRiFWTsmSCm0Uklhc/6oL guE26NxFK3NomZvjTwW3YGE+iPR872mybntWd4QwH3bH9ClXinqhrr9tUAJgVnNPj+rY j4hXNsvCUlEqDoyITpNKBQv7fno3Kk9DRtiPZZk9VpWiJ0KDg9MgzyMxWIB/DC3tjGev +9Wqoxvwo3aY1IQcv85Bavn+2ILXboukUP95WL23l6Z2wHQEYYOeCYPiNmu40WCjoA1C 0QHvKXjEDhJL/oJhM4xn4JYQOpa5IsfrnWAIl6W+wI8473bbIopO2ODf/MfvV+0Tq8xS X0zg== X-Gm-Message-State: ALoCoQnBb6UKeT/QOgTf2A5cAzNYrMqbeBR7pTOv3qg5d05coWrLXH1zevbtJ55WA0bM7UL80uEd X-Received: by 10.68.132.166 with SMTP id ov6mr9072085pbb.124.1445659241843; Fri, 23 Oct 2015 21:00:41 -0700 (PDT) Received: from localhost.localdomain (edge03.meizu.com. [202.130.115.78]) by smtp.gmail.com with ESMTPSA id fb1sm21636320pab.9.2015.10.23.21.00.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 Oct 2015 21:00:41 -0700 (PDT) From: WEN Pingbo To: arnd@arndb.de Cc: y2038@lists.linaro.org, dmitry.torokhov@gmail.com, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, WEN Pingbo Subject: [PATCH V3 1/2] hil_mlc: convert timeval to time64_t Date: Sat, 24 Oct 2015 12:00:18 +0800 Message-Id: <1445659219-23135-1-git-send-email-pingbo.wen@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <5201254.PnVcGHTDmH@wuerfel> References: <5201254.PnVcGHTDmH@wuerfel> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Since mlc->lcv_t is only interested in seconds, directly using time64_t here Signed-off-by: WEN Pingbo --- Version 2: Convert timeval to ktime_t Version 3: Convert it to time64_t, since it's a better choice drivers/input/serio/hil_mlc.c | 8 +++----- include/linux/hil_mlc.h | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/input/serio/hil_mlc.c b/drivers/input/serio/hil_mlc.c index 65605e4..fb297aa 100644 --- a/drivers/input/serio/hil_mlc.c +++ b/drivers/input/serio/hil_mlc.c @@ -274,14 +274,12 @@ static int hilse_match(hil_mlc *mlc, int unused) /* An LCV used to prevent runaway loops, forces 5 second sleep when reset. */ static int hilse_init_lcv(hil_mlc *mlc, int unused) { - struct timeval tv; + time64_t now = ktime_get_seconds(); - do_gettimeofday(&tv); - - if (mlc->lcv && (tv.tv_sec - mlc->lcv_tv.tv_sec) < 5) + if (mlc->lcv && (now - mlc->lcv_t) < 5) return -1; - mlc->lcv_tv = tv; + mlc->lcv_t = now; mlc->lcv = 0; return 0; diff --git a/include/linux/hil_mlc.h b/include/linux/hil_mlc.h index 394a840..29bb5e3 100644 --- a/include/linux/hil_mlc.h +++ b/include/linux/hil_mlc.h @@ -149,7 +149,7 @@ struct hil_mlc { int ddi; /* Last operational device id */ int lcv; /* LCV to throttle loops */ - struct timeval lcv_tv; /* Time loop was started */ + time64_t lcv_t; /* Time loop was started */ int di_map[7]; /* Maps below items to live devs */ struct hil_mlc_devinfo di[HIL_MLC_DEVMEM];