Re: [PATCH v2] drm/sched: Guard against NULL dev in drm_sched_job trace event
From: Philipp Stanner
Date: Tue Aug 25 2026 - 08:13:31 EST
On Tue, 2026-08-25 at 14:02 +0200, Danilo Krummrich wrote:
>
[…]
>
> I don't think that we should make such changes for Kunit tests only; it implies
> that a NULL dev now would be a valid value for the scheduler.
Strictly speaking we don't allow for the device pointer to be NULL, so
you might be right. However, it actually is only used for creating
debug prints, so…
>
> Why can't we have the Kunit test create a fake device for this? For instance,
> this is where struct faux_device becomes useful.
Wouldn't that be the same result as printing "NULL device"?
Many DRM print helpers do the latter already. __drm_dev_vprintk() takes
dev == NULL into account.
So one might argue that making the print-functions all robust against
NULL would be the more consistent thing.
P.