[packages/igb] - timespec64 usage is kernel ver dependent and kcompat.h is not doing the trick

baggins baggins at pld-linux.org
Mon Jun 29 08:22:52 CEST 2015


commit f6d4ede3ec0378bd2600f4db4aaf58995fa4dfb2
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Mon Jun 29 08:22:23 2015 +0200

    - timespec64 usage is kernel ver dependent and kcompat.h is not doing the trick

 timespec64.patch | 49 +++++++++++++++++++++++++++++++++++--------------
 1 file changed, 35 insertions(+), 14 deletions(-)
---
diff --git a/timespec64.patch b/timespec64.patch
index 34cb324..8d211fb 100644
--- a/timespec64.patch
+++ b/timespec64.patch
@@ -1,65 +1,86 @@
 --- igb-5.3.2/src/igb_ptp.c~	2015-05-26 23:59:51.000000000 +0200
 +++ igb-5.3.2/src/igb_ptp.c	2015-06-29 08:05:18.930401431 +0200
-@@ -327,7 +327,7 @@
+@@ -327,7 +327,11 @@
  }
  
  static int igb_ptp_gettime64_82576(struct ptp_clock_info *ptp,
--				 struct timespec *ts64)
++#if ( LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) )
+ 				 struct timespec *ts64)
++#else
 +				 struct timespec64 *ts64)
++#endof
  {
  	struct igb_adapter *igb = container_of(ptp, struct igb_adapter,
  					       ptp_caps);
-@@ -350,7 +350,7 @@
+@@ -350,7 +350,11 @@
  }
  
  static int igb_ptp_gettime64_i210(struct ptp_clock_info *ptp,
--				struct timespec *ts64)
++#if ( LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) )
+ 				struct timespec *ts64)
++#else
 +				struct timespec64 *ts64)
++#endof
  {
  	struct igb_adapter *igb = container_of(ptp, struct igb_adapter,
  					       ptp_caps);
-@@ -369,7 +369,7 @@
+@@ -369,7 +369,11 @@
  
  #ifdef HAVE_PTP_CLOCK_INFO_GETTIME64
  static int igb_ptp_settime64_82576(struct ptp_clock_info *ptp,
--				 const struct timespec *ts64)
++#if ( LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) )
+ 				 const struct timespec *ts64)
++#else
 +				 const struct timespec64 *ts64)
++#endof
  {
  	struct igb_adapter *igb = container_of(ptp, struct igb_adapter,
  					       ptp_caps);
-@@ -392,7 +392,7 @@
+@@ -392,7 +392,11 @@
  
  #endif
  static int igb_ptp_settime64_i210(struct ptp_clock_info *ptp,
--				const struct timespec *ts64)
++#if ( LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) )
+ 				const struct timespec *ts64)
++#else
 +				const struct timespec64 *ts64)
++#endof
  {
  	struct igb_adapter *igb = container_of(ptp, struct igb_adapter,
  					       ptp_caps);
-@@ -522,7 +522,7 @@
+@@ -522,7 +522,11 @@
  {
  	struct igb_adapter *igb =
  		container_of(work, struct igb_adapter, ptp_overflow_work.work);
--	struct timespec ts;
++#if ( LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) )
+ 	struct timespec ts;
++#else
 +	struct timespec64 ts;
++#endof
  
  	igb_ptp_gettime64_82576(&igb->ptp_caps, &ts);
  
-@@ -961,7 +961,7 @@
+@@ -961,7 +961,11 @@
  
  	/* Initialize the clock and overflow work for devices that need it. */
  	if ((hw->mac.type == e1000_i210) || (hw->mac.type == e1000_i211)) {
--		struct timespec ts = ktime_to_timespec(ktime_get_real());
++#if ( LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) )
+ 		struct timespec ts = ktime_to_timespec(ktime_get_real());
++#else
 +		struct timespec64 ts = ktime_to_timespec64(ktime_get_real());
++#endof
  
  		igb_ptp_settime64_i210(&adapter->ptp_caps, &ts);
  	} else {
-@@ -1073,7 +1073,7 @@
+@@ -1073,7 +1073,11 @@
  
  	/* Re-initialize the timer. */
  	if ((hw->mac.type == e1000_i210) || (hw->mac.type == e1000_i211)) {
--		struct timespec ts = ktime_to_timespec(ktime_get_real());
++#if ( LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) )
+ 		struct timespec ts = ktime_to_timespec(ktime_get_real());
++#else
 +		struct timespec64 ts = ktime_to_timespec64(ktime_get_real());
++#endof
  
  		igb_ptp_settime64_i210(&adapter->ptp_caps, &ts);
  	} else {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/igb.git/commitdiff/f6d4ede3ec0378bd2600f4db4aaf58995fa4dfb2



More information about the pld-cvs-commit mailing list