On 2/6/25 11:41 AM, Sean Anderson wrote:
static int zynqmp_dp_enhanced_set(void *data, u64 val)
{
struct zynqmp_dp *dp = data;
- int ret = 0;
- mutex_lock(&dp->lock);
+ guard(mutex)(&dp->lock);
dp->test.enhanced = val;
if (dp->test.active)
-
On 2/6/25 15:31, Bart Van Assche wrote:
> On 2/6/25 11:41 AM, Sean Anderson wrote:
>> static int zynqmp_dp_enhanced_set(void *data, u64 val)
>> {
>> struct zynqmp_dp *dp = data;
>> -int ret = 0;
>> -mutex_lock(&dp->lock);
>> +guard(mutex)(&dp->lock);
>> dp->test.enhanc
Convert most mutex_(un)lock calls to use (scoped_)guard instead. This
generally reduces line count and prevents bugs like forgetting to unlock
the mutex. I've left traditional calls in a few places where scoped
helpers would be more verbose. This mostly happens where
debugfs_file_put needs to be ca