From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753743AbbCaVIs (ORCPT ); Tue, 31 Mar 2015 17:08:48 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:38050 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753888AbbCaVIh (ORCPT ); Tue, 31 Mar 2015 17:08:37 -0400 From: Richard Cochran To: Cc: , Amir Vadai , Arnd Bergmann , Baolin Wang , David Miller , Frank Li , Giuseppe Cavallaro , Jacob Keller , Jeff Kirsher , John Stultz , Luwei Zhou , Matthew Vick , Michael Chan , Prashant Sreedharan , Rayagond K , Sonic Zhang , Sony Chacko , Thomas Gleixner Subject: [PATCH net-next 06/11] ptp: e1000e: use helpers for converting ns to timespec. Date: Tue, 31 Mar 2015 23:08:11 +0200 Message-Id: <051364a3a57d36200f652f4d8e1c9bfc4edf3254.1427835485.git.richardcochran@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch changes the driver to use ns_to_timespec64() instead of open coding the same logic. Compile tested only. Signed-off-by: Richard Cochran --- drivers/net/ethernet/intel/e1000e/ptp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000e/ptp.c b/drivers/net/ethernet/intel/e1000e/ptp.c index b747a3e..d2272ad 100644 --- a/drivers/net/ethernet/intel/e1000e/ptp.c +++ b/drivers/net/ethernet/intel/e1000e/ptp.c @@ -111,15 +111,13 @@ static int e1000e_phc_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts) struct e1000_adapter *adapter = container_of(ptp, struct e1000_adapter, ptp_clock_info); unsigned long flags; - u32 remainder; u64 ns; spin_lock_irqsave(&adapter->systim_lock, flags); ns = timecounter_read(&adapter->tc); spin_unlock_irqrestore(&adapter->systim_lock, flags); - ts->tv_sec = div_u64_rem(ns, NSEC_PER_SEC, &remainder); - ts->tv_nsec = remainder; + *ts = ns_to_timespec64(ns); return 0; } -- 1.7.10.4