[PATCH] drm/sched: Define pr_fmt() for DRM using pr_*()

Luben Tuikov ltuikov89 at gmail.com
Fri Nov 17 03:22:13 UTC 2023


On 2023-11-15 03:24, Jani Nikula wrote:
> On Tue, 14 Nov 2023, Luben Tuikov <ltuikov89 at gmail.com> wrote:
>> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
>> index a93a387f8a1a15..ce784118e4f762 100644
>> --- a/include/drm/drm_print.h
>> +++ b/include/drm/drm_print.h
>> @@ -453,7 +453,7 @@ void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev,
>>  
>>  /* Helper for struct drm_device based logging. */
>>  #define __drm_printk(drm, level, type, fmt, ...)                       \
>> -       dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__)
>> +       dev_##level##type(drm ? (drm)->dev : NULL, "[drm] " fmt, ##__VA_ARGS__)
> 
> I think that would be an improvement that stands on its own merits.
> 
> Please also wrap the first drm in parens (drm).

Okay.

> 
>> The output would be similar to that if drm->dev were NULL.
> 
> Yes. I don't know how people will feel about intentionally using
> drm_err(NULL, ...) all over the place, but that's another matter. ;)

:-)

-- 
Regards,
Luben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x4C15479431A334AF.asc
Type: application/pgp-keys
Size: 664 bytes
Desc: OpenPGP public key
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20231116/bb353beb/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20231116/bb353beb/attachment.sig>


More information about the dri-devel mailing list