From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
Gal Pressman <gal@nvidia.com>
Subject: [net-next 08/11] net/mlx5e: Add wrapping for auxiliary_driver ops and remove unused args
Date: Wed, 13 Dec 2023 18:08:29 -0800 [thread overview]
Message-ID: <20231214020832.50703-9-saeed@kernel.org> (raw)
In-Reply-To: <20231214020832.50703-1-saeed@kernel.org>
From: Tariq Toukan <tariqt@nvidia.com>
Turn some of the struct auxiliary_driver ops into wrappers to stop
having dummy local vars passed as unused arguments.
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Gal Pressman <gal@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
.../net/ethernet/mellanox/mlx5/core/en_main.c | 22 +++++++++++++------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index ecb40950ec8d..78794268abe7 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5984,7 +5984,7 @@ static int mlx5e_resume(struct auxiliary_device *adev)
return 0;
}
-static int mlx5e_suspend(struct auxiliary_device *adev, pm_message_t state)
+static int _mlx5e_suspend(struct auxiliary_device *adev)
{
struct mlx5e_dev *mlx5e_dev = auxiliary_get_drvdata(adev);
struct mlx5e_priv *priv = mlx5e_dev->priv;
@@ -6002,15 +6002,18 @@ static int mlx5e_suspend(struct auxiliary_device *adev, pm_message_t state)
return 0;
}
-static int mlx5e_probe(struct auxiliary_device *adev,
- const struct auxiliary_device_id *id)
+static int mlx5e_suspend(struct auxiliary_device *adev, pm_message_t state)
+{
+ return _mlx5e_suspend(adev);
+}
+
+static int _mlx5e_probe(struct auxiliary_device *adev)
{
struct mlx5_adev *edev = container_of(adev, struct mlx5_adev, adev);
const struct mlx5e_profile *profile = &mlx5e_nic_profile;
struct mlx5_core_dev *mdev = edev->mdev;
struct mlx5e_dev *mlx5e_dev;
struct net_device *netdev;
- pm_message_t state = {};
struct mlx5e_priv *priv;
int err;
@@ -6065,7 +6068,7 @@ static int mlx5e_probe(struct auxiliary_device *adev,
return 0;
err_resume:
- mlx5e_suspend(adev, state);
+ _mlx5e_suspend(adev);
err_profile_cleanup:
profile->cleanup(priv);
err_destroy_netdev:
@@ -6077,16 +6080,21 @@ static int mlx5e_probe(struct auxiliary_device *adev,
return err;
}
+static int mlx5e_probe(struct auxiliary_device *adev,
+ const struct auxiliary_device_id *id)
+{
+ return _mlx5e_probe(adev);
+}
+
static void mlx5e_remove(struct auxiliary_device *adev)
{
struct mlx5e_dev *mlx5e_dev = auxiliary_get_drvdata(adev);
struct mlx5e_priv *priv = mlx5e_dev->priv;
- pm_message_t state = {};
mlx5_core_uplink_netdev_set(priv->mdev, NULL);
mlx5e_dcbnl_delete_app(priv);
unregister_netdev(priv->netdev);
- mlx5e_suspend(adev, state);
+ _mlx5e_suspend(adev);
priv->profile->cleanup(priv);
mlx5e_destroy_netdev(priv);
mlx5e_devlink_port_unregister(mlx5e_dev);
--
2.43.0
next prev parent reply other threads:[~2023-12-14 2:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-14 2:08 [pull request][net-next 00/11] mlx5 updates 2023-12-13 Saeed Mahameed
2023-12-14 2:08 ` [net-next 01/11] net/mlx5: Add mlx5_ifc bits used for supporting single netdev Socket-Direct Saeed Mahameed
2023-12-14 2:08 ` [net-next 02/11] net/mlx5: Expose Management PCIe Index Register (MPIR) Saeed Mahameed
2023-12-14 2:08 ` [net-next 03/11] net/mlx5: fs, Command to control L2TABLE entry silent mode Saeed Mahameed
2023-12-14 2:08 ` [net-next 04/11] net/mlx5: fs, Command to control TX flow table root Saeed Mahameed
2023-12-14 2:08 ` [net-next 05/11] net/mlx5e: Remove TLS-specific logic in generic create TIS API Saeed Mahameed
2023-12-14 2:08 ` [net-next 06/11] net/mlx5: Move TISes from priv to mdev HW resources Saeed Mahameed
2023-12-14 2:08 ` [net-next 07/11] net/mlx5e: Statify function mlx5e_monitor_counter_arm Saeed Mahameed
2023-12-14 2:08 ` Saeed Mahameed [this message]
2023-12-14 2:08 ` [net-next 09/11] net/mlx5e: Decouple CQ from priv Saeed Mahameed
2023-12-14 2:08 ` [net-next 10/11] net/mlx5: devcom, Add component size getter Saeed Mahameed
2023-12-14 2:08 ` [net-next 11/11] net/mlx5: DR, Use swap() instead of open coding it Saeed Mahameed
2023-12-19 0:03 ` [pull request][net-next 00/11] mlx5 updates 2023-12-13 Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231214020832.50703-9-saeed@kernel.org \
--to=saeed@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.