From patchwork Mon Jun 4 09:07:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 137621 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1262798lji; Mon, 4 Jun 2018 02:08:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKuDakxKJY3niBjQPzGR3h8vJNbO7OMOTXW4jfwLgsKpXUEJztiUNEjKefdJkAA0cOdmtbp X-Received: by 2002:a62:c809:: with SMTP id z9-v6mr20264294pff.5.1528103336972; Mon, 04 Jun 2018 02:08:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528103336; cv=none; d=google.com; s=arc-20160816; b=uTxHgsSZ3siTPELJqWKMpZtlL7dvrW+0ivmmr6URnqLJhBe/FWWtFpTdxLJONZ+A2K tnlWqccP9CPR0jkgjc3Vr27xkejC7hXmBHVs+lKZy2l4qDAQUJowtL7//M5AT49yfWXa la299aqVKuvHsWaAL8fA9NZ77E7EJt3de7n5DzwKF9Ocv+DBX3wZkMUYcT55nKu52yJ+ G9MGWFZGZhHcc4guCOPFIG2MgA9P6NkUOPZBOX/BVxURNn3GKxQ6V+AQUjPtFLrPS3kk m0Vk/hFBBkz0o0nTwaKgMZruhcOW819ghlQs2y/p42lyYlYw/YBzWw4RqEgEPH7VXOVX eN3A== 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 :dkim-signature:arc-authentication-results; bh=wUiQgrKCubkGwb2T+X2NPZMolXi115xokwiiqqDC4bo=; b=hfIW86rx09bHU1JZ8LWIUgzLdsapSFrot6CN5r7uzSeIcje90SHoIValGxTK/bM1XU mntlhZgN6iR/jCVuSJ4Qm2p8XiniPjNe+SRtvbAAiLNkQfCM9chvV3wui2wgHbOL56Yy vHjQXUeCiij1nH8e2Hc656vk8bmOxST624uXCjDMFudmXdSPPLFX8kZM1PO7OpvMAPC0 W5lSwccDs40vmQTok7LT4enJIzHbem0pVePxjRI2lIR9z+lpJBo3+dnzw4IY5gp5m0+i RzX+YGwaC5a7h6sgajJNoxD0Grb3R9tsWk+oPKUzVIcq+NIM5O8WM5/I8GJRNuSyLiI0 /JbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FuyF6ih9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m2-v6si46379696pfb.259.2018.06.04.02.08.56; Mon, 04 Jun 2018 02:08:56 -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; dkim=pass header.i=@linaro.org header.s=google header.b=FuyF6ih9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752329AbeFDJIy (ORCPT + 30 others); Mon, 4 Jun 2018 05:08:54 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:41645 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752284AbeFDJIq (ORCPT ); Mon, 4 Jun 2018 05:08:46 -0400 Received: by mail-pl0-f65.google.com with SMTP id az12-v6so19311084plb.8 for ; Mon, 04 Jun 2018 02:08:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=wUiQgrKCubkGwb2T+X2NPZMolXi115xokwiiqqDC4bo=; b=FuyF6ih9R/AHv8+3ubI1R8c82me2o7ISKsoSNMPn7B/itUvgxAygMDxoDXT8YUgkAW xaKWjgVMi+Eh64A7mEsytYiXwPfWITrvtRZpGVpXdh3FgBEH6n9cmZCwxCf/+oUzcrSh lBcPgjkwdyt7D8N9xlWklI6P40EU025gME1PA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=wUiQgrKCubkGwb2T+X2NPZMolXi115xokwiiqqDC4bo=; b=ZCsibirvwwc4zIO4/mGawy6wGfc552bpEmSqN15wleALOeF3fy+wMCLxG3RwE2x7AG 7tmF1TlJkhceSiDMpAzY9HAEmK2Uau5Kw56sYHJUHwl42/B0EyLB7Jc9z9p2/ieX09Bk 1uduTiiOeWgH8Zii+WPvyL9UDEO7xjOdTp6wQKSaX2fG/Kx/9JtqHZl/hzXLYLahOSsm gXW/ogEraf1J4YMxEUJldds/zs4V98O8YQhHVOvC7VpKDEKoZDij4UUf+PSh2cA5g01K NT5ftOjuCGBmhQ7+LhyewThFrvdJAJtC7QRGqA/Op981CAULYvmEMCZgl3/dSYonit51 KQ0Q== X-Gm-Message-State: ALKqPwcKuHTgBVH5TAGwi/2hr4tcbFiuHHdlPsGp9kYV1goilkGJv38F d9G7RrwFQ+Sx6/dxibw0jtd4nQ== X-Received: by 2002:a17:902:3081:: with SMTP id v1-v6mr21548431plb.266.1528103325727; Mon, 04 Jun 2018 02:08:45 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id y8-v6sm36042581pgq.75.2018.06.04.02.08.42 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Jun 2018 02:08:44 -0700 (PDT) From: Baolin Wang To: jic23@kernel.org Cc: baolin.wang@linaro.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, arnd@arndb.de, broonie@kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] iio: Convert to use timespec64 variables to get a time stamp Date: Mon, 4 Jun 2018 17:07:39 +0800 Message-Id: <8ab19b1665b51364c1f7e607f9a69a86fe084d0d.1528102909.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The struct timespec is not y2038 safe on 32bit machines, thus this patch converts to use timespec64 variables and related APIs to get a time stamp for events etc. Signed-off-by: Baolin Wang --- drivers/iio/industrialio-core.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) -- 1.7.9.5 diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index 19bdf3d..8d2b93b 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -207,35 +207,35 @@ static int iio_device_set_clock(struct iio_dev *indio_dev, clockid_t clock_id) */ s64 iio_get_time_ns(const struct iio_dev *indio_dev) { - struct timespec tp; + struct timespec64 tp; switch (iio_device_get_clock(indio_dev)) { case CLOCK_REALTIME: - ktime_get_real_ts(&tp); + ktime_get_real_ts64(&tp); break; case CLOCK_MONOTONIC: - ktime_get_ts(&tp); + ktime_get_ts64(&tp); break; case CLOCK_MONOTONIC_RAW: - getrawmonotonic(&tp); + getrawmonotonic64(&tp); break; case CLOCK_REALTIME_COARSE: - tp = current_kernel_time(); + tp = current_kernel_time64(); break; case CLOCK_MONOTONIC_COARSE: - tp = get_monotonic_coarse(); + tp = get_monotonic_coarse64(); break; case CLOCK_BOOTTIME: - get_monotonic_boottime(&tp); + get_monotonic_boottime64(&tp); break; case CLOCK_TAI: - timekeeping_clocktai(&tp); + timekeeping_clocktai64(&tp); break; default: BUG(); } - return timespec_to_ns(&tp); + return timespec64_to_ns(&tp); } EXPORT_SYMBOL(iio_get_time_ns);