summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Russkikh <Igor.Russkikh@aquantia.com>2019-10-26 14:05:33 +0300
committerDavid S. Miller <davem@davemloft.net>2019-10-26 21:28:40 +0300
commit5eeb6c3cf26eac522df07bee1a58573804179126 (patch)
tree7d15bd1586d0746e68c8e697d16c346d5077bfc3
parentbb1eded18d139c815f39abb77390a7040fb24b04 (diff)
downloadlinux-5eeb6c3cf26eac522df07bee1a58573804179126.tar.xz
net: aquantia: fix warnings on endianness
fixes to remove sparse warnings: sparse: sparse: cast to restricted __be64 Fixes: 04a1839950d9 ("net: aquantia: implement data PTP datapath") Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c9
-rw-r--r--drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h2
2 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
index 51ecf87e0198..abee561ea54e 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
@@ -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;
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
index 37e6b696009d..ee11b107f0a5 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
@@ -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 */