lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c10a8643-6f6f-4428-91a7-e7f5c92a3f58@linux.dev>
Date: Thu, 6 Feb 2025 15:37:48 -0500
From: Sean Anderson <sean.anderson@...ux.dev>
To: Bart Van Assche <bvanassche@....org>,
 Laurent Pinchart <laurent.pinchart@...asonboard.com>,
 Tomi Valkeinen <tomi.valkeinen@...asonboard.com>,
 "open list:DRM DRIVERS FOR XILINX" <dri-devel@...ts.freedesktop.org>
Cc: Thomas Zimmermann <tzimmermann@...e.de>,
 "moderated list:ARM/ZYNQ ARCHITECTURE"
 <linux-arm-kernel@...ts.infradead.org>,
 open list <linux-kernel@...r.kernel.org>, David Airlie <airlied@...il.com>,
 Dan Carpenter <dan.carpenter@...aro.org>, Michal Simek
 <michal.simek@....com>, Maxime Ripard <mripard@...nel.org>,
 Simona Vetter <simona@...ll.ch>,
 Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>
Subject: Re: [PATCH 2/2] drm: zynqmp_dp: Use scope-based mutex helpers

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.enhanced = val;
>>       if (dp->test.active)
>> -        ret = zynqmp_dp_test_setup(dp);
>> -    mutex_unlock(&dp->lock);
>> +        return zynqmp_dp_test_setup(dp);
>>   -    return ret;
>> +    return 0;
>>   }
> 
> Has it been considered to combine the two return statements into one
> with the ternary operator (?:)?

I didn't consider it, but the line is short enough that I can add it.

>> @@ -2053,7 +2039,8 @@ static ssize_t zynqmp_dp_custom_read(struct file *file, char __user *user_buf,
>>           return ret;
>>         mutex_lock(&dp->lock);
>> -    ret = simple_read_from_buffer(user_buf, count, ppos, &dp->test.custom,
>> +    ret = simple_read_from_buffer(user_buf, count, ppos,
>> +                      &dp->test.custom,
>>                         sizeof(dp->test.custom));
> 
> This change has not been mentioned in the patch description and is not
> related to the other changes in this patch?

I think I made this change while refactoring, but it turned out not to
be necessary. I will remove it for the next revision.

--Sean

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ