diff mbox series

[net-next] net: ena: Remove deadcode

Message ID 20241102220142.80285-1-linux@treblig.org (mailing list archive)
State Accepted
Commit 6a7d68f72797de9ba8a5129975d42994ae27635d
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: ena: Remove deadcode | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
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: 3 this patch: 3
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 11 of 11 maintainers
netdev/build_clang success Errors and warnings before: 3 this patch: 3
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: 4 this patch: 4
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 75 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
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, 10:01 p.m. UTC
From: "Dr. David Alan Gilbert" <linux@treblig.org>

ena_com_get_dev_basic_stats() has been unused since 2017's
commit d81db2405613 ("net/ena: refactor ena_get_stats64 to be atomic
context safe")

ena_com_get_offload_settings() has been unused since the original
commit of ENA back in 2016 in
commit 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic
Network Adapters (ENA)")

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/net/ethernet/amazon/ena/ena_com.c | 33 -----------------------
 drivers/net/ethernet/amazon/ena/ena_com.h | 18 -------------
 2 files changed, 51 deletions(-)

Comments

Arinzon, David Nov. 3, 2024, 7:10 p.m. UTC | #1
> ena_com_get_dev_basic_stats() has been unused since 2017's commit
> d81db2405613 ("net/ena: refactor ena_get_stats64 to be atomic context
> safe")
> 
> ena_com_get_offload_settings() has been unused since the original commit
> of ENA back in 2016 in commit 1738cd3ed342 ("net: ena: Add a driver for
> Amazon Elastic Network Adapters (ENA)")
> 
> Remove them.
> 
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> ---
>  drivers/net/ethernet/amazon/ena/ena_com.c | 33 -----------------------
> drivers/net/ethernet/amazon/ena/ena_com.h | 18 -------------
>  2 files changed, 51 deletions(-)
> 
> diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c
> b/drivers/net/ethernet/amazon/ena/ena_com.c
> index d958cda9e58b..bc23b8fa7a37 100644
> --- a/drivers/net/ethernet/amazon/ena/ena_com.c
> +++ b/drivers/net/ethernet/amazon/ena/ena_com.c
> @@ -2198,21 +2198,6 @@ int ena_com_get_ena_srd_info(struct
> ena_com_dev *ena_dev,
>         return ret;
>  }
> 
> -int ena_com_get_dev_basic_stats(struct ena_com_dev *ena_dev,
> -                               struct ena_admin_basic_stats *stats)
> -{
> -       struct ena_com_stats_ctx ctx;
> -       int ret;
> -
> -       memset(&ctx, 0x0, sizeof(ctx));
> -       ret = ena_get_dev_stats(ena_dev, &ctx,
> ENA_ADMIN_GET_STATS_TYPE_BASIC);
> -       if (likely(ret == 0))
> -               memcpy(stats, &ctx.get_resp.u.basic_stats,
> -                      sizeof(ctx.get_resp.u.basic_stats));
> -
> -       return ret;
> -}
> -
>  int ena_com_get_customer_metrics(struct ena_com_dev *ena_dev, char
> *buffer, u32 len)  {
>         struct ena_admin_aq_get_stats_cmd *get_cmd; @@ -2289,24 +2274,6
> @@ int ena_com_set_dev_mtu(struct ena_com_dev *ena_dev, u32 mtu)
>         return ret;
>  }
> 
> -int ena_com_get_offload_settings(struct ena_com_dev *ena_dev,
> -                                struct ena_admin_feature_offload_desc *offload)
> -{
> -       int ret;
> -       struct ena_admin_get_feat_resp resp;
> -
> -       ret = ena_com_get_feature(ena_dev, &resp,
> -                                 ENA_ADMIN_STATELESS_OFFLOAD_CONFIG, 0);
> -       if (unlikely(ret)) {
> -               netdev_err(ena_dev->net_device, "Failed to get offload capabilities
> %d\n", ret);
> -               return ret;
> -       }
> -
> -       memcpy(offload, &resp.u.offload, sizeof(resp.u.offload));
> -
> -       return 0;
> -}
> -
>  int ena_com_set_hash_function(struct ena_com_dev *ena_dev)  {
>         struct ena_com_admin_queue *admin_queue = &ena_dev-
> >admin_queue; diff --git a/drivers/net/ethernet/amazon/ena/ena_com.h
> b/drivers/net/ethernet/amazon/ena/ena_com.h
> index a372c5e768a7..20e1529adf3b 100644
> --- a/drivers/net/ethernet/amazon/ena/ena_com.h
> +++ b/drivers/net/ethernet/amazon/ena/ena_com.h
> @@ -591,15 +591,6 @@ int ena_com_set_aenq_config(struct ena_com_dev
> *ena_dev, u32 groups_flag);  int ena_com_get_dev_attr_feat(struct
> ena_com_dev *ena_dev,
>                               struct ena_com_dev_get_features_ctx *get_feat_ctx);
> 
> -/* ena_com_get_dev_basic_stats - Get device basic statistics
> - * @ena_dev: ENA communication layer struct
> - * @stats: stats return value
> - *
> - * @return: 0 on Success and negative value otherwise.
> - */
> -int ena_com_get_dev_basic_stats(struct ena_com_dev *ena_dev,
> -                               struct ena_admin_basic_stats *stats);
> -
>  /* ena_com_get_eni_stats - Get extended network interface statistics
>   * @ena_dev: ENA communication layer struct
>   * @stats: stats return value
> @@ -635,15 +626,6 @@ int ena_com_get_customer_metrics(struct
> ena_com_dev *ena_dev, char *buffer, u32
>   */
>  int ena_com_set_dev_mtu(struct ena_com_dev *ena_dev, u32 mtu);
> 
> -/* ena_com_get_offload_settings - Retrieve the device offloads capabilities
> - * @ena_dev: ENA communication layer struct
> - * @offlad: offload return value
> - *
> - * @return: 0 on Success and negative value otherwise.
> - */
> -int ena_com_get_offload_settings(struct ena_com_dev *ena_dev,
> -                                struct ena_admin_feature_offload_desc *offload);
> -
>  /* ena_com_rss_init - Init RSS
>   * @ena_dev: ENA communication layer struct
>   * @log_size: indirection log size
> --
> 2.47.0

LGTM, thanks for making the effort and removing this from the driver.

Reviewed-by: David Arinzon <darinzon@amazon.com>
patchwork-bot+netdevbpf@kernel.org Nov. 5, 2024, 2:20 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sat,  2 Nov 2024 22:01:42 +0000 you wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> ena_com_get_dev_basic_stats() has been unused since 2017's
> commit d81db2405613 ("net/ena: refactor ena_get_stats64 to be atomic
> context safe")
> 
> ena_com_get_offload_settings() has been unused since the original
> commit of ENA back in 2016 in
> commit 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic
> Network Adapters (ENA)")
> 
> [...]

Here is the summary with links:
  - [net-next] net: ena: Remove deadcode
    https://git.kernel.org/netdev/net-next/c/6a7d68f72797

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c
index d958cda9e58b..bc23b8fa7a37 100644
--- a/drivers/net/ethernet/amazon/ena/ena_com.c
+++ b/drivers/net/ethernet/amazon/ena/ena_com.c
@@ -2198,21 +2198,6 @@  int ena_com_get_ena_srd_info(struct ena_com_dev *ena_dev,
 	return ret;
 }
 
-int ena_com_get_dev_basic_stats(struct ena_com_dev *ena_dev,
-				struct ena_admin_basic_stats *stats)
-{
-	struct ena_com_stats_ctx ctx;
-	int ret;
-
-	memset(&ctx, 0x0, sizeof(ctx));
-	ret = ena_get_dev_stats(ena_dev, &ctx, ENA_ADMIN_GET_STATS_TYPE_BASIC);
-	if (likely(ret == 0))
-		memcpy(stats, &ctx.get_resp.u.basic_stats,
-		       sizeof(ctx.get_resp.u.basic_stats));
-
-	return ret;
-}
-
 int ena_com_get_customer_metrics(struct ena_com_dev *ena_dev, char *buffer, u32 len)
 {
 	struct ena_admin_aq_get_stats_cmd *get_cmd;
@@ -2289,24 +2274,6 @@  int ena_com_set_dev_mtu(struct ena_com_dev *ena_dev, u32 mtu)
 	return ret;
 }
 
-int ena_com_get_offload_settings(struct ena_com_dev *ena_dev,
-				 struct ena_admin_feature_offload_desc *offload)
-{
-	int ret;
-	struct ena_admin_get_feat_resp resp;
-
-	ret = ena_com_get_feature(ena_dev, &resp,
-				  ENA_ADMIN_STATELESS_OFFLOAD_CONFIG, 0);
-	if (unlikely(ret)) {
-		netdev_err(ena_dev->net_device, "Failed to get offload capabilities %d\n", ret);
-		return ret;
-	}
-
-	memcpy(offload, &resp.u.offload, sizeof(resp.u.offload));
-
-	return 0;
-}
-
 int ena_com_set_hash_function(struct ena_com_dev *ena_dev)
 {
 	struct ena_com_admin_queue *admin_queue = &ena_dev->admin_queue;
diff --git a/drivers/net/ethernet/amazon/ena/ena_com.h b/drivers/net/ethernet/amazon/ena/ena_com.h
index a372c5e768a7..20e1529adf3b 100644
--- a/drivers/net/ethernet/amazon/ena/ena_com.h
+++ b/drivers/net/ethernet/amazon/ena/ena_com.h
@@ -591,15 +591,6 @@  int ena_com_set_aenq_config(struct ena_com_dev *ena_dev, u32 groups_flag);
 int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_dev,
 			      struct ena_com_dev_get_features_ctx *get_feat_ctx);
 
-/* ena_com_get_dev_basic_stats - Get device basic statistics
- * @ena_dev: ENA communication layer struct
- * @stats: stats return value
- *
- * @return: 0 on Success and negative value otherwise.
- */
-int ena_com_get_dev_basic_stats(struct ena_com_dev *ena_dev,
-				struct ena_admin_basic_stats *stats);
-
 /* ena_com_get_eni_stats - Get extended network interface statistics
  * @ena_dev: ENA communication layer struct
  * @stats: stats return value
@@ -635,15 +626,6 @@  int ena_com_get_customer_metrics(struct ena_com_dev *ena_dev, char *buffer, u32
  */
 int ena_com_set_dev_mtu(struct ena_com_dev *ena_dev, u32 mtu);
 
-/* ena_com_get_offload_settings - Retrieve the device offloads capabilities
- * @ena_dev: ENA communication layer struct
- * @offlad: offload return value
- *
- * @return: 0 on Success and negative value otherwise.
- */
-int ena_com_get_offload_settings(struct ena_com_dev *ena_dev,
-				 struct ena_admin_feature_offload_desc *offload);
-
 /* ena_com_rss_init - Init RSS
  * @ena_dev: ENA communication layer struct
  * @log_size: indirection log size