[Intel-gfx] [PATCH 6/6] drm/i915: Protect overlay colorkey macro arguments

Chris Wilson chris at chris-wilson.co.uk
Fri May 15 16:41:36 UTC 2020


Quoting Ville Syrjala (2019-10-28 11:30:36)
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> Put the customary () around the macro argument in the overlay
> colorkey macros. And while at switch to using a consistent
> case for the hex constants.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_overlay.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c
> index 3241cc98e251..4bc07c1057e2 100644
> --- a/drivers/gpu/drm/i915/display/intel_overlay.c
> +++ b/drivers/gpu/drm/i915/display/intel_overlay.c
> @@ -103,13 +103,13 @@
>  #define CLK_RGB15_MASK         0x070707
>  
>  #define RGB30_TO_COLORKEY(c) \
> -       (((c & 0x3FC00000) >> 6) | ((c & 0x000FF000) >> 4) | ((c & 0x000003FC) >> 2))
> +       ((((c) & 0x3fc00000) >> 6) | (((c) & 0x000ff000) >> 4) | (((c) & 0x000003fc) >> 2))
>  #define RGB16_TO_COLORKEY(c) \
> -       (((c & 0xF800) << 8) | ((c & 0x07E0) << 5) | ((c & 0x001F) << 3))
> +       ((((c) & 0xf800) << 8) | (((c) & 0x07e0) << 5) | (((c) & 0x001f) << 3))
>  #define RGB15_TO_COLORKEY(c) \
> -       (((c & 0x7c00) << 9) | ((c & 0x03E0) << 6) | ((c & 0x001F) << 3))
> +       ((((c) & 0x7c00) << 9) | (((c) & 0x03e0) << 6) | (((c) & 0x001f) << 3))
>  #define RGB8I_TO_COLORKEY(c) \
> -       (((c & 0xFF) << 16) | ((c & 0XFF) << 8) | ((c & 0xFF) << 0))
> +       ((((c) & 0xff) << 16) | (((c) & 0xff) << 8) | (((c) & 0xff) << 0))

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the Intel-gfx mailing list