Commit 5eeb6c3c authored by Igor Russkikh's avatar Igor Russkikh Committed by David S. Miller

net: aquantia: fix warnings on endianness

fixes to remove sparse warnings:
sparse: sparse: cast to restricted __be64

Fixes: 04a18399 ("net: aquantia: implement data PTP datapath")
Reported-by: default avatarkbuild test robot <lkp@intel.com>
Signed-off-by: default avatarIgor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bb1eded1
......@@ -1236,9 +1236,9 @@ static u16 hw_atl_b0_rx_extract_ts(struct aq_hw_s *self, u8 *p,
{
unsigned int offset = 14;
struct ethhdr *eth;
u64 sec;
__be64 sec;
__be32 ns;
u8 *ptr;
u32 ns;
if (len <= offset || !timestamp)
return 0;
......@@ -1256,9 +1256,8 @@ static u16 hw_atl_b0_rx_extract_ts(struct aq_hw_s *self, u8 *p,
ptr += sizeof(sec);
memcpy(&ns, ptr, sizeof(ns));
sec = be64_to_cpu(sec) & 0xffffffffffffllu;
ns = be32_to_cpu(ns);
*timestamp = sec * NSEC_PER_SEC + ns + self->ptp_clk_offset;
*timestamp = (be64_to_cpu(sec) & 0xffffffffffffllu) * NSEC_PER_SEC +
be32_to_cpu(ns) + self->ptp_clk_offset;
eth = (struct ethhdr *)p;
......
......@@ -41,7 +41,7 @@ struct __packed hw_atl_rxd_wb_s {
u16 status;
u16 pkt_len;
u16 next_desc_ptr;
u16 vlan;
__le16 vlan;
};
/* Hardware rx HW TIMESTAMP writeback */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment