From patchwork Sat Mar 21 21:39:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Cochran X-Patchwork-Id: 453054 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 5A8571400DD for ; Sun, 22 Mar 2015 08:44:47 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=cLCbxOgP; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752570AbbCUVoe (ORCPT ); Sat, 21 Mar 2015 17:44:34 -0400 Received: from mail-we0-f173.google.com ([74.125.82.173]:35805 "EHLO mail-we0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751671AbbCUVkX (ORCPT ); Sat, 21 Mar 2015 17:40:23 -0400 Received: by webcq43 with SMTP id cq43so108094579web.2; Sat, 21 Mar 2015 14:40:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oGb6Na2w0CV9xcWve6LcmpwpbS3I6dRRd4gLKGmTYK4=; b=cLCbxOgP5Rbi0OyMIL90RKABPSxjc7WlJ1ScROPBpS69LzGUnEObuifQ6W0w01y8Sk GpPgpp2eq9OVK6blhaVnVjaM0zTNGkSR9DkiDwejKXgmfWuOCY/MNRoDqeKG/y/F1KUP xjZHtlWE4kwLWn9SI+iaN3l2Pk7vQNlrhGsygV5Iy2R4xkGiC44PKf6o5wtx7DKPsyQH 8fpX+BaGgawzpxi96Ye6hvmm98SDb3noeNvzbkU83E1IoSioV2LCAyKtaj69Kl3K6Ied S13aHm11t+QI0D6eAnzwjJDAq+9bZuWedSMrIj+d/j2lUk0bj7AiN20C7X7IoXUlYLeT HFVQ== X-Received: by 10.194.177.195 with SMTP id cs3mr168589102wjc.141.1426974022365; Sat, 21 Mar 2015 14:40:22 -0700 (PDT) Received: from hoboy.home (194-96-185-227.adsl.highway.telekom.at. [194.96.185.227]) by mx.google.com with ESMTPSA id k6sm4047198wia.6.2015.03.21.14.40.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Mar 2015 14:40:21 -0700 (PDT) From: Richard Cochran To: Cc: , Amir Vadai , Ariel Elior , Arnd Bergmann , Baolin Wang , Ben Hutchings , Bruce Allan , Carolyn Wyborny , Chris Metcalf , David Miller , Frank Li , Giuseppe Cavallaro , Jeff Kirsher , John Stultz , Luwei Zhou , Matthew Vick , Michael Chan , Prashant Sreedharan , Shradha Shah , Solarflare linux maintainers , Sonic Zhang , =?UTF-8?q?Stefan=20S=C3=B8rensen?= , Thomas Gleixner , Tom Lendacky Subject: [PATCH net-next V2 15/23] ptp: mlx4: convert to the 64 bit get/set time methods. Date: Sat, 21 Mar 2015 22:39:33 +0100 Message-Id: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This driver's clock is implemented using a timecounter, and so with this patch the driver is ready for the year 2038. Compile tested only. Signed-off-by: Richard Cochran --- drivers/net/ethernet/mellanox/mlx4/en_clock.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/en_clock.c b/drivers/net/ethernet/mellanox/mlx4/en_clock.c index 90b5309..666e7bd 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_clock.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_clock.c @@ -164,7 +164,8 @@ static int mlx4_en_phc_adjtime(struct ptp_clock_info *ptp, s64 delta) * Read the timecounter and return the correct value in ns after converting * it into a struct timespec. **/ -static int mlx4_en_phc_gettime(struct ptp_clock_info *ptp, struct timespec *ts) +static int mlx4_en_phc_gettime(struct ptp_clock_info *ptp, + struct timespec64 *ts) { struct mlx4_en_dev *mdev = container_of(ptp, struct mlx4_en_dev, ptp_clock_info); @@ -191,11 +192,11 @@ static int mlx4_en_phc_gettime(struct ptp_clock_info *ptp, struct timespec *ts) * wall timer value. **/ static int mlx4_en_phc_settime(struct ptp_clock_info *ptp, - const struct timespec *ts) + const struct timespec64 *ts) { struct mlx4_en_dev *mdev = container_of(ptp, struct mlx4_en_dev, ptp_clock_info); - u64 ns = timespec_to_ns(ts); + u64 ns = timespec64_to_ns(ts); unsigned long flags; /* reset the timecounter */ @@ -232,8 +233,8 @@ static const struct ptp_clock_info mlx4_en_ptp_clock_info = { .pps = 0, .adjfreq = mlx4_en_phc_adjfreq, .adjtime = mlx4_en_phc_adjtime, - .gettime = mlx4_en_phc_gettime, - .settime = mlx4_en_phc_settime, + .gettime64 = mlx4_en_phc_gettime, + .settime64 = mlx4_en_phc_settime, .enable = mlx4_en_phc_enable, };