diff mbox series

[net-next,5/5] net/mlx5e: Un-expose functions in en.h

Message ID 20240404173357.123307-6-tariqt@nvidia.com (mailing list archive)
State Accepted
Commit 958f56e4838579544fbc5183073518c7c4d22d44
Delegated to: Netdev Maintainers
Headers show
Series mlx5e rc2 misc patches | 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: 943 this patch: 943
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 1 maintainers not CCed: linux-rdma@vger.kernel.org
netdev/build_clang success Errors and warnings before: 953 this patch: 953
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: 954 this patch: 954
netdev/checkpatch warning WARNING: line length of 82 exceeds 80 columns WARNING: line length of 85 exceeds 80 columns WARNING: line length of 90 exceeds 80 columns WARNING: line length of 96 exceeds 80 columns
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 fail net-next-2024-04-05--15-00 (tests: 956)

Commit Message

Tariq Toukan April 4, 2024, 5:33 p.m. UTC
Un-expose functions that are not used outside of their c file.
Make them static.

Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en.h  | 12 ----------
 .../ethernet/mellanox/mlx5/core/en_ethtool.c  | 22 +++++++++----------
 .../net/ethernet/mellanox/mlx5/core/en_main.c |  2 +-
 3 files changed, 12 insertions(+), 24 deletions(-)

Comments

Kalesh Anakkur Purayil April 5, 2024, 5:53 a.m. UTC | #1
On Thu, Apr 4, 2024 at 11:05 PM Tariq Toukan <tariqt@nvidia.com> wrote:
>
> Un-expose functions that are not used outside of their c file.
> Make them static.
>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en.h  | 12 ----------
>  .../ethernet/mellanox/mlx5/core/en_ethtool.c  | 22 +++++++++----------
>  .../net/ethernet/mellanox/mlx5/core/en_main.c |  2 +-
>  3 files changed, 12 insertions(+), 24 deletions(-)

Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
> index f5a3ac40f6e3..2acd1ebb0888 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
> @@ -1143,7 +1143,6 @@ void mlx5e_close_drop_rq(struct mlx5e_rq *drop_rq);
>  int mlx5e_create_tis(struct mlx5_core_dev *mdev, void *in, u32 *tisn);
>  void mlx5e_destroy_tis(struct mlx5_core_dev *mdev, u32 tisn);
>
> -int mlx5e_update_nic_rx(struct mlx5e_priv *priv);
>  void mlx5e_update_carrier(struct mlx5e_priv *priv);
>  int mlx5e_close(struct net_device *netdev);
>  int mlx5e_open(struct net_device *netdev);
> @@ -1180,23 +1179,12 @@ int mlx5e_ethtool_set_coalesce(struct mlx5e_priv *priv,
>                                struct ethtool_coalesce *coal,
>                                struct kernel_ethtool_coalesce *kernel_coal,
>                                struct netlink_ext_ack *extack);
> -int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv,
> -                                    struct ethtool_link_ksettings *link_ksettings);
> -int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,
> -                                    const struct ethtool_link_ksettings *link_ksettings);
> -int mlx5e_get_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh);
> -int mlx5e_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh,
> -                  struct netlink_ext_ack *extack);
>  u32 mlx5e_ethtool_get_rxfh_key_size(struct mlx5e_priv *priv);
>  u32 mlx5e_ethtool_get_rxfh_indir_size(struct mlx5e_priv *priv);
>  int mlx5e_ethtool_get_ts_info(struct mlx5e_priv *priv,
>                               struct ethtool_ts_info *info);
>  int mlx5e_ethtool_flash_device(struct mlx5e_priv *priv,
>                                struct ethtool_flash *flash);
> -void mlx5e_ethtool_get_pauseparam(struct mlx5e_priv *priv,
> -                                 struct ethtool_pauseparam *pauseparam);
> -int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv,
> -                                struct ethtool_pauseparam *pauseparam);
>
>  /* mlx5e generic netdev management API */
>  static inline bool
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
> index 69f6a6aa7c55..93a13a478c11 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
> @@ -996,8 +996,8 @@ static void get_lp_advertising(struct mlx5_core_dev *mdev, u32 eth_proto_lp,
>         ptys2ethtool_adver_link(lp_advertising, eth_proto_lp, ext);
>  }
>
> -int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv,
> -                                    struct ethtool_link_ksettings *link_ksettings)
> +static int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv,
> +                                           struct ethtool_link_ksettings *link_ksettings)
>  {
>         struct mlx5_core_dev *mdev = priv->mdev;
>         u32 out[MLX5_ST_SZ_DW(ptys_reg)] = {};
> @@ -1167,8 +1167,8 @@ static bool ext_requested(u8 autoneg, const unsigned long *adver, bool ext_suppo
>         return  autoneg == AUTONEG_ENABLE ? ext_link_mode : ext_supported;
>  }
>
> -int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,
> -                                    const struct ethtool_link_ksettings *link_ksettings)
> +static int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,
> +                                           const struct ethtool_link_ksettings *link_ksettings)
>  {
>         struct mlx5_core_dev *mdev = priv->mdev;
>         struct mlx5_port_eth_proto eproto;
> @@ -1268,7 +1268,7 @@ static u32 mlx5e_get_rxfh_indir_size(struct net_device *netdev)
>         return mlx5e_ethtool_get_rxfh_indir_size(priv);
>  }
>
> -int mlx5e_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh)
> +static int mlx5e_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh)
>  {
>         struct mlx5e_priv *priv = netdev_priv(netdev);
>         u32 rss_context = rxfh->rss_context;
> @@ -1281,8 +1281,8 @@ int mlx5e_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh)
>         return err;
>  }
>
> -int mlx5e_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh,
> -                  struct netlink_ext_ack *extack)
> +static int mlx5e_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh,
> +                         struct netlink_ext_ack *extack)
>  {
>         struct mlx5e_priv *priv = netdev_priv(dev);
>         u32 *rss_context = &rxfh->rss_context;
> @@ -1411,8 +1411,8 @@ static void mlx5e_get_pause_stats(struct net_device *netdev,
>         mlx5e_stats_pause_get(priv, pause_stats);
>  }
>
> -void mlx5e_ethtool_get_pauseparam(struct mlx5e_priv *priv,
> -                                 struct ethtool_pauseparam *pauseparam)
> +static void mlx5e_ethtool_get_pauseparam(struct mlx5e_priv *priv,
> +                                        struct ethtool_pauseparam *pauseparam)
>  {
>         struct mlx5_core_dev *mdev = priv->mdev;
>         int err;
> @@ -1433,8 +1433,8 @@ static void mlx5e_get_pauseparam(struct net_device *netdev,
>         mlx5e_ethtool_get_pauseparam(priv, pauseparam);
>  }
>
> -int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv,
> -                                struct ethtool_pauseparam *pauseparam)
> +static int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv,
> +                                       struct ethtool_pauseparam *pauseparam)
>  {
>         struct mlx5_core_dev *mdev = priv->mdev;
>         int err;
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> index 81e1c1e401f9..a0d3af96dcb1 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> @@ -5562,7 +5562,7 @@ static void mlx5e_nic_disable(struct mlx5e_priv *priv)
>         mlx5e_ipsec_cleanup(priv);
>  }
>
> -int mlx5e_update_nic_rx(struct mlx5e_priv *priv)
> +static int mlx5e_update_nic_rx(struct mlx5e_priv *priv)
>  {
>         return mlx5e_refresh_tirs(priv, false, false);
>  }
> --
> 2.44.0
>
>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index f5a3ac40f6e3..2acd1ebb0888 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -1143,7 +1143,6 @@  void mlx5e_close_drop_rq(struct mlx5e_rq *drop_rq);
 int mlx5e_create_tis(struct mlx5_core_dev *mdev, void *in, u32 *tisn);
 void mlx5e_destroy_tis(struct mlx5_core_dev *mdev, u32 tisn);
 
-int mlx5e_update_nic_rx(struct mlx5e_priv *priv);
 void mlx5e_update_carrier(struct mlx5e_priv *priv);
 int mlx5e_close(struct net_device *netdev);
 int mlx5e_open(struct net_device *netdev);
@@ -1180,23 +1179,12 @@  int mlx5e_ethtool_set_coalesce(struct mlx5e_priv *priv,
 			       struct ethtool_coalesce *coal,
 			       struct kernel_ethtool_coalesce *kernel_coal,
 			       struct netlink_ext_ack *extack);
-int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv,
-				     struct ethtool_link_ksettings *link_ksettings);
-int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,
-				     const struct ethtool_link_ksettings *link_ksettings);
-int mlx5e_get_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh);
-int mlx5e_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh,
-		   struct netlink_ext_ack *extack);
 u32 mlx5e_ethtool_get_rxfh_key_size(struct mlx5e_priv *priv);
 u32 mlx5e_ethtool_get_rxfh_indir_size(struct mlx5e_priv *priv);
 int mlx5e_ethtool_get_ts_info(struct mlx5e_priv *priv,
 			      struct ethtool_ts_info *info);
 int mlx5e_ethtool_flash_device(struct mlx5e_priv *priv,
 			       struct ethtool_flash *flash);
-void mlx5e_ethtool_get_pauseparam(struct mlx5e_priv *priv,
-				  struct ethtool_pauseparam *pauseparam);
-int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv,
-				 struct ethtool_pauseparam *pauseparam);
 
 /* mlx5e generic netdev management API */
 static inline bool
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
index 69f6a6aa7c55..93a13a478c11 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -996,8 +996,8 @@  static void get_lp_advertising(struct mlx5_core_dev *mdev, u32 eth_proto_lp,
 	ptys2ethtool_adver_link(lp_advertising, eth_proto_lp, ext);
 }
 
-int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv,
-				     struct ethtool_link_ksettings *link_ksettings)
+static int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv,
+					    struct ethtool_link_ksettings *link_ksettings)
 {
 	struct mlx5_core_dev *mdev = priv->mdev;
 	u32 out[MLX5_ST_SZ_DW(ptys_reg)] = {};
@@ -1167,8 +1167,8 @@  static bool ext_requested(u8 autoneg, const unsigned long *adver, bool ext_suppo
 	return  autoneg == AUTONEG_ENABLE ? ext_link_mode : ext_supported;
 }
 
-int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,
-				     const struct ethtool_link_ksettings *link_ksettings)
+static int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,
+					    const struct ethtool_link_ksettings *link_ksettings)
 {
 	struct mlx5_core_dev *mdev = priv->mdev;
 	struct mlx5_port_eth_proto eproto;
@@ -1268,7 +1268,7 @@  static u32 mlx5e_get_rxfh_indir_size(struct net_device *netdev)
 	return mlx5e_ethtool_get_rxfh_indir_size(priv);
 }
 
-int mlx5e_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh)
+static int mlx5e_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh)
 {
 	struct mlx5e_priv *priv = netdev_priv(netdev);
 	u32 rss_context = rxfh->rss_context;
@@ -1281,8 +1281,8 @@  int mlx5e_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh)
 	return err;
 }
 
-int mlx5e_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh,
-		   struct netlink_ext_ack *extack)
+static int mlx5e_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh,
+			  struct netlink_ext_ack *extack)
 {
 	struct mlx5e_priv *priv = netdev_priv(dev);
 	u32 *rss_context = &rxfh->rss_context;
@@ -1411,8 +1411,8 @@  static void mlx5e_get_pause_stats(struct net_device *netdev,
 	mlx5e_stats_pause_get(priv, pause_stats);
 }
 
-void mlx5e_ethtool_get_pauseparam(struct mlx5e_priv *priv,
-				  struct ethtool_pauseparam *pauseparam)
+static void mlx5e_ethtool_get_pauseparam(struct mlx5e_priv *priv,
+					 struct ethtool_pauseparam *pauseparam)
 {
 	struct mlx5_core_dev *mdev = priv->mdev;
 	int err;
@@ -1433,8 +1433,8 @@  static void mlx5e_get_pauseparam(struct net_device *netdev,
 	mlx5e_ethtool_get_pauseparam(priv, pauseparam);
 }
 
-int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv,
-				 struct ethtool_pauseparam *pauseparam)
+static int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv,
+					struct ethtool_pauseparam *pauseparam)
 {
 	struct mlx5_core_dev *mdev = priv->mdev;
 	int err;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 81e1c1e401f9..a0d3af96dcb1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5562,7 +5562,7 @@  static void mlx5e_nic_disable(struct mlx5e_priv *priv)
 	mlx5e_ipsec_cleanup(priv);
 }
 
-int mlx5e_update_nic_rx(struct mlx5e_priv *priv)
+static int mlx5e_update_nic_rx(struct mlx5e_priv *priv)
 {
 	return mlx5e_refresh_tirs(priv, false, false);
 }