Re: [PATCH v5 4/5] firmware: imx: add driver for NXP EdgeLock Enclave

From: Markus Elfring
Date: Fri Jul 12 2024 - 14:43:27 EST



> +++ b/drivers/firmware/imx/ele_common.c
> @@ -0,0 +1,264 @@

> +int ele_msg_send(struct se_if_priv *priv, void *tx_msg)
> +{

> + if (header->tag == priv->cmd_tag)
> + lockdep_assert_held(&priv->se_if_cmd_lock);
> +
> + scoped_guard(mutex, &priv->se_if_lock);


I interpret the documentation for this programming interface in the way
that such code may usually be used together with a (compound) statement.
https://elixir.bootlin.com/linux/v6.10-rc7/source/include/linux/cleanup.h#L137

How do you think about to apply a statement like “guard(mutex)(&priv->se_if_lock);” instead?
https://elixir.bootlin.com/linux/v6.10-rc7/source/include/linux/mutex.h#L196

Regards,
Markus