]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
net: ethernet: ti: cpts: Fix timestamp print
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 21 May 2018 18:45:52 +0000 (11:45 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 May 2018 20:17:10 +0000 (16:17 -0400)
On 64-bit hosts we will get the following warning:

drivers/net/ethernet/ti/cpts.c: In function 'cpts_overflow_check':
drivers/net/ethernet/ti/cpts.c:297:11: warning: format '%lld' expects
argument of type 'long long int', but argument 3 has type
'__kernel_time_t {aka long int}' [-Wformat=]
  pr_debug("cpts overflow check at %lld.%09lu\n", ts.tv_sec,
ts.tv_nsec);

Fix this by using an appropriate casting that works on all bit sizes.

Fixes: a5c79c26e168 ("ptp: cpts: convert to the 64 bit get/set time methods.")
Fixes: 87c0e764d43a ("cpts: introduce time stamping code and a PTP hardware clock.")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpts.c

index 7842f094f2ef32f72190e2274a0e6c1e174b5fe4..6f63c8729afca1cf4e621bd1b18763850f33ffd3 100644 (file)
@@ -294,7 +294,8 @@ static long cpts_overflow_check(struct ptp_clock_info *ptp)
                delay = CPTS_SKB_TX_WORK_TIMEOUT;
        spin_unlock_irqrestore(&cpts->lock, flags);
 
-       pr_debug("cpts overflow check at %lld.%09lu\n", ts.tv_sec, ts.tv_nsec);
+       pr_debug("cpts overflow check at %lld.%09ld\n",
+                (long long)ts.tv_sec, ts.tv_nsec);
        return (long)delay;
 }