[Intel-gfx] [PATCH 3/7] drm/i915: use variable arguments for the macros that call _PICK

Paulo Zanoni paulo.r.zanoni at intel.com
Tue Jun 13 19:33:46 UTC 2017


There's no need to create a new macro every time the number of
parameters change.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
---
 drivers/gpu/drm/i915/i915_reg.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 1983b75..1d5a0f8 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -52,7 +52,7 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
 
 #define _PIPE(pipe, a, b) ((a) + (pipe)*((b)-(a)))
 #define _MMIO_PIPE(pipe, a, b) _MMIO(_PIPE(pipe, a, b))
-#define _MMIO_PIPE3(pipe, a, b, c) _MMIO(_PICK(pipe, a, b, c))
+#define _MMIO_PIPE3(pipe, ...) _MMIO(_PICK(pipe, __VA_ARGS__))
 
 #define _PLANE(plane, a, b) _PIPE(plane, a, b)
 #define _MMIO_PLANE(plane, a, b) _MMIO_PIPE(plane, a, b)
@@ -62,8 +62,8 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
 
 #define _PORT(port, a, b) ((a) + (port)*((b)-(a)))
 #define _MMIO_PORT(port, a, b) _MMIO(_PORT(port, a, b))
-#define _MMIO_PORT3(port, a, b, c) _MMIO(_PICK(port, a, b, c))
-#define _MMIO_PORT6(port, a, b, c, d, e, f) _MMIO(_PICK(port, a, b, c, d, e, f))
+#define _MMIO_PORT3(port, ...) _MMIO(_PICK(port, __VA_ARGS__))
+#define _MMIO_PORT6(port, ...) _MMIO(_PICK(port, __VA_ARGS__))
 #define _MMIO_PORT6_LN(port, ln, a0, a1, b, c, d, e, f)			\
 	_MMIO(_PICK(port, a0, b, c, d, e, f) + (ln * (a1 - a0)))
 
@@ -71,7 +71,7 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
 #define _MMIO_PLL(pll, a, b) _MMIO(_PLL(pll, a, b))
 
 #define _PHY3(phy, ...) _PICK(phy, __VA_ARGS__)
-#define _MMIO_PHY3(phy, a, b, c) _MMIO(_PHY3(phy, a, b, c))
+#define _MMIO_PHY3(phy, ...) _MMIO(_PHY3(phy, __VA_ARGS__))
 
 #define _MASKED_FIELD(mask, value) ({					   \
 	if (__builtin_constant_p(mask))					   \
-- 
2.9.4



More information about the Intel-gfx mailing list