Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0850d5b authored by Ajay Agarwal's avatar Ajay Agarwal
Browse files

net: usbnet: Fix nanosec timestamp print in IPC log



Currently the IPC log statement uses %lu format specifier to
print the nanosec timestamp. Since this value will circularly
loop from 000000000 to 999999999, there might be a case of
incorrect info being dumped onto the IPC log. For example, if the
actual time value is 987.012345678, the IPC log would show
987.12345678 instead.
Fix this by using %09lu format specifier for nanosec timestamp so
as to preserve leading zeros.

Change-Id: I7e962f4a1f7981f48c72d0cc55e41995e9dfb195
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 91aa9b06
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -384,7 +384,7 @@ void usbnet_skb_return (struct usbnet *dev, struct sk_buff *skb)
		return;

	getnstimeofday64(&now);
	dbg_log_string("skb %pK, time %lu.%lu", skb, now.tv_sec, now.tv_nsec);
	dbg_log_string("skb %pK, time %lu.%09lu", skb, now.tv_sec, now.tv_nsec);
	status = netif_rx (skb);
	if (status != NET_RX_SUCCESS)
		netif_dbg(dev, rx_err, dev->net,
@@ -650,7 +650,7 @@ static void rx_complete (struct urb *urb)
	entry->urb = NULL;

	getnstimeofday64(&now);
	dbg_log_string("skb %pK, urb %pK, time %lu.%lu",
	dbg_log_string("skb %pK, urb %pK, time %lu.%09lu",
		       skb, urb, now.tv_sec, now.tv_nsec);
	switch (urb_status) {
	/* success */
@@ -1322,7 +1322,7 @@ static void tx_complete (struct urb *urb)
	struct timespec64 now;

	getnstimeofday64(&now);
	dbg_log_string("skb %pK, urb %pK, time %lu.%lu",
	dbg_log_string("skb %pK, urb %pK, time %lu.%09lu",
		       skb, urb, now.tv_sec, now.tv_nsec);
	if (urb->status == 0) {
		struct pcpu_sw_netstats *stats64 = this_cpu_ptr(dev->stats64);
@@ -1442,7 +1442,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
		skb_tx_timestamp(skb);

	getnstimeofday64(&now);
	dbg_log_string("skb %pK, time %lu.%lu", skb, now.tv_sec, now.tv_nsec);
	dbg_log_string("skb %pK, time %lu.%09lu", skb, now.tv_sec, now.tv_nsec);
	// some devices want funky USB-level framing, for
	// win32 driver (usually) and/or hardware quirks
	if (info->tx_fixup) {