[PATCH] net: cavium: liquidio: use helpers ns_to_timespec64()

Subsystems: cavium liquidio network driver, networking drivers, the rest

STALE3853d

2 messages, 2 authors, 2016-01-27 · open the first message on its own page

[PATCH] net: cavium: liquidio: use helpers ns_to_timespec64()

From: Kefeng Wang <hidden>
Date: 2016-01-27 09:31:22

Convert the driver to use ns_to_timespec64() to keep consistency
with timespec64_to_ns() instead of open coding the same logic.

Signed-off-by: Kefeng Wang <redacted>
---
 drivers/net/ethernet/cavium/liquidio/lio_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c
index b895044..8727655 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
@@ -1526,7 +1526,6 @@ static int liquidio_ptp_gettime(struct ptp_clock_info *ptp,
 				struct timespec64 *ts)
 {
 	u64 ns;
-	u32 remainder;
 	unsigned long flags;
 	struct lio *lio = container_of(ptp, struct lio, ptp_info);
 	struct octeon_device *oct = (struct octeon_device *)lio->oct_dev;
@@ -1536,8 +1535,7 @@ static int liquidio_ptp_gettime(struct ptp_clock_info *ptp,
 	ns += lio->ptp_adjust;
 	spin_unlock_irqrestore(&lio->ptp_lock, flags);
 
-	ts->tv_sec = div_u64_rem(ns, 1000000000ULL, &remainder);
-	ts->tv_nsec = remainder;
+	*ts = ns_to_timespec64(ns);
 
 	return 0;
 }
-- 
2.6.0.GIT

Re: [PATCH] net: cavium: liquidio: use helpers ns_to_timespec64()

From: David Miller <davem@davemloft.net>
Date: 2016-01-27 22:06:54

From: Kefeng Wang <redacted>
Date: Wed, 27 Jan 2016 17:34:37 +0800
Convert the driver to use ns_to_timespec64() to keep consistency
with timespec64_to_ns() instead of open coding the same logic.

Signed-off-by: Kefeng Wang <redacted>
Applied, thank you.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help