Re: [PATCH] staging: greybus: Use guard(mutex) in receive_data()

From: Greg Kroah-Hartman

Date: Wed Feb 25 2026 - 10:01:25 EST


On Wed, Feb 25, 2026 at 03:30:06PM +0500, Matvey Oborotov wrote:
> Replace manual mutex_lock/unlock with guard(mutex) in raw.c
> receive_data(). This automates lock release on function exit, ensures
> that lock is released on early returns, and makes the code cleaner.
>
> Signed-off-by: Matvey Oborotov <oborotovmatvey@xxxxxxxxx>
> ---
> drivers/staging/greybus/raw.c | 16 +++++-----------
> 1 file changed, 5 insertions(+), 11 deletions(-)

Please only use guard() logic with new code, or if you are fixing a bug.
Making changes like this to existing code is not needed at all, it just
causes unwanted churn for no good reason.

sorry,

greg k-h