From: Philipp Stanner <phasta@mailbox.org>
To: oushixiong1025@163.com, Matthew Brost <matthew.brost@intel.com>
Cc: "Danilo Krummrich" <dakr@kernel.org>,
"Philipp Stanner" <phasta@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: Fri, 04 Sep 2026 09:02:47 +0200 [thread overview]
Message-ID: <fcecfac828dc3f338d59125d6f0306534e1e2429.camel@mailbox.org> (raw)
In-Reply-To: <20260903121558.782854-1-oushixiong1025@163.com>
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.
> 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?
next prev parent reply other threads:[~2026-09-04 7:02 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 [this message]
2026-09-08 5:58 ` Shixiong Ou
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=fcecfac828dc3f338d59125d6f0306534e1e2429.camel@mailbox.org \
--to=phasta@mailbox.org \
--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=oushixiong1025@163.com \
--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®