Re: [PATCH v2] staging: nvec: use guard(mutex) in nvec_write_sync()

From: Jeremy Clifton

Date: Tue Oct 13 2026 - 13:39:19 EST


OK, it's understood. I'll look for another candidate.

Thanks for your feedback.

Jeremy

On 10/13/26 12:15 AM, Greg Kroah-Hartman wrote:
On Mon, Oct 12, 2026 at 10:29:26PM +0000, Jeremy Dean Clifton wrote:
The three return paths of nvec_write_sync() each release
sync_write_mutex with explicit unlock calls.

Use guard(mutex) to unlock the lock automatically on any return
path.

This removes the three mutex_unlock() calls.

No functional change.

Signed-off-by: Jeremy Dean Clifton <deaner92@xxxxxxxxx>
---
v2:
- Reword the commit message to state the motivation and to make
clear that removing the mutex_unlock() calls is the result of
the change (Julia Lawall).
v1: https://lore.kernel.org/all/20261012171312.5998-1-deaner92@xxxxxxxxx/

Please read the archives for why I will not take guard() rewrites of
staging drivers (nor do I want to see you use a LLM in here either.)

sorry,

greg k-h