lkml.org 
[lkml]   [2015]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next V3 10/23] ptp: e1000e: convert to the 64 bit get/set time methods.
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



\
 
 \ /
  Last update: 2015-04-01 00:21    [W:0.145 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site