drm/i915: Convert _FIA() to _PICK_EVEN_2RANGES()
authorLucas De Marchi <lucas.demarchi@intel.com>
Fri, 20 Jan 2023 19:34:55 +0000 (11:34 -0800)
committerLucas De Marchi <lucas.demarchi@intel.com>
Fri, 27 Jan 2023 16:52:32 +0000 (08:52 -0800)
_FIA() can use _PICK_EVEN_2RANGES instead of _PICK, which reduces the
size and is safer.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230120193457.3295977-7-lucas.demarchi@intel.com
drivers/gpu/drm/i915/display/intel_mg_phy_regs.h

index 0e8248b..0306ade 100644 (file)
 #define FIA1_BASE                      0x163000
 #define FIA2_BASE                      0x16E000
 #define FIA3_BASE                      0x16F000
-#define _FIA(fia)                      _PICK((fia), FIA1_BASE, FIA2_BASE, FIA3_BASE)
+#define _FIA(fia)                      _PICK_EVEN_2RANGES((fia), 1,            \
+                                                          FIA1_BASE, FIA1_BASE,\
+                                                          FIA2_BASE, FIA3_BASE)
 #define _MMIO_FIA(fia, off)            _MMIO(_FIA(fia) + (off))
 
 /* ICL PHY DFLEX registers */