Re: [PATCH 1/2] drm/i915: Reduce trickery in DEV_INFO_FOR_EACH_FLAG

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 04, 2016 at 03:42:57PM +0300, Joonas Lahtinen wrote:
>  #define PRINT_S(name) "%s"
> -#define SEP_EMPTY
> -#define PRINT_FLAG(name) info->name ? #name "," : ""
> -#define SEP_COMMA ,
> +#define PRINT_FLAG(name) info->name ? #name "," : "",
>  	DRM_DEBUG_DRIVER("i915 device info: gen=%i, pciid=0x%04x rev=0x%02x flags="
> -			 DEV_INFO_FOR_EACH_FLAG(PRINT_S, SEP_EMPTY),
> +			 DEV_INFO_FOR_EACH_FLAG(PRINT_S) "%s",
>  			 info->gen,
>  			 dev_priv->drm.pdev->device,
>  			 dev_priv->drm.pdev->revision,
> -			 DEV_INFO_FOR_EACH_FLAG(PRINT_FLAG, SEP_COMMA));
> +			 DEV_INFO_FOR_EACH_FLAG(PRINT_FLAG)
> +			 "");

Why did we need the trailing fmt + arg? Oh. PRINT_FLAG has the trailing
'.' so needs a sentinel.

Reviewed-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux