[v2,127/148] net/ice/base: make some switch-related functions static

Message ID 1f7944d01b8e6150230a2df5675126f67d12c346.1718204529.git.anatoly.burakov@intel.com (mailing list archive)
State Superseded
Delegated to: Bruce Richardson
Headers
Series Update net/ice base driver to latest upstream snapshot |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Anatoly Burakov June 12, 2024, 3:02 p.m. UTC
  To better align with upstream release, remove some functions from
switch header and make them static instead.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/ice/base/ice_ptp_hw.c | 14 +++++++-------
 drivers/net/ice/base/ice_ptp_hw.h | 16 ----------------
 2 files changed, 7 insertions(+), 23 deletions(-)
  

Comments

Bruce Richardson June 21, 2024, 2:03 p.m. UTC | #1
On Wed, Jun 12, 2024 at 04:02:01PM +0100, Anatoly Burakov wrote:
> To better align with upstream release, remove some functions from
> switch header and make them static instead.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
Not sure about this, but I wonder if this should be squashed with the
previous patch to have a single patch that adjusts functions to be static
or non-static. If you feel it's better to have one patch move from
non-static to static, and the follow-up move other functions the opposite
direction, that is fine too.

/Bruce
  

Patch

diff --git a/drivers/net/ice/base/ice_ptp_hw.c b/drivers/net/ice/base/ice_ptp_hw.c
index db0622e0fb..bca9e75744 100644
--- a/drivers/net/ice/base/ice_ptp_hw.c
+++ b/drivers/net/ice/base/ice_ptp_hw.c
@@ -3330,7 +3330,7 @@  ice_ptp_read_port_capture_e822(struct ice_hw *hw, u8 port, u64 *tx_ts,
  * Note there is no equivalent of this operation on E810, as that device
  * always handles all external PHYs internally.
  */
-int
+static int
 ice_ptp_write_port_cmd_e822(struct ice_hw *hw, u8 port,
 			    enum ice_ptp_tmr_cmd cmd, bool lock_sbq)
 {
@@ -5093,8 +5093,8 @@  ice_ptp_prep_phy_adj_target_e810(struct ice_hw *hw, u32 target_time)
  * Prepare the external PHYs connected to this device for a timer sync
  * command.
  */
-int ice_ptp_port_cmd_e810(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd,
-			  bool lock_sbq)
+static int ice_ptp_port_cmd_e810(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd,
+				 bool lock_sbq)
 {
 	u32 val = ice_ptp_tmr_cmd_to_port_reg(hw, cmd);
 	int err;
@@ -5501,7 +5501,7 @@  ice_ptp_write_direct_phc_time_e830(struct ice_hw *hw, u64 time)
  * Prepare the external PHYs connected to this device for a timer sync
  * command.
  */
-int
+static int
 ice_ptp_port_cmd_e830(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd,
 		      bool lock_sbq)
 {
@@ -5550,7 +5550,7 @@  ice_read_phy_tstamp_e830(struct ice_hw *hw, u8 lport, u8 idx, u64 *tstamp)
  * @tstamp_ready: contents of the Tx memory status register
  *
  */
-int
+static int
 ice_get_phy_tx_tstamp_ready_e830(struct ice_hw *hw, u8 port, u64 *tstamp_ready)
 {
 	u64 hi;
@@ -5696,8 +5696,8 @@  void ice_ptp_init_phy_model(struct ice_hw *hw)
  * programming only a single port, instead use ice_ptp_one_port_cmd() to
  * ensure non-modified ports get properly initialized to ICE_PTP_NOP.
  */
-int ice_ptp_write_port_cmd(struct ice_hw *hw, u8 port,
-			   enum ice_ptp_tmr_cmd cmd, bool lock_sbq)
+static int ice_ptp_write_port_cmd(struct ice_hw *hw, u8 port,
+				  enum ice_ptp_tmr_cmd cmd, bool lock_sbq)
 {
 	switch (hw->phy_model) {
 	case ICE_PHY_ETH56G:
diff --git a/drivers/net/ice/base/ice_ptp_hw.h b/drivers/net/ice/base/ice_ptp_hw.h
index 8030ebd0c1..90db99327c 100644
--- a/drivers/net/ice/base/ice_ptp_hw.h
+++ b/drivers/net/ice/base/ice_ptp_hw.h
@@ -195,12 +195,6 @@  int
 ice_cfg_cgu_pll_e822(struct ice_hw *hw, enum ice_time_ref_freq *clk_freq,
 		     enum ice_clk_src *clk_src);
 int
-ice_ptp_write_port_cmd_e822(struct ice_hw *hw, u8 port,
-			    enum ice_ptp_tmr_cmd cmd, bool lock_sbq);
-int
-ice_ptp_write_port_cmd(struct ice_hw *hw, u8 port, enum ice_ptp_tmr_cmd cmd,
-		       bool lock_sbq);
-int
 ice_cfg_cgu_pll_e825c(struct ice_hw *hw, enum ice_time_ref_freq *clk_freq,
 		      enum ice_clk_src *clk_src);
 int
@@ -213,16 +207,6 @@  ice_cfg_cgu_bypass_mux_e825c(struct ice_hw *hw, u8 port_num, bool clock_1588,
 			     unsigned int ena);
 int ice_cfg_synce_ethdiv_e825c(struct ice_hw *hw, u8 *divider);
 
-/* E8 Family */
-int
-ice_ptp_port_cmd_e830(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd,
-		      bool lock_sbq);
-int
-ice_ptp_port_cmd_e810(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd,
-		      bool lock_sbq);
-int
-ice_get_phy_tx_tstamp_ready_e830(struct ice_hw *hw, u8 port, u64 *tstamp_ready);
-
 /**
  * ice_e822_time_ref - Get the current TIME_REF from capabilities
  * @hw: pointer to the HW structure