[patch net-next 2/3] net: devlink: call lockdep_assert_held() for devlink->lock directly

Jiri Pirko
2022-07-01T09:59:38Z

From: Jiri Pirko <jiri@nvidia.com>

In devlink.c there is direct access to whole struct devlink so there is
no need to use helper. So obey the customs and work with lock directly
avoiding helpers which might obfuscate things a bit.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
---
net/core/devlink.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/core/devlink.c b/net/core/devlink.c
index 25b481dd1709..a7477addbd59 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -10185,7 +10185,7 @@ int devl_rate_leaf_create(struct devlink_port *devlink_port, void *priv)
struct devlink *devlink = devlink_port->devlink;
struct devlink_rate *devlink_rate;

- devl_assert_locked(devlink_port->devlink);
+ lockdep_assert_held(&devlink_port->devlink->lock);

if (WARN_ON(devlink_port->devlink_rate))
return -EBUSY;
@@ -10224,7 +10224,7 @@ void devl_rate_leaf_destroy(struct devlink_port *devlink_port)
{
struct devlink_rate *devlink_rate = devlink_port->devlink_rate;

- devl_assert_locked(devlink_port->devlink);
+ lockdep_assert_held(&devlink_port->devlink->lock);
if (!devlink_rate)
return;

@@ -10270,7 +10270,7 @@ void devl_rate_nodes_destroy(struct devlink *devlink)
static struct devlink_rate *devlink_rate, *tmp;
const struct devlink_ops *ops = devlink->ops;

- devl_assert_locked(devlink);
+ lockdep_assert_held(&devlink->lock);

list_for_each_entry(devlink_rate, &devlink->rate_list, list) {
if (!devlink_rate->parent)
--
2.35.3