Skip to content

Commit 589b1c9

Browse files
chelsiocudbgdavem330
authored andcommitted
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: a456950 ("cxgb4: time stamping interface for PTP") Signed-off-by: Rahul Lakkireddy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 030c988 commit 589b1c9

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/chelsio/cxgb4

1 file changed

+1
-1
lines changed

drivers/net/ethernet/chelsio/cxgb4/sge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3312,7 +3312,7 @@ static noinline int t4_systim_to_hwstamp(struct adapter *adapter,
33123312

33133313
hwtstamps = skb_hwtstamps(skb);
33143314
memset(hwtstamps, 0, sizeof(*hwtstamps));
3315-
hwtstamps->hwtstamp = ns_to_ktime(be64_to_cpu(*((u64 *)data)));
3315+
hwtstamps->hwtstamp = ns_to_ktime(get_unaligned_be64(data));
33163316

33173317
return RX_PTP_PKT_SUC;
33183318
}

0 commit comments

Comments
 (0)