diff mbox series

[1/3] drm/i915/pciids: add common INTEL_VGA_DEVICE_INIT macro

Message ID e7e2a33f2cd65e50e5a726d7804bd79804f93475.1673871359.git.jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Use designated initializers for struct pci_device_id init | expand

Commit Message

Jani Nikula Jan. 16, 2023, 12:18 p.m. UTC
Add a shared abstraction for the INTEL_VGA_DEVICE() and
INTEL_QUANTA_VGA_DEVICE() initializers to help follow-up changes.

Sprinkle in some underscores and parenthesis to be safe.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 include/drm/i915_pciids.h | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/include/drm/i915_pciids.h b/include/drm/i915_pciids.h
index 4a4c190f7698..0987bc12476f 100644
--- a/include/drm/i915_pciids.h
+++ b/include/drm/i915_pciids.h
@@ -35,17 +35,18 @@ 
  * Don't use C99 here because "class" is reserved and we want to
  * give userspace flexibility.
  */
-#define INTEL_VGA_DEVICE(id, info) {		\
-	0x8086,	id,				\
-	~0, ~0,					\
-	0x030000, 0xff0000,			\
-	(unsigned long) info }
-
-#define INTEL_QUANTA_VGA_DEVICE(info) {		\
-	0x8086,	0x16a,				\
-	0x152d,	0x8990,				\
-	0x030000, 0xff0000,			\
-	(unsigned long) info }
+#define INTEL_VGA_DEVICE_INIT(__id, __subvendor, __subdevice, __info) { \
+		0x8086, (__id),						\
+		(__subvendor), (__subdevice),				\
+		0x030000, 0xff0000,					\
+		(unsigned long)(__info),				\
+	}
+
+#define INTEL_VGA_DEVICE(__id, __info)			\
+	INTEL_VGA_DEVICE_INIT(__id, ~0, ~0, __info)
+
+#define INTEL_QUANTA_VGA_DEVICE(__info)				\
+	INTEL_VGA_DEVICE_INIT(0x16a, 0x152d, 0x8990, __info)
 
 #define INTEL_I810_IDS(info)					\
 	INTEL_VGA_DEVICE(0x7121, info), /* I810 */		\