diff mbox series

[net-next,4/4] sfc: Remove more unused functions

Message ID 20241102151625.39535-5-linux@treblig.org (mailing list archive)
State Accepted
Commit d3e80070b5b49bb22fef1be22871196f29ee8d31
Delegated to: Netdev Maintainers
Headers show
Series A pile of sfc deadcode | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 4 this patch: 4
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 1 maintainers not CCed: richardcochran@gmail.com
netdev/build_clang success Errors and warnings before: 4 this patch: 4
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 10 this patch: 10
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 91 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 4 this patch: 4
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-11-03--21-00 (tests: 781)

Commit Message

Dr. David Alan Gilbert Nov. 2, 2024, 3:16 p.m. UTC
From: "Dr. David Alan Gilbert" <linux@treblig.org>

efx_ticks_to_usecs(), efx_reconfigure_port(), efx_ptp_get_mode(), and
efx_tx_get_copy_buffer_limited() are unused.
They seem to be partially due to the later splits to Siena, but
some seem unused for longer.

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/net/ethernet/sfc/efx.c        |  8 --------
 drivers/net/ethernet/sfc/efx.h        |  1 -
 drivers/net/ethernet/sfc/efx_common.c | 16 ----------------
 drivers/net/ethernet/sfc/efx_common.h |  1 -
 drivers/net/ethernet/sfc/ptp.c        |  5 -----
 drivers/net/ethernet/sfc/ptp.h        |  1 -
 drivers/net/ethernet/sfc/tx.c         |  8 --------
 drivers/net/ethernet/sfc/tx.h         |  3 ---
 8 files changed, 43 deletions(-)

Comments

Martin Habets Nov. 5, 2024, 9:41 a.m. UTC | #1
On Sat, Nov 02, 2024 at 03:16:25PM +0000, linux@treblig.org wrote:
> 
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> efx_ticks_to_usecs(), efx_reconfigure_port(), efx_ptp_get_mode(), and
> efx_tx_get_copy_buffer_limited() are unused.
> They seem to be partially due to the later splits to Siena, but
> some seem unused for longer.
> 
> Remove them.
> 
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>

Acked-by: Martin Habets <habetsm.xilinx@gmail.com>

> ---
>  drivers/net/ethernet/sfc/efx.c        |  8 --------
>  drivers/net/ethernet/sfc/efx.h        |  1 -
>  drivers/net/ethernet/sfc/efx_common.c | 16 ----------------
>  drivers/net/ethernet/sfc/efx_common.h |  1 -
>  drivers/net/ethernet/sfc/ptp.c        |  5 -----
>  drivers/net/ethernet/sfc/ptp.h        |  1 -
>  drivers/net/ethernet/sfc/tx.c         |  8 --------
>  drivers/net/ethernet/sfc/tx.h         |  3 ---
>  8 files changed, 43 deletions(-)
> 
> diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
> index 36b3b57e2055..0382ac30d1aa 100644
> --- a/drivers/net/ethernet/sfc/efx.c
> +++ b/drivers/net/ethernet/sfc/efx.c
> @@ -417,14 +417,6 @@ unsigned int efx_usecs_to_ticks(struct efx_nic *efx, unsigned int usecs)
>  	return usecs * 1000 / efx->timer_quantum_ns;
>  }
>  
> -unsigned int efx_ticks_to_usecs(struct efx_nic *efx, unsigned int ticks)
> -{
> -	/* We must round up when converting ticks to microseconds
> -	 * because we round down when converting the other way.
> -	 */
> -	return DIV_ROUND_UP(ticks * efx->timer_quantum_ns, 1000);
> -}
> -
>  /* Set interrupt moderation parameters */
>  int efx_init_irq_moderation(struct efx_nic *efx, unsigned int tx_usecs,
>  			    unsigned int rx_usecs, bool rx_adaptive,
> diff --git a/drivers/net/ethernet/sfc/efx.h b/drivers/net/ethernet/sfc/efx.h
> index 7a6cab883d66..45e191686625 100644
> --- a/drivers/net/ethernet/sfc/efx.h
> +++ b/drivers/net/ethernet/sfc/efx.h
> @@ -168,7 +168,6 @@ extern const struct ethtool_ops efx_ethtool_ops;
>  
>  /* Global */
>  unsigned int efx_usecs_to_ticks(struct efx_nic *efx, unsigned int usecs);
> -unsigned int efx_ticks_to_usecs(struct efx_nic *efx, unsigned int ticks);
>  int efx_init_irq_moderation(struct efx_nic *efx, unsigned int tx_usecs,
>  			    unsigned int rx_usecs, bool rx_adaptive,
>  			    bool rx_may_override_tx);
> diff --git a/drivers/net/ethernet/sfc/efx_common.c b/drivers/net/ethernet/sfc/efx_common.c
> index 13cf647051af..c88ec3e24836 100644
> --- a/drivers/net/ethernet/sfc/efx_common.c
> +++ b/drivers/net/ethernet/sfc/efx_common.c
> @@ -635,22 +635,6 @@ int __efx_reconfigure_port(struct efx_nic *efx)
>  	return rc;
>  }
>  
> -/* Reinitialise the MAC to pick up new PHY settings, even if the port is
> - * disabled.
> - */
> -int efx_reconfigure_port(struct efx_nic *efx)
> -{
> -	int rc;
> -
> -	EFX_ASSERT_RESET_SERIALISED(efx);
> -
> -	mutex_lock(&efx->mac_lock);
> -	rc = __efx_reconfigure_port(efx);
> -	mutex_unlock(&efx->mac_lock);
> -
> -	return rc;
> -}
> -
>  /**************************************************************************
>   *
>   * Device reset and suspend
> diff --git a/drivers/net/ethernet/sfc/efx_common.h b/drivers/net/ethernet/sfc/efx_common.h
> index 2c54dac3e662..19a8ca530969 100644
> --- a/drivers/net/ethernet/sfc/efx_common.h
> +++ b/drivers/net/ethernet/sfc/efx_common.h
> @@ -40,7 +40,6 @@ void efx_destroy_reset_workqueue(void);
>  void efx_start_monitor(struct efx_nic *efx);
>  
>  int __efx_reconfigure_port(struct efx_nic *efx);
> -int efx_reconfigure_port(struct efx_nic *efx);
>  
>  #define EFX_ASSERT_RESET_SERIALISED(efx)				\
>  	do {								\
> diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
> index aaacdcfa54ae..36bceeeb6483 100644
> --- a/drivers/net/ethernet/sfc/ptp.c
> +++ b/drivers/net/ethernet/sfc/ptp.c
> @@ -1800,11 +1800,6 @@ int efx_ptp_tx(struct efx_nic *efx, struct sk_buff *skb)
>  	return NETDEV_TX_OK;
>  }
>  
> -int efx_ptp_get_mode(struct efx_nic *efx)
> -{
> -	return efx->ptp_data->mode;
> -}
> -
>  int efx_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
>  			unsigned int new_mode)
>  {
> diff --git a/drivers/net/ethernet/sfc/ptp.h b/drivers/net/ethernet/sfc/ptp.h
> index 6946203499ef..feab7bdd7889 100644
> --- a/drivers/net/ethernet/sfc/ptp.h
> +++ b/drivers/net/ethernet/sfc/ptp.h
> @@ -26,7 +26,6 @@ int efx_ptp_get_ts_config(struct efx_nic *efx,
>  void efx_ptp_get_ts_info(struct efx_nic *efx,
>  			 struct kernel_ethtool_ts_info *ts_info);
>  bool efx_ptp_is_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
> -int efx_ptp_get_mode(struct efx_nic *efx);
>  int efx_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
>  			unsigned int new_mode);
>  int efx_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
> diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c
> index fe2d476028e7..6b4a343a455d 100644
> --- a/drivers/net/ethernet/sfc/tx.c
> +++ b/drivers/net/ethernet/sfc/tx.c
> @@ -49,14 +49,6 @@ static inline u8 *efx_tx_get_copy_buffer(struct efx_tx_queue *tx_queue,
>  	return (u8 *)page_buf->addr + offset;
>  }
>  
> -u8 *efx_tx_get_copy_buffer_limited(struct efx_tx_queue *tx_queue,
> -				   struct efx_tx_buffer *buffer, size_t len)
> -{
> -	if (len > EFX_TX_CB_SIZE)
> -		return NULL;
> -	return efx_tx_get_copy_buffer(tx_queue, buffer);
> -}
> -
>  static void efx_tx_maybe_stop_queue(struct efx_tx_queue *txq1)
>  {
>  	/* We need to consider all queues that the net core sees as one */
> diff --git a/drivers/net/ethernet/sfc/tx.h b/drivers/net/ethernet/sfc/tx.h
> index f2c4d2f89919..f882749af8c3 100644
> --- a/drivers/net/ethernet/sfc/tx.h
> +++ b/drivers/net/ethernet/sfc/tx.h
> @@ -15,9 +15,6 @@
>  unsigned int efx_tx_limit_len(struct efx_tx_queue *tx_queue,
>  			      dma_addr_t dma_addr, unsigned int len);
>  
> -u8 *efx_tx_get_copy_buffer_limited(struct efx_tx_queue *tx_queue,
> -				   struct efx_tx_buffer *buffer, size_t len);
> -
>  /* What TXQ type will satisfy the checksum offloads required for this skb? */
>  static inline unsigned int efx_tx_csum_type_skb(struct sk_buff *skb)
>  {
> -- 
> 2.47.0
>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 36b3b57e2055..0382ac30d1aa 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -417,14 +417,6 @@  unsigned int efx_usecs_to_ticks(struct efx_nic *efx, unsigned int usecs)
 	return usecs * 1000 / efx->timer_quantum_ns;
 }
 
-unsigned int efx_ticks_to_usecs(struct efx_nic *efx, unsigned int ticks)
-{
-	/* We must round up when converting ticks to microseconds
-	 * because we round down when converting the other way.
-	 */
-	return DIV_ROUND_UP(ticks * efx->timer_quantum_ns, 1000);
-}
-
 /* Set interrupt moderation parameters */
 int efx_init_irq_moderation(struct efx_nic *efx, unsigned int tx_usecs,
 			    unsigned int rx_usecs, bool rx_adaptive,
diff --git a/drivers/net/ethernet/sfc/efx.h b/drivers/net/ethernet/sfc/efx.h
index 7a6cab883d66..45e191686625 100644
--- a/drivers/net/ethernet/sfc/efx.h
+++ b/drivers/net/ethernet/sfc/efx.h
@@ -168,7 +168,6 @@  extern const struct ethtool_ops efx_ethtool_ops;
 
 /* Global */
 unsigned int efx_usecs_to_ticks(struct efx_nic *efx, unsigned int usecs);
-unsigned int efx_ticks_to_usecs(struct efx_nic *efx, unsigned int ticks);
 int efx_init_irq_moderation(struct efx_nic *efx, unsigned int tx_usecs,
 			    unsigned int rx_usecs, bool rx_adaptive,
 			    bool rx_may_override_tx);
diff --git a/drivers/net/ethernet/sfc/efx_common.c b/drivers/net/ethernet/sfc/efx_common.c
index 13cf647051af..c88ec3e24836 100644
--- a/drivers/net/ethernet/sfc/efx_common.c
+++ b/drivers/net/ethernet/sfc/efx_common.c
@@ -635,22 +635,6 @@  int __efx_reconfigure_port(struct efx_nic *efx)
 	return rc;
 }
 
-/* Reinitialise the MAC to pick up new PHY settings, even if the port is
- * disabled.
- */
-int efx_reconfigure_port(struct efx_nic *efx)
-{
-	int rc;
-
-	EFX_ASSERT_RESET_SERIALISED(efx);
-
-	mutex_lock(&efx->mac_lock);
-	rc = __efx_reconfigure_port(efx);
-	mutex_unlock(&efx->mac_lock);
-
-	return rc;
-}
-
 /**************************************************************************
  *
  * Device reset and suspend
diff --git a/drivers/net/ethernet/sfc/efx_common.h b/drivers/net/ethernet/sfc/efx_common.h
index 2c54dac3e662..19a8ca530969 100644
--- a/drivers/net/ethernet/sfc/efx_common.h
+++ b/drivers/net/ethernet/sfc/efx_common.h
@@ -40,7 +40,6 @@  void efx_destroy_reset_workqueue(void);
 void efx_start_monitor(struct efx_nic *efx);
 
 int __efx_reconfigure_port(struct efx_nic *efx);
-int efx_reconfigure_port(struct efx_nic *efx);
 
 #define EFX_ASSERT_RESET_SERIALISED(efx)				\
 	do {								\
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index aaacdcfa54ae..36bceeeb6483 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -1800,11 +1800,6 @@  int efx_ptp_tx(struct efx_nic *efx, struct sk_buff *skb)
 	return NETDEV_TX_OK;
 }
 
-int efx_ptp_get_mode(struct efx_nic *efx)
-{
-	return efx->ptp_data->mode;
-}
-
 int efx_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
 			unsigned int new_mode)
 {
diff --git a/drivers/net/ethernet/sfc/ptp.h b/drivers/net/ethernet/sfc/ptp.h
index 6946203499ef..feab7bdd7889 100644
--- a/drivers/net/ethernet/sfc/ptp.h
+++ b/drivers/net/ethernet/sfc/ptp.h
@@ -26,7 +26,6 @@  int efx_ptp_get_ts_config(struct efx_nic *efx,
 void efx_ptp_get_ts_info(struct efx_nic *efx,
 			 struct kernel_ethtool_ts_info *ts_info);
 bool efx_ptp_is_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
-int efx_ptp_get_mode(struct efx_nic *efx);
 int efx_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
 			unsigned int new_mode);
 int efx_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c
index fe2d476028e7..6b4a343a455d 100644
--- a/drivers/net/ethernet/sfc/tx.c
+++ b/drivers/net/ethernet/sfc/tx.c
@@ -49,14 +49,6 @@  static inline u8 *efx_tx_get_copy_buffer(struct efx_tx_queue *tx_queue,
 	return (u8 *)page_buf->addr + offset;
 }
 
-u8 *efx_tx_get_copy_buffer_limited(struct efx_tx_queue *tx_queue,
-				   struct efx_tx_buffer *buffer, size_t len)
-{
-	if (len > EFX_TX_CB_SIZE)
-		return NULL;
-	return efx_tx_get_copy_buffer(tx_queue, buffer);
-}
-
 static void efx_tx_maybe_stop_queue(struct efx_tx_queue *txq1)
 {
 	/* We need to consider all queues that the net core sees as one */
diff --git a/drivers/net/ethernet/sfc/tx.h b/drivers/net/ethernet/sfc/tx.h
index f2c4d2f89919..f882749af8c3 100644
--- a/drivers/net/ethernet/sfc/tx.h
+++ b/drivers/net/ethernet/sfc/tx.h
@@ -15,9 +15,6 @@ 
 unsigned int efx_tx_limit_len(struct efx_tx_queue *tx_queue,
 			      dma_addr_t dma_addr, unsigned int len);
 
-u8 *efx_tx_get_copy_buffer_limited(struct efx_tx_queue *tx_queue,
-				   struct efx_tx_buffer *buffer, size_t len);
-
 /* What TXQ type will satisfy the checksum offloads required for this skb? */
 static inline unsigned int efx_tx_csum_type_skb(struct sk_buff *skb)
 {