Message ID | 20220701164007.1243684-3-jiri@resnulli.us (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: devlink: devl_* cosmetic fixes | expand |
On Fri, 1 Jul 2022 18:40:06 +0200 Jiri Pirko wrote: > 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. I think you sent this as / before I replied to all the patches. Still not sure what the basis for the custom is.
Sat, Jul 02, 2022 at 05:10:21AM CEST, kuba@kernel.org wrote: >On Fri, 1 Jul 2022 18:40:06 +0200 Jiri Pirko wrote: >> 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. > >I think you sent this as / before I replied to all the patches. Sorry. >Still not sure what the basis for the custom is. Please see the reply to your comment of this patch in v1. Thanks!
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)