Re: [PATCH net-next V3 10/23] ptp: e1000e: convert to the 64 bit get/set time methods.

From: Richard Cochran
Date: Tue Mar 31 2015 - 17:48:31 EST


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/