Re: [PATCH 00/10] drm: Remove usage of deprecated DRM_* macros

From: Siddh Raman Pant
Date: Wed Dec 21 2022 - 10:58:31 EST


On Wed, Dec 21 2022 at 14:46:12 +0530, Thomas Zimmermann wrote:
> Hi
>
> Am 20.12.22 um 21:16 schrieb Siddh Raman Pant:
>> This patchset aims to remove usages of deprecated DRM_* macros from the
>> files residing in drivers/gpu/drm root.
>>
>> In process, I found out that NULL as first argument of drm_dbg_* wasn't
>> working, but it was listed as the alternative in deprecation comment,
>> so I fixed that before removing usages of DRM_DEBUG_* macros.
>>
>> This patchset should be applied in order as changes might be dependent.
>>
>> Please review and let me know if any errors are there, and hopefully
>> this gets accepted.
>
> Thanks for the patchset. Overall this looks fine.
>
> But the use of pr_() functions is not optimal in my opinion. I know that
> I recommended using it, but at a closer look, I think we might want to
> reconsider that. I wouldn't like losing the '[drm]' tag, but adding them
> to each pr_() call isn't a good idea either.
>
> I think it would be nicer to replace DRM_INFO with drm_info(NULL, ).
> Depending on the device being NULL, the helpers would select dev-based
> messages or printk-based messages. It would then work like drm_dbg_().
> But it needs some additional changes.
>
> Can you first move all pr_() related changes into a new patchset? The
> trivial conversion were the device is known and not NULL can remain in
> this patchset and be merged soon. We can afterwards have a separate
> discussion for the changes that currently involve pr_().
>
> Best regards
> Thomas

Maybe I can just cope for NULL in __drm_printk and change all pr_*()
changes in this patchset to the appropriate ones.

Something like:
#define __drm_printk(drm, level, type, fmt, ...) \
({ \
drm_ = __drm_print_dev(drm); \
if (drm_) \
dev_##level##type((drm_)->dev, "[drm] " fmt, ##__VA_ARGS__); \
else \
pr_##level##type("[drm] " fmt, ##__VA_ARGS__); \
})

Thanks,
Siddh