summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRahul Lakkireddy <rahul.lakkireddy@chelsio.com>2020-06-23 22:21:33 +0200
committerDavid S. Miller <davem@davemloft.net>2020-06-24 00:18:47 +0200
commit589b1c9c166dce120e27b32a83a78f55464a7ef9 (patch)
treea81392b146aeeae7bec3335f49a393dcc832085e
parentcxgb4: move PTP lock and unlock to caller in Tx path (diff)
downloadlinux-589b1c9c166dce120e27b32a83a78f55464a7ef9.tar.xz
linux-589b1c9c166dce120e27b32a83a78f55464a7ef9.zip
cxgb4: use unaligned conversion for fetching timestamp
Use get_unaligned_be64() to fetch the timestamp needed for ns_to_ktime() conversion. Fixes following sparse warning: sge.c:3282:43: warning: cast to restricted __be64 Fixes: a456950445a0 ("cxgb4: time stamping interface for PTP") Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/sge.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c
index f7b5a2f11001..3c8b4b153ec4 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
@@ -3312,7 +3312,7 @@ static noinline int t4_systim_to_hwstamp(struct adapter *adapter,
hwtstamps = skb_hwtstamps(skb);
memset(hwtstamps, 0, sizeof(*hwtstamps));
- hwtstamps->hwtstamp = ns_to_ktime(be64_to_cpu(*((u64 *)data)));
+ hwtstamps->hwtstamp = ns_to_ktime(get_unaligned_be64(data));
return RX_PTP_PKT_SUC;
}