Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915: Protect CRC reg macro arguments for consistency

It's probably a good idea to start protecting all macro arguments
to avoid any cargo-cult mistakes when people go looking for examples
of how to define these things.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240531115342.2763-8-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>

+13 -13
+13 -13
drivers/gpu/drm/i915/display/intel_pipe_crc_regs.h
··· 9 9 #include "intel_display_reg_defs.h" 10 10 11 11 #define _PIPE_CRC_CTL_A 0x60050 12 - #define PIPE_CRC_CTL(dev_priv, pipe) _MMIO_TRANS2(dev_priv, pipe, _PIPE_CRC_CTL_A) 12 + #define PIPE_CRC_CTL(dev_priv, pipe) _MMIO_TRANS2((dev_priv), (pipe), _PIPE_CRC_CTL_A) 13 13 #define PIPE_CRC_ENABLE REG_BIT(31) 14 14 /* skl+ source selection */ 15 15 #define PIPE_CRC_SOURCE_MASK_SKL REG_GENMASK(30, 28) ··· 76 76 #define PIPE_CRC_EXP_RES2_MASK REG_BIT(22, 0) /* pre-ivb */ 77 77 78 78 #define _PIPE_CRC_RES_RED_A 0x60060 79 - #define PIPE_CRC_RES_RED(dev_priv, pipe) _MMIO_TRANS2(dev_priv, pipe, _PIPE_CRC_RES_RED_A) 79 + #define PIPE_CRC_RES_RED(dev_priv, pipe) _MMIO_TRANS2((dev_priv), (pipe), _PIPE_CRC_RES_RED_A) 80 80 81 81 #define _PIPE_CRC_RES_GREEN_A 0x60064 82 - #define PIPE_CRC_RES_GREEN(dev_priv, pipe) _MMIO_TRANS2(dev_priv, pipe, _PIPE_CRC_RES_GREEN_A) 82 + #define PIPE_CRC_RES_GREEN(dev_priv, pipe) _MMIO_TRANS2((dev_priv), (pipe), _PIPE_CRC_RES_GREEN_A) 83 83 84 84 #define _PIPE_CRC_RES_BLUE_A 0x60068 85 - #define PIPE_CRC_RES_BLUE(dev_priv, pipe) _MMIO_TRANS2(dev_priv, pipe, _PIPE_CRC_RES_BLUE_A) 85 + #define PIPE_CRC_RES_BLUE(dev_priv, pipe) _MMIO_TRANS2((dev_priv), (pipe), _PIPE_CRC_RES_BLUE_A) 86 86 87 87 #define _PIPE_CRC_RES_RES1_A_I915 0x6006c /* i915+ */ 88 - #define PIPE_CRC_RES_RES1_I915(dev_priv, pipe) _MMIO_TRANS2(dev_priv, pipe, _PIPE_CRC_RES_RES1_A_I915) 88 + #define PIPE_CRC_RES_RES1_I915(dev_priv, pipe) _MMIO_TRANS2((dev_priv), (pipe), _PIPE_CRC_RES_RES1_A_I915) 89 89 90 90 #define _PIPE_CRC_RES_RES2_A_G4X 0x60080 /* g4x+ */ 91 - #define PIPE_CRC_RES_RES2_G4X(dev_priv, pipe) _MMIO_TRANS2(dev_priv, pipe, _PIPE_CRC_RES_RES2_A_G4X) 91 + #define PIPE_CRC_RES_RES2_G4X(dev_priv, pipe) _MMIO_TRANS2((dev_priv), (pipe), _PIPE_CRC_RES_RES2_A_G4X) 92 92 93 93 /* ivb */ 94 94 #define _PIPE_CRC_EXP_2_A_IVB 0x60054 ··· 117 117 /* ivb */ 118 118 #define _PIPE_CRC_RES_1_A_IVB 0x60064 119 119 #define _PIPE_CRC_RES_1_B_IVB 0x61064 120 - #define PIPE_CRC_RES_1_IVB(pipe) _MMIO_PIPE(pipe, _PIPE_CRC_RES_1_A_IVB, _PIPE_CRC_RES_1_B_IVB) 120 + #define PIPE_CRC_RES_1_IVB(pipe) _MMIO_PIPE((pipe), _PIPE_CRC_RES_1_A_IVB, _PIPE_CRC_RES_1_B_IVB) 121 121 122 122 /* ivb */ 123 123 #define _PIPE_CRC_RES_2_A_IVB 0x60068 124 124 #define _PIPE_CRC_RES_2_B_IVB 0x61068 125 - #define PIPE_CRC_RES_2_IVB(pipe) _MMIO_PIPE(pipe, _PIPE_CRC_RES_2_A_IVB, _PIPE_CRC_RES_2_B_IVB) 125 + #define PIPE_CRC_RES_2_IVB(pipe) _MMIO_PIPE((pipe), _PIPE_CRC_RES_2_A_IVB, _PIPE_CRC_RES_2_B_IVB) 126 126 127 127 /* ivb */ 128 128 #define _PIPE_CRC_RES_3_A_IVB 0x6006c 129 129 #define _PIPE_CRC_RES_3_B_IVB 0x6106c 130 - #define PIPE_CRC_RES_3_IVB(pipe) _MMIO_PIPE(pipe, _PIPE_CRC_RES_3_A_IVB, _PIPE_CRC_RES_3_B_IVB) 130 + #define PIPE_CRC_RES_3_IVB(pipe) _MMIO_PIPE((pipe), _PIPE_CRC_RES_3_A_IVB, _PIPE_CRC_RES_3_B_IVB) 131 131 132 132 /* ivb */ 133 133 #define _PIPE_CRC_RES_4_A_IVB 0x60070 134 134 #define _PIPE_CRC_RES_4_B_IVB 0x61070 135 - #define PIPE_CRC_RES_4_IVB(pipe) _MMIO_PIPE(pipe, _PIPE_CRC_RES_4_A_IVB, _PIPE_CRC_RES_4_B_IVB) 135 + #define PIPE_CRC_RES_4_IVB(pipe) _MMIO_PIPE((pipe), _PIPE_CRC_RES_4_A_IVB, _PIPE_CRC_RES_4_B_IVB) 136 136 137 137 /* ivb */ 138 138 #define _PIPE_CRC_RES_5_A_IVB 0x60074 139 139 #define _PIPE_CRC_RES_5_B_IVB 0x61074 140 - #define PIPE_CRC_RES_5_IVB(pipe) _MMIO_PIPE(pipe, _PIPE_CRC_RES_5_A_IVB, _PIPE_CRC_RES_5_B_IVB) 140 + #define PIPE_CRC_RES_5_IVB(pipe) _MMIO_PIPE((pipe), _PIPE_CRC_RES_5_A_IVB, _PIPE_CRC_RES_5_B_IVB) 141 141 142 142 /* hsw+ */ 143 143 #define _PIPE_CRC_EXP_A_HSW 0x60054 144 144 #define _PIPE_CRC_EXP_B_HSW 0x61054 145 - #define PIPE_CRC_EXP_HSW(pipe) _MMIO_PIPE(pipe, _PIPE_CRC_EXP_A_HSW, _PIPE_CRC_EXP_B_HSW) 145 + #define PIPE_CRC_EXP_HSW(pipe) _MMIO_PIPE((pipe), _PIPE_CRC_EXP_A_HSW, _PIPE_CRC_EXP_B_HSW) 146 146 147 147 /* hsw+ */ 148 148 #define _PIPE_CRC_RES_A_HSW 0x60064 149 149 #define _PIPE_CRC_RES_B_HSW 0x61064 150 - #define PIPE_CRC_RES_HSW(pipe) _MMIO_PIPE(pipe, _PIPE_CRC_RES_A_HSW, _PIPE_CRC_RES_B_HSW) 150 + #define PIPE_CRC_RES_HSW(pipe) _MMIO_PIPE((pipe), _PIPE_CRC_RES_A_HSW, _PIPE_CRC_RES_B_HSW) 151 151 152 152 #endif /* __INTEL_PIPE_CRC_REGS_H__ */