From: Shixiong Ou <oushixiong1025@163.com>
To: phasta@kernel.org, Matthew Brost <matthew.brost@intel.com>
Cc: "Danilo Krummrich" <dakr@kernel.org>,
"Christian König" <ckoenig.leichtzumerken@gmail.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
"Shixiong Ou" <oushixiong@kylinos.cn>,
stable@vger.kernel.org
Subject: Re: [PATCH v2] drm/sched: Create a fake device for KUnit tests
Date: Tue, 8 Sep 2026 13:58:17 +0800 [thread overview]
Message-ID: <152a5d66-d4f6-4b90-b30a-8777876ee319@163.com> (raw)
In-Reply-To: <fcecfac828dc3f338d59125d6f0306534e1e2429.camel@mailbox.org>
Hi,
First of all, thanks for the review and the suggestions.
I had already sent v3 by the time your full comments came in -- here is
the v3 patch for reference: https://lkml.org/lkml/2026/9/4/547
Both points will be addressed in v4 later.
On 2026/9/4 15:02, Philipp Stanner wrote:
> On Thu, 2026-09-03 at 20:15 +0800, oushixiong1025@163.com wrote:
> […]
>
>> +
>> #include "sched_tests.h"
>>
>> /*
>> @@ -288,6 +290,7 @@ static const struct drm_sched_backend_ops drm_mock_scheduler_ops = {
>> */
>> struct drm_mock_scheduler *drm_mock_sched_new(struct kunit *test, long timeout)
>> {
>> + static unsigned int instance;
> I know statics are initialized to 0 automatically, but writing it out
> explicitly is probably advantageous for readability, especially since
> we're incrementing.
One note: this trips checkpatch's "do not initialise statics to 0"
error, so I followed your suggestion over the checkpatch rule.
>> struct drm_sched_init_args args = {
>> .ops = &drm_mock_scheduler_ops,
>> .num_rqs = DRM_SCHED_PRIORITY_COUNT,
>> @@ -297,11 +300,19 @@ struct drm_mock_scheduler *drm_mock_sched_new(struct kunit *test, long timeout)
>> .name = "drm-mock-scheduler",
>> };
>> struct drm_mock_scheduler *sched;
>> + struct device *dev;
>> + char name[64];
>> int ret;
>>
>> sched = kunit_kzalloc(test, sizeof(*sched), GFP_KERNEL);
>> KUNIT_ASSERT_NOT_NULL(test, sched);
>>
>> + snprintf(name, sizeof(name), "%s-%u", args.name, ++instance);
> Any particular reason why you begin with index 1?
No particular reason -- switched to instance++ so the numbering
starts at 0.
The updated v4 patch will be send later.
Thanks again for your time and for catching these points.
Best regards,
Shixiong Ou
prev parent reply other threads:[~2026-09-08 5:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 12:15 oushixiong1025
2026-09-03 12:38 ` Maxime Ripard
2026-09-04 7:02 ` Philipp Stanner
2026-09-08 5:58 ` Shixiong Ou [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=152a5d66-d4f6-4b90-b30a-8777876ee319@163.com \
--to=oushixiong1025@163.com \
--cc=airlied@gmail.com \
--cc=ckoenig.leichtzumerken@gmail.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matthew.brost@intel.com \
--cc=mripard@kernel.org \
--cc=oushixiong@kylinos.cn \
--cc=phasta@kernel.org \
--cc=simona@ffwll.ch \
--cc=stable@vger.kernel.org \
--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®