]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/i915: Use named initializers for the crc source name array
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 14 Feb 2019 19:22:17 +0000 (21:22 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 20 Feb 2019 20:46:57 +0000 (22:46 +0200)
We assume that the index of the string in the crc source names
array matches the enum value for the crc source. Let's use named
initializers to make sure that is indeed the case even if someone
rearranges either the enum or the array.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190214192219.3858-2-ville.syrjala@linux.intel.com
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/i915/intel_pipe_crc.c

index a3a3ad760158aede65a8aee99de5168dd96ab4bc..fe0ff89b980bd86826a864954db845ec38b8f554 100644 (file)
 #include "intel_drv.h"
 
 static const char * const pipe_crc_sources[] = {
-       "none",
-       "plane1",
-       "plane2",
-       "pipe",
-       "TV",
-       "DP-B",
-       "DP-C",
-       "DP-D",
-       "auto",
+       [INTEL_PIPE_CRC_SOURCE_NONE] = "none",
+       [INTEL_PIPE_CRC_SOURCE_PLANE1] = "plane1",
+       [INTEL_PIPE_CRC_SOURCE_PLANE2] = "plane2",
+       [INTEL_PIPE_CRC_SOURCE_PIPE] = "pipe",
+       [INTEL_PIPE_CRC_SOURCE_TV] = "TV",
+       [INTEL_PIPE_CRC_SOURCE_DP_B] = "DP-B",
+       [INTEL_PIPE_CRC_SOURCE_DP_C] = "DP-C",
+       [INTEL_PIPE_CRC_SOURCE_DP_D] = "DP-D",
+       [INTEL_PIPE_CRC_SOURCE_AUTO] = "auto",
 };
 
 static int i8xx_pipe_crc_ctl_reg(enum intel_pipe_crc_source *source,