Re: [PATCH net-next V3 10/23] ptp: e1000e: convert to the 64 bit get/set time methods.
From: Richard Cochran <richardcochran@gmail.com>
Date: 2015-03-31 21:48:26
Also in:
lkml
From: Richard Cochran <richardcochran@gmail.com>
Date: 2015-03-31 21:48:26
Also in:
lkml
On Sun, Mar 29, 2015 at 11:12:00PM +0200, Richard Cochran wrote:
@@ -171,11 +171,11 @@ static void e1000e_systim_overflow_work(struct work_struct *work) struct e1000_adapter *adapter = container_of(work, struct e1000_adapter, systim_overflow_work.work); struct e1000_hw *hw = &adapter->hw; - struct timespec ts; + struct timespec64 ts; - adapter->ptp_clock_info.gettime(&adapter->ptp_clock_info, &ts); + adapter->ptp_clock_info.gettime64(&adapter->ptp_clock_info, &ts); - e_dbg("SYSTIM overflow check at %ld.%09lu\n", ts.tv_sec, ts.tv_nsec); + e_dbg("SYSTIM overflow check at %lld.%09lu\n", ts.tv_sec, ts.tv_nsec);
On a 64 bit build, this triggers a new warning. drivers/net/ethernet/intel/e1000e/ptp.c: In function ‘e1000e_systim_overflow_work’: drivers/net/ethernet/intel/e1000e/ptp.c:176:2: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘__kernel_time_t’ [-Wformat] On 32 bit, timespec64.tv_sec is of type 'time64_t' or '__s64'. On 64 bit, timespec64.tv_sec is of type '__kernel_time_t' or '__kernel_long_t' or 'long'. How are we supposed to print that field? With a cast? Thanks, Richard