[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2025042511-dose-rage-4c72@gregkh>
Date: Fri, 25 Apr 2025 07:10:45 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Erick Karanja <karanja99erick@...il.com>
Cc: julia.lawall@...ia.fr, philipp.g.hortmann@...il.com,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 0/2] staging: rtl8723bs: Use scoped_guard for mutex
handling
On Thu, Apr 24, 2025 at 10:56:24PM +0300, Erick Karanja wrote:
> This patchset updates the rtl8723bs driver by replacing manual mutex lock and
> unlock operations with scoped_guard(), aiming to improve code clarity and
> safety through automatic resource management. This change makes the code
> more resilient to early returns and error paths.
But the places you changed do not have early returns or error paths, so
this really is just unneeded churn :(
scope_guard() is great, please use it for new code, or for places with
lots of returns or error paths. But not for just general "let's convert
the driver to use this!" type of things, as that's not needed at all.
Also, for changes like this, I'd like to see the code actually tested to
verify it all is still working properly, as mistakes here can be very
common to cause.
thanks,
greg k-h
Powered by blists - more mailing lists