net: aquantia: ptp followup fixes
Subsystems (4)
cover net: aquantia: ptp followup fixes
Hello David,
Here are two sparse warnings, third patch is a fix for scaled_ppm_to_ppb missing. Eventually I reworked this to exclude ptp module from build. Please consider it instead of this patch: https://patchwork.ozlabs.org/patch/1184171/
Igor Russkikh (3):
net: aquantia: fix var initialization warning
net: aquantia: fix warnings on endianness
net: aquantia: disable ptp object build if no config
.../net/ethernet/aquantia/atlantic/Makefile | 3 +- .../net/ethernet/aquantia/atlantic/aq_ptp.c | 2 +- .../net/ethernet/aquantia/atlantic/aq_ptp.h | 84 +++++++++++++++++++ .../aquantia/atlantic/hw_atl/hw_atl_b0.c | 9 +- .../aquantia/atlantic/hw_atl/hw_atl_utils.h | 2 +- 5 files changed, 92 insertions(+), 8 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/3 net: aquantia: fix var initialization warning
found by sparse, simply useless local initialization with zero.
--- drivers/net/ethernet/aquantia/atlantic/aq_ptp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/aquantia/atlantic/aq_ptp.c +1 -1
@@ -947,7 +947,7 @@ int aq_ptp_ring_alloc(struct aq_nic_s *aq_nic) {struct aq_ptp_s *aq_ptp = aq_nic->aq_ptp;unsigned int tx_ring_idx, rx_ring_idx; -struct aq_ring_s *hwts =0 ; +struct aq_ring_s *hwts;u32 tx_tc_mode, rx_tc_mode;struct aq_ring_s *ring;int err;
Signature · 1 line
2.17.1
PATCH 2/3 net: aquantia: fix warnings on endianness
In reply to Igor Russkikhfixes to remove sparse warnings:
sparse: sparse: cast to restricted __be64
--- .../net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 9 ++++----- .../net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-)
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c +4 -5
@@ -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;
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h +1 -1
@@ -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 */
Signature · 1 line
2.17.1
PATCH 3/3 net: aquantia: disable ptp object build if no config
In reply to Igor RusskikhWe do disable aq_ptp module build using inline
stubs when CONFIG_PTP_1588_CLOCK is not declared.
This reduces module size and removes unnecessary code.
--- .../net/ethernet/aquantia/atlantic/Makefile | 3 +- .../net/ethernet/aquantia/atlantic/aq_ptp.h | 84 +++++++++++++++++++ 2 files changed, 86 insertions(+), 1 deletion(-)
drivers/net/ethernet/aquantia/atlantic/Makefile +2 -1
@@ -24,10 +24,11 @@ atlantic-objs := aq_main.o \ aq_ethtool.o \ aq_drvinfo.o \ aq_filters.o \ - aq_ptp.o \ aq_phy.o \ hw_atl/hw_atl_a0.o \ hw_atl/hw_atl_b0.o \ hw_atl/hw_atl_utils.o \ hw_atl/hw_atl_utils_fw2x.o \ hw_atl/hw_atl_llh.o + +atlantic-$(CONFIG_PTP_1588_CLOCK) += aq_ptp.o
drivers/net/ethernet/aquantia/atlantic/aq_ptp.h +84 -0
94 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [PATCH net-next 3/3] net: aquantia: disable ptp object build if no config
Quoted 7 lines · Igor Russkikh
We do disable
aq_ptpmodule build using inline
stubs whenCONFIG_PTP_1588_CLOCKis not declared.This reduces module size and removes unnecessary code.
Reported-by YueHaibing <[email protected]>Signed-off-by Igor Russkikh <[email protected]>
David Miller
maintainerFrom: Igor Russkikh <[email protected]>
Date: Sat, 26 Oct 2019 11:05:30 +0000
Quoted 4 lines
Here are two sparse warnings, third patch is a fix for
scaled_ppm_to_ppbmissing. Eventually I reworked this to exclude ptp module from build. Please consider it instead of this patch: https://patchwork.ozlabs.org/patch/1184171/
Series applied, thanks Igor.