[PATCH 5/5] drm/print: require struct drm_device for drm_err() and friends

Luca Ceresoli luca.ceresoli at bootlin.com
Tue Feb 25 16:52:56 UTC 2025


On Thu, 23 Jan 2025 17:09:12 +0200
Jani Nikula <jani.nikula at intel.com> wrote:

> The expectation is that the struct drm_device based logging helpers get
> passed an actual struct drm_device pointer rather than some random
> struct pointer where you can dereference the ->dev member.
> 
> Add a static inline helper to convert struct drm_device to struct
> device, with the main benefit being the type checking of the macro
> argument.
> 
> As a side effect, this also reduces macro argument double references.
> 
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>

Reviewed-by: Luca Ceresoli <luca.ceresoli at bootlin.com>

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


More information about the Intel-gfx mailing list