From: Sean Anderson <sean.anderson@linux.dev>
To: Bart Van Assche <bvanassche@acm.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
"open list:DRM DRIVERS FOR XILINX"
<dri-devel@lists.freedesktop.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>,
"moderated list:ARM/ZYNQ ARCHITECTURE"
<linux-arm-kernel@lists.infradead.org>,
open list <linux-kernel@vger.kernel.org>,
David Airlie <airlied@gmail.com>,
Dan Carpenter <dan.carpenter@linaro.org>,
Michal Simek <michal.simek@amd.com>,
Maxime Ripard <mripard@kernel.org>,
Simona Vetter <simona@ffwll.ch>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Subject: Re: [PATCH 2/2] drm: zynqmp_dp: Use scope-based mutex helpers
Date: Thu, 6 Feb 2025 15:37:48 -0500 [thread overview]
Message-ID: <c10a8643-6f6f-4428-91a7-e7f5c92a3f58@linux.dev> (raw)
In-Reply-To: <373d62da-810f-492c-af2f-53b32cc90b33@acm.org>
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
prev parent reply other threads:[~2025-02-06 20:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-06 19:41 [PATCH 0/2] " Sean Anderson
2025-02-06 19:41 ` [PATCH 1/2] drm: zynqmp_dp: Fix a deadlock in zynqmp_dp_ignore_hpd_set() Sean Anderson
2025-02-06 19:41 ` [PATCH 2/2] drm: zynqmp_dp: Use scope-based mutex helpers Sean Anderson
2025-02-06 20:31 ` Bart Van Assche
2025-02-06 20:37 ` Sean Anderson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c10a8643-6f6f-4428-91a7-e7f5c92a3f58@linux.dev \
--to=sean.anderson@linux.dev \
--cc=airlied@gmail.com \
--cc=bvanassche@acm.org \
--cc=dan.carpenter@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=michal.simek@amd.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=tomi.valkeinen@ideasonboard.com \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®