[PATCH v7 3/9] drm/plane: Add drm_for_each_primary_visible_plane macro

Joe Perches joe at perches.com
Mon Jan 8 10:30:11 UTC 2024


On Mon, 2024-01-08 at 11:24 +0100, Jocelyn Falempe wrote:
> Hi checkpatch maintainers,
> 
> This patch gives me the following checkpatch error:
> 
> ERROR: Macros with complex values should be enclosed in parentheses
> #30: FILE: include/drm/drm_plane.h:959:
> +#define drm_for_each_primary_visible_plane(plane, dev) \
> +	list_for_each_entry((plane), &(dev)->mode_config.plane_list, head) \
> +		for_each_if((plane)->type == DRM_PLANE_TYPE_PRIMARY && \
> +			    (plane)->state && \
> +			    (plane)->state->fb && \
> +			    (plane)->state->visible)
> 
> total: 1 errors, 0 warnings, 21 lines checked
> 
> I think this requirement cannot work when you use list_for_each kind of 
> macros.
> Do you have any suggestion ?
> 

checkpatch is a brainless regex script.
Ignore it when it's stupid.



More information about the dri-devel mailing list