Skip to contentSkip to conversation

misc: Improvements around *_device_id defintions

PATCH Superseded Uwe Kleine-König (The Capable Hub) 5 participants 18 messages Jul 17 – Aug 13

Subsystems (21)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover misc: Improvements around *_device_id defintions

Hello,

the main motivation for this series are the patches that introduce named initializers to these arrays. The reason I want these is that I plan to make .driver_data a union, see
https://lore.kernel.org/all/[email protected]/
for more details about this quest.

This series superseds a patch that only handled i2c_device_id, which is available at
https://lore.kernel.org/all/[email protected]/.

Changes since then:

- Also handle all the other *_device_id to ideally only have to bother about drivers/misc once for all the similar quests
- split drivers/misc/eeprom in separate patches
- rebased to yeserday's next

Best regards
Uwe

Uwe Kleine-König (The Capable Hub) (12):
misc: Drop unused assignment of spi_device_id driver data misc/pvpanic: Drop unused assignment of acpi_device_id driver data
misc: genwqe: Drop unused assignment of pci_device_id driver data
misc: eeprom: Use named initializers for arrays of i2c_device_data
misc: Use named initializers for arrays of i2c_device_data
misc: Use named initializers for arrays of spi_device_data
misc: mei: Use named initializers for acpi_device_id array
misc: mei: Use named initializer for platform_device_id array
misc: ibmvmc: Use named initializers for vio_device_id array
misc: eeprom: idt_89hpesx: Unify style of of_device_id array
misc: Unify style of of_device_id arrays
misc: Unify code style for various *_device_id arrays

 drivers/misc/ad525x_dpot-i2c.c                |  52 ++---
 drivers/misc/ad525x_dpot-spi.c                |  58 ++---
 drivers/misc/amd-sbi/rmi-i2c.c                |   6 +-
 drivers/misc/apds9802als.c                    |   2 +-
 drivers/misc/bcm-vk/bcm_vk_dev.c              |   2 +-
 drivers/misc/bh1770glc.c                      |   6 +-
 drivers/misc/cardreader/alcor_pci.c           |   2 +-
 drivers/misc/cb710/core.c                     |   5 +-
 drivers/misc/ds1682.c                         |   6 +-
 drivers/misc/eeprom/idt_89hpesx.c             | 202 +++++++++---------
 drivers/misc/eeprom/max6875.c                 |   2 +-
 drivers/misc/fastrpc.c                        |   6 +-
 drivers/misc/gehc-achc.c                      |   4 +-
 drivers/misc/genwqe/card_base.c               |  88 +++-----
 drivers/misc/hi6421v600-irq.c                 |   2 +-
 drivers/misc/hisi_hikey_usb.c                 |   2 +-
 drivers/misc/hmc6352.c                        |   2 +-
 drivers/misc/hpilo.c                          |   6 +-
 drivers/misc/ibmasm/module.c                  |   2 +-
 drivers/misc/ibmvmc.c                         |   4 +-
 drivers/misc/ics932s401.c                     |   2 +-
 drivers/misc/isl29003.c                       |   4 +-
 drivers/misc/isl29020.c                       |   2 +-
 drivers/misc/keba/lan9252.c                   |   4 +-
 drivers/misc/lattice-ecp3-config.c            |   4 +-
 drivers/misc/lis3lv02d/lis3lv02d_i2c.c        |   8 +-
 drivers/misc/lis3lv02d/lis3lv02d_spi.c        |   2 +-
 drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c |   2 +-
 .../misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c   |   4 +-
 .../misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c |   4 +-
 drivers/misc/mei/pci-csc.c                    |   2 +-
 drivers/misc/mei/pci-me.c                     | 166 +++++++-------
 drivers/misc/mei/pci-txe.c                    |   6 +-
 drivers/misc/mei/platform-vsc.c               |   2 +-
 drivers/misc/mei/vsc-tp.c                     |  10 +-
 drivers/misc/mrvl_cn10k_dpi.c                 |   2 +-
 drivers/misc/nsm.c                            |   2 +-
 drivers/misc/ocxl/pci.c                       |   2 +-
 drivers/misc/open-dice.c                      |   2 +-
 drivers/misc/pci_endpoint_test.c              |  16 +-
 drivers/misc/phantom.c                        |   6 +-
 drivers/misc/pvpanic/pvpanic-mmio.c           |   8 +-
 drivers/misc/pvpanic/pvpanic-pci.c            |   4 +-
 drivers/misc/qcom-coincell.c                  |   4 +-
 drivers/misc/rp1/rp1_pci.c                    |   2 +-
 drivers/misc/sram.c                           |   2 +-
 drivers/misc/ti_fpc202.c                      |   2 +-
 drivers/misc/tsl2550.c                        |   2 +-
 drivers/misc/vcpu_stall_detector.c            |   4 +-
 drivers/misc/vmw_vmci/vmci_guest.c            |   4 +-
 50 files changed, 362 insertions(+), 381 deletions(-)

base-commit: 1a1757b76427f6201bfe0bf1bea9f7574f332a93

Signature · 1 line
2.55.0.11.g153666a7d9bb
#1 lore raw

PATCH v2 1/12 misc: Drop unused assignment of spi_device_id driver data

The drivers don't make use of the values that were explicitly assigned to the .driver_data members. Drop these assignments.

---
 drivers/misc/gehc-achc.c           | 4 ++--
 drivers/misc/lattice-ecp3-config.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/misc/gehc-achc.c +2 -2
index b8fca4d393c6..1abfa6c257de 100644
@@ -538,8 +538,8 @@ static int gehc_achc_probe(struct spi_device *spi)
 }
 
 static const struct spi_device_id gehc_achc_id[] = {
-	{ "ge,achc", 0 },
-	{ "achc", 0 },
+	{ "ge,achc" },
+	{ "achc" },
 	{ }
 };
 MODULE_DEVICE_TABLE(spi, gehc_achc_id);
drivers/misc/lattice-ecp3-config.c +2 -2
index 93949df3bcff..2b93d5660bf2 100644
@@ -219,8 +219,8 @@ static void lattice_ecp3_remove(struct spi_device *spi)
 }
 
 static const struct spi_device_id lattice_ecp3_id[] = {
-	{ "ecp3-17", 0 },
-	{ "ecp3-35", 0 },
+	{ "ecp3-17" },
+	{ "ecp3-35" },
 	{ }
 };
 MODULE_DEVICE_TABLE(spi, lattice_ecp3_id);
Signature · 1 line
2.55.0.11.g153666a7d9bb
#2 lore raw

PATCH v2 2/12 misc/pvpanic: Drop unused assignment of acpi_device_id driver data

In reply to Uwe Kleine-König (The Capable Hub)

The driver explicitly sets the .driver_data member of struct acpi_device_id to zero without relying on that value. Drop this unused assignments.

While touching this array simplify the list terminator and use a named initalizer.

This patch doesn't modify the compiled array, only its representation in source form benefits.

---
 drivers/misc/pvpanic/pvpanic-mmio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/misc/pvpanic/pvpanic-mmio.c +2 -2
index bedcda9b6ac5..43a094bfdaec 100644
@@ -57,8 +57,8 @@ static const struct of_device_id pvpanic_mmio_match[] = {
 MODULE_DEVICE_TABLE(of, pvpanic_mmio_match);
 
 static const struct acpi_device_id pvpanic_device_ids[] = {
-	{ "QEMU0001", 0 },
-	{ "", 0 }
+	{ .id = "QEMU0001" },
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, pvpanic_device_ids);
 
Signature · 1 line
2.55.0.11.g153666a7d9bb
#3 lore raw

PATCH v2 3/12 misc: genwqe: Drop unused assignment of pci_device_id driver data

In reply to Uwe Kleine-König (The Capable Hub)

The driver explicitly sets the .driver_data member of struct pci_device_id to zero without relying on that value. Drop this unused assignment.

While touching this array, also convert it to use one of the PCI_DEVICE macros that is usually used for these and drop the explicit 0 in the list terminator. This patch doesn't modify the compiled array.

---
 drivers/misc/genwqe/card_base.c | 88 +++++++++++++--------------------
 1 file changed, 35 insertions(+), 53 deletions(-)
drivers/misc/genwqe/card_base.c +35 -53
index 86bfa82723ff..e602eb3c51fa 100644
@@ -48,60 +48,42 @@ static struct genwqe_dev *genwqe_devices[GENWQE_CARD_NO_MAX];
 
 /* PCI structure for identifying device by PCI vendor and device ID */
 static const struct pci_device_id genwqe_device_table[] = {
-	{ .vendor      = PCI_VENDOR_ID_IBM,
-	  .device      = PCI_DEVICE_GENWQE,
-	  .subvendor   = PCI_SUBVENDOR_ID_IBM,
-	  .subdevice   = PCI_SUBSYSTEM_ID_GENWQE5,
-	  .class       = (PCI_CLASSCODE_GENWQE5 << 8),
-	  .class_mask  = ~0,
-	  .driver_data = 0 },
-
-	/* Initial SR-IOV bring-up image */
-	{ .vendor      = PCI_VENDOR_ID_IBM,
-	  .device      = PCI_DEVICE_GENWQE,
-	  .subvendor   = PCI_SUBVENDOR_ID_IBM_SRIOV,
-	  .subdevice   = PCI_SUBSYSTEM_ID_GENWQE5_SRIOV,
-	  .class       = (PCI_CLASSCODE_GENWQE5_SRIOV << 8),
-	  .class_mask  = ~0,
-	  .driver_data = 0 },
-
-	{ .vendor      = PCI_VENDOR_ID_IBM,  /* VF Vendor ID */
-	  .device      = 0x0000,  /* VF Device ID */
-	  .subvendor   = PCI_SUBVENDOR_ID_IBM_SRIOV,
-	  .subdevice   = PCI_SUBSYSTEM_ID_GENWQE5_SRIOV,
-	  .class       = (PCI_CLASSCODE_GENWQE5_SRIOV << 8),
-	  .class_mask  = ~0,
-	  .driver_data = 0 },
-
-	/* Fixed up image */
-	{ .vendor      = PCI_VENDOR_ID_IBM,
-	  .device      = PCI_DEVICE_GENWQE,
-	  .subvendor   = PCI_SUBVENDOR_ID_IBM_SRIOV,
-	  .subdevice   = PCI_SUBSYSTEM_ID_GENWQE5,
-	  .class       = (PCI_CLASSCODE_GENWQE5_SRIOV << 8),
-	  .class_mask  = ~0,
-	  .driver_data = 0 },
-
-	{ .vendor      = PCI_VENDOR_ID_IBM,  /* VF Vendor ID */
-	  .device      = 0x0000,  /* VF Device ID */
-	  .subvendor   = PCI_SUBVENDOR_ID_IBM_SRIOV,
-	  .subdevice   = PCI_SUBSYSTEM_ID_GENWQE5,
-	  .class       = (PCI_CLASSCODE_GENWQE5_SRIOV << 8),
-	  .class_mask  = ~0,
-	  .driver_data = 0 },
-
-	/* Even one more ... */
-	{ .vendor      = PCI_VENDOR_ID_IBM,
-	  .device      = PCI_DEVICE_GENWQE,
-	  .subvendor   = PCI_SUBVENDOR_ID_IBM,
-	  .subdevice   = PCI_SUBSYSTEM_ID_GENWQE5_NEW,
-	  .class       = (PCI_CLASSCODE_GENWQE5 << 8),
-	  .class_mask  = ~0,
-	  .driver_data = 0 },
-
-	{ 0, }			/* 0 terminated list. */
+	{
+		PCI_DEVICE_SUB(PCI_VENDOR_ID_IBM, PCI_DEVICE_GENWQE,
+			       PCI_SUBVENDOR_ID_IBM, PCI_SUBSYSTEM_ID_GENWQE5),
+		.class       = PCI_CLASSCODE_GENWQE5 << 8,
+		.class_mask  = ~0,
+	}, {
+		/* Initial SR-IOV bring-up image */
+		PCI_DEVICE_SUB(PCI_VENDOR_ID_IBM, PCI_VENDOR_ID_IBM, PCI_DEVICE_GENWQE,
+			       PCI_SUBVENDOR_ID_IBM_SRIOV),
+		.class       = PCI_CLASSCODE_GENWQE5_SRIOV << 8,
+		.class_mask  = ~0,
+	}, {
+		PCI_DEVICE_SUB(PCI_VENDOR_ID_IBM, 0x0000,
+			       PCI_SUBVENDOR_ID_IBM_SRIOV, PCI_SUBSYSTEM_ID_GENWQE5_SRIOV),
+		.class       = PCI_CLASSCODE_GENWQE5_SRIOV << 8,
+		.class_mask  = ~0,
+	}, {
+		/* Fixed up image */
+		PCI_DEVICE_SUB(PCI_VENDOR_ID_IBM, PCI_DEVICE_GENWQE,
+			       PCI_SUBVENDOR_ID_IBM_SRIOV, PCI_SUBSYSTEM_ID_GENWQE5),
+		.class       = PCI_CLASSCODE_GENWQE5_SRIOV << 8,
+		.class_mask  = ~0,
+	}, {
+		PCI_DEVICE_SUB(PCI_VENDOR_ID_IBM, 0x0000,
+			       PCI_SUBVENDOR_ID_IBM_SRIOV, PCI_SUBSYSTEM_ID_GENWQE5),
+		.class       = PCI_CLASSCODE_GENWQE5_SRIOV << 8,
+		.class_mask  = ~0,
+	}, {
+		/* Even one more ... */
+		PCI_DEVICE_SUB(PCI_VENDOR_ID_IBM, PCI_DEVICE_GENWQE,
+			       PCI_SUBVENDOR_ID_IBM, PCI_SUBSYSTEM_ID_GENWQE5_NEW),
+		.class       = (PCI_CLASSCODE_GENWQE5 << 8),
+		.class_mask  = ~0,
+	},
+	{ }			/* 0 terminated list. */
 };
-
 MODULE_DEVICE_TABLE(pci, genwqe_device_table);
 
 /**
Signature · 1 line
2.55.0.11.g153666a7d9bb
#4 lore raw

PATCH v2 4/12 misc: eeprom: Use named initializers for arrays of i2c_device_data

In reply to Uwe Kleine-König (The Capable Hub)

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

While touching all these arrays, unify usage of whitespace.

This patch doesn't modify the compiled arrays, only their representation in source form benefits.

---
 drivers/misc/eeprom/idt_89hpesx.c | 108 +++++++++++++++---------------
 drivers/misc/eeprom/max6875.c     |   2 +-
 2 files changed, 55 insertions(+), 55 deletions(-)
drivers/misc/eeprom/idt_89hpesx.c +54 -54
index e056d2dea8c3..5bc0294349a0 100644
@@ -1375,12 +1375,12 @@ static void idt_remove(struct i2c_client *client)
  * ee_ids - array of supported EEPROMs
  */
 static const struct i2c_device_id ee_ids[] = {
-	{ "24c32",  4096},
-	{ "24c64",  8192},
-	{ "24c128", 16384},
-	{ "24c256", 32768},
-	{ "24c512", 65536},
-	{}
+	{ .name = "24c32", .driver_data = 4096 },
+	{ .name = "24c64", .driver_data = 8192 },
+	{ .name = "24c128", .driver_data = 16384 },
+	{ .name = "24c256", .driver_data = 32768 },
+	{ .name = "24c512", .driver_data = 65536 },
+	{ }
 };
 MODULE_DEVICE_TABLE(i2c, ee_ids);
 
@@ -1388,58 +1388,58 @@ MODULE_DEVICE_TABLE(i2c, ee_ids);
  * idt_ids - supported IDT 89HPESx devices
  */
 static const struct i2c_device_id idt_ids[] = {
-	{ "89hpes8nt2" },
-	{ "89hpes12nt3" },
+	{ .name = "89hpes8nt2" },
+	{ .name = "89hpes12nt3" },
 
-	{ "89hpes24nt6ag2" },
-	{ "89hpes32nt8ag2" },
-	{ "89hpes32nt8bg2" },
-	{ "89hpes12nt12g2" },
-	{ "89hpes16nt16g2" },
-	{ "89hpes24nt24g2" },
-	{ "89hpes32nt24ag2" },
-	{ "89hpes32nt24bg2" },
+	{ .name = "89hpes24nt6ag2" },
+	{ .name = "89hpes32nt8ag2" },
+	{ .name = "89hpes32nt8bg2" },
+	{ .name = "89hpes12nt12g2" },
+	{ .name = "89hpes16nt16g2" },
+	{ .name = "89hpes24nt24g2" },
+	{ .name = "89hpes32nt24ag2" },
+	{ .name = "89hpes32nt24bg2" },
 
-	{ "89hpes12n3" },
-	{ "89hpes12n3a" },
-	{ "89hpes24n3" },
-	{ "89hpes24n3a" },
+	{ .name = "89hpes12n3" },
+	{ .name = "89hpes12n3a" },
+	{ .name = "89hpes24n3" },
+	{ .name = "89hpes24n3a" },
 
-	{ "89hpes32h8" },
-	{ "89hpes32h8g2" },
-	{ "89hpes48h12" },
-	{ "89hpes48h12g2" },
-	{ "89hpes48h12ag2" },
-	{ "89hpes16h16" },
-	{ "89hpes22h16" },
-	{ "89hpes22h16g2" },
-	{ "89hpes34h16" },
-	{ "89hpes34h16g2" },
-	{ "89hpes64h16" },
-	{ "89hpes64h16g2" },
-	{ "89hpes64h16ag2" },
+	{ .name = "89hpes32h8" },
+	{ .name = "89hpes32h8g2" },
+	{ .name = "89hpes48h12" },
+	{ .name = "89hpes48h12g2" },
+	{ .name = "89hpes48h12ag2" },
+	{ .name = "89hpes16h16" },
+	{ .name = "89hpes22h16" },
+	{ .name = "89hpes22h16g2" },
+	{ .name = "89hpes34h16" },
+	{ .name = "89hpes34h16g2" },
+	{ .name = "89hpes64h16" },
+	{ .name = "89hpes64h16g2" },
+	{ .name = "89hpes64h16ag2" },
 
-	/* { "89hpes3t3" }, // No SMBus-slave iface */
-	{ "89hpes12t3g2" },
-	{ "89hpes24t3g2" },
-	/* { "89hpes4t4" }, // No SMBus-slave iface */
-	{ "89hpes16t4" },
-	{ "89hpes4t4g2" },
-	{ "89hpes10t4g2" },
-	{ "89hpes16t4g2" },
-	{ "89hpes16t4ag2" },
-	{ "89hpes5t5" },
-	{ "89hpes6t5" },
-	{ "89hpes8t5" },
-	{ "89hpes8t5a" },
-	{ "89hpes24t6" },
-	{ "89hpes6t6g2" },
-	{ "89hpes24t6g2" },
-	{ "89hpes16t7" },
-	{ "89hpes32t8" },
-	{ "89hpes32t8g2" },
-	{ "89hpes48t12" },
-	{ "89hpes48t12g2" },
+	/* { .name = "89hpes3t3" }, // No SMBus-slave iface */
+	{ .name = "89hpes12t3g2" },
+	{ .name = "89hpes24t3g2" },
+	/* { .name = "89hpes4t4" }, // No SMBus-slave iface */
+	{ .name = "89hpes16t4" },
+	{ .name = "89hpes4t4g2" },
+	{ .name = "89hpes10t4g2" },
+	{ .name = "89hpes16t4g2" },
+	{ .name = "89hpes16t4ag2" },
+	{ .name = "89hpes5t5" },
+	{ .name = "89hpes6t5" },
+	{ .name = "89hpes8t5" },
+	{ .name = "89hpes8t5a" },
+	{ .name = "89hpes24t6" },
+	{ .name = "89hpes6t6g2" },
+	{ .name = "89hpes24t6g2" },
+	{ .name = "89hpes16t7" },
+	{ .name = "89hpes32t8" },
+	{ .name = "89hpes32t8g2" },
+	{ .name = "89hpes48t12" },
+	{ .name = "89hpes48t12g2" },
 	{ /* END OF LIST */ }
 };
 MODULE_DEVICE_TABLE(i2c, idt_ids);
drivers/misc/eeprom/max6875.c +1 -1
index 5731d2dc8a57..be5e6d19be10 100644
@@ -183,7 +183,7 @@ static void max6875_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id max6875_id[] = {
-	{ "max6875" },
+	{ .name = "max6875" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, max6875_id);
Signature · 1 line
2.55.0.11.g153666a7d9bb
#5 lore raw

PATCH v2 5/12 misc: Use named initializers for arrays of i2c_device_data

In reply to Uwe Kleine-König (The Capable Hub)

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct i2c_device_id that replaces .driver_data by an anonymous union.

While touching all these arrays, unify usage of whitespace.

This patch doesn't modify the compiled arrays, only their representation in source form benefits.

---
 drivers/misc/ad525x_dpot-i2c.c         | 52 +++++++++++++-------------
 drivers/misc/amd-sbi/rmi-i2c.c         |  4 +-
 drivers/misc/apds9802als.c             |  2 +-
 drivers/misc/bh1770glc.c               |  6 +--
 drivers/misc/ds1682.c                  |  2 +-
 drivers/misc/hmc6352.c                 |  2 +-
 drivers/misc/ics932s401.c              |  2 +-
 drivers/misc/isl29003.c                |  4 +-
 drivers/misc/isl29020.c                |  2 +-
 drivers/misc/lis3lv02d/lis3lv02d_i2c.c |  6 +--
 drivers/misc/tsl2550.c                 |  2 +-
 11 files changed, 42 insertions(+), 42 deletions(-)
drivers/misc/ad525x_dpot-i2c.c +26 -26
index 469478f7a1d3..e02be9098b3b 100644
@@ -73,32 +73,32 @@ static void ad_dpot_i2c_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id ad_dpot_id[] = {
-	{"ad5258", AD5258_ID},
-	{"ad5259", AD5259_ID},
-	{"ad5251", AD5251_ID},
-	{"ad5252", AD5252_ID},
-	{"ad5253", AD5253_ID},
-	{"ad5254", AD5254_ID},
-	{"ad5255", AD5255_ID},
-	{"ad5241", AD5241_ID},
-	{"ad5242", AD5242_ID},
-	{"ad5243", AD5243_ID},
-	{"ad5245", AD5245_ID},
-	{"ad5246", AD5246_ID},
-	{"ad5247", AD5247_ID},
-	{"ad5248", AD5248_ID},
-	{"ad5280", AD5280_ID},
-	{"ad5282", AD5282_ID},
-	{"adn2860", ADN2860_ID},
-	{"ad5273", AD5273_ID},
-	{"ad5161", AD5161_ID},
-	{"ad5171", AD5171_ID},
-	{"ad5170", AD5170_ID},
-	{"ad5172", AD5172_ID},
-	{"ad5173", AD5173_ID},
-	{"ad5272", AD5272_ID},
-	{"ad5274", AD5274_ID},
-	{}
+	{ .name = "ad5258", .driver_data = AD5258_ID },
+	{ .name = "ad5259", .driver_data = AD5259_ID },
+	{ .name = "ad5251", .driver_data = AD5251_ID },
+	{ .name = "ad5252", .driver_data = AD5252_ID },
+	{ .name = "ad5253", .driver_data = AD5253_ID },
+	{ .name = "ad5254", .driver_data = AD5254_ID },
+	{ .name = "ad5255", .driver_data = AD5255_ID },
+	{ .name = "ad5241", .driver_data = AD5241_ID },
+	{ .name = "ad5242", .driver_data = AD5242_ID },
+	{ .name = "ad5243", .driver_data = AD5243_ID },
+	{ .name = "ad5245", .driver_data = AD5245_ID },
+	{ .name = "ad5246", .driver_data = AD5246_ID },
+	{ .name = "ad5247", .driver_data = AD5247_ID },
+	{ .name = "ad5248", .driver_data = AD5248_ID },
+	{ .name = "ad5280", .driver_data = AD5280_ID },
+	{ .name = "ad5282", .driver_data = AD5282_ID },
+	{ .name = "adn2860", .driver_data = ADN2860_ID },
+	{ .name = "ad5273", .driver_data = AD5273_ID },
+	{ .name = "ad5161", .driver_data = AD5161_ID },
+	{ .name = "ad5171", .driver_data = AD5171_ID },
+	{ .name = "ad5170", .driver_data = AD5170_ID },
+	{ .name = "ad5172", .driver_data = AD5172_ID },
+	{ .name = "ad5173", .driver_data = AD5173_ID },
+	{ .name = "ad5272", .driver_data = AD5272_ID },
+	{ .name = "ad5274", .driver_data = AD5274_ID },
+	{ }
 };
 MODULE_DEVICE_TABLE(i2c, ad_dpot_id);
 
drivers/misc/amd-sbi/rmi-i2c.c +2 -2
index 37e5ea83bf97..bbc0d14d1cfc 100644
@@ -141,8 +141,8 @@ static void sbrmi_i2c_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id sbrmi_id[] = {
-	{"sbrmi-i2c"},
-	{}
+	{ .name = "sbrmi-i2c" },
+	{ }
 };
 MODULE_DEVICE_TABLE(i2c, sbrmi_id);
 
drivers/misc/apds9802als.c +1 -1
index fc504bd8d916..1488e28819b7 100644
@@ -285,7 +285,7 @@ static UNIVERSAL_DEV_PM_OPS(apds9802als_pm_ops, apds9802als_suspend,
 #endif	/* CONFIG_PM */
 
 static const struct i2c_device_id apds9802als_id[] = {
-	{ DRIVER_NAME },
+	{ .name = DRIVER_NAME },
 	{ }
 };
 
drivers/misc/bh1770glc.c +3 -3
index 45f8fc69a711..98fc5970b2bb 100644
@@ -1363,9 +1363,9 @@ static int bh1770_runtime_resume(struct device *dev)
 #endif
 
 static const struct i2c_device_id bh1770_id[] = {
-	{ "bh1770glc" },
-	{ "sfh7770" },
-	{}
+	{ .name = "bh1770glc" },
+	{ .name = "sfh7770" },
+	{ }
 };
 
 MODULE_DEVICE_TABLE(i2c, bh1770_id);
drivers/misc/ds1682.c +1 -1
index cb09e056531a..f073a5067fc8 100644
@@ -271,7 +271,7 @@ static void ds1682_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id ds1682_id[] = {
-	{ "ds1682" },
+	{ .name = "ds1682" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, ds1682_id);
drivers/misc/hmc6352.c +1 -1
index ff92c6edff6b..275dc054ca04 100644
@@ -121,7 +121,7 @@ static void hmc6352_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id hmc6352_id[] = {
-	{ "hmc6352" },
+	{ .name = "hmc6352" },
 	{ }
 };
 
drivers/misc/ics932s401.c +1 -1
index 015710762a65..e8bcf0df2da8 100644
@@ -95,7 +95,7 @@ static int ics932s401_detect(struct i2c_client *client,
 static void ics932s401_remove(struct i2c_client *client);
 
 static const struct i2c_device_id ics932s401_id[] = {
-	{ "ics932s401" },
+	{ .name = "ics932s401" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, ics932s401_id);
drivers/misc/isl29003.c +2 -2
index 95480e16ae5f..c9b526a212d0 100644
@@ -449,8 +449,8 @@ static SIMPLE_DEV_PM_OPS(isl29003_pm_ops, isl29003_suspend, isl29003_resume);
 #endif /* CONFIG_PM_SLEEP */
 
 static const struct i2c_device_id isl29003_id[] = {
-	{ "isl29003" },
-	{}
+	{ .name = "isl29003" },
+	{ }
 };
 MODULE_DEVICE_TABLE(i2c, isl29003_id);
 
drivers/misc/isl29020.c +1 -1
index c288aeec16c0..dd966db28ec4 100644
@@ -177,7 +177,7 @@ static void isl29020_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id isl29020_id[] = {
-	{ "isl29020" },
+	{ .name = "isl29020" },
 	{ }
 };
 
drivers/misc/lis3lv02d/lis3lv02d_i2c.c +3 -3
index 15119584473c..36032fc125f3 100644
@@ -247,9 +247,9 @@ static int lis3_i2c_runtime_resume(struct device *dev)
 #endif /* CONFIG_PM */
 
 static const struct i2c_device_id lis3lv02d_id[] = {
-	{"lis3lv02d", LIS3LV02D},
-	{"lis331dlh", LIS331DLH},
-	{}
+	{ .name = "lis3lv02d", .driver_data = LIS3LV02D },
+	{ .name = "lis331dlh", .driver_data = LIS331DLH },
+	{ }
 };
 
 MODULE_DEVICE_TABLE(i2c, lis3lv02d_id);
drivers/misc/tsl2550.c +1 -1
index 03f19eda641e..c871ea860bb5 100644
@@ -420,7 +420,7 @@ static SIMPLE_DEV_PM_OPS(tsl2550_pm_ops, tsl2550_suspend, tsl2550_resume);
 #endif /* CONFIG_PM_SLEEP */
 
 static const struct i2c_device_id tsl2550_id[] = {
-	{ "tsl2550" },
+	{ .name = "tsl2550" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, tsl2550_id);
Signature · 1 line
2.55.0.11.g153666a7d9bb
#6 lore raw

PATCH v2 6/12 misc: Use named initializers for arrays of spi_device_data

In reply to Uwe Kleine-König (The Capable Hub)

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct spi_device_id that replaces .driver_data by an anonymous union.

While touching all these arrays, unify usage of whitespace.

This patch doesn't modify the compiled arrays, only their representation in source form benefits.

---
 drivers/misc/ad525x_dpot-spi.c     | 58 +++++++++++++++---------------
 drivers/misc/gehc-achc.c           |  4 +--
 drivers/misc/keba/lan9252.c        |  4 +--
 drivers/misc/lattice-ecp3-config.c |  4 +--
 4 files changed, 35 insertions(+), 35 deletions(-)
drivers/misc/ad525x_dpot-spi.c +29 -29
index 263055bda48b..b582a14a3546 100644
@@ -96,35 +96,35 @@ static void ad_dpot_spi_remove(struct spi_device *spi)
 }
 
 static const struct spi_device_id ad_dpot_spi_id[] = {
-	{"ad5160", AD5160_ID},
-	{"ad5161", AD5161_ID},
-	{"ad5162", AD5162_ID},
-	{"ad5165", AD5165_ID},
-	{"ad5200", AD5200_ID},
-	{"ad5201", AD5201_ID},
-	{"ad5203", AD5203_ID},
-	{"ad5204", AD5204_ID},
-	{"ad5206", AD5206_ID},
-	{"ad5207", AD5207_ID},
-	{"ad5231", AD5231_ID},
-	{"ad5232", AD5232_ID},
-	{"ad5233", AD5233_ID},
-	{"ad5235", AD5235_ID},
-	{"ad5260", AD5260_ID},
-	{"ad5262", AD5262_ID},
-	{"ad5263", AD5263_ID},
-	{"ad5290", AD5290_ID},
-	{"ad5291", AD5291_ID},
-	{"ad5292", AD5292_ID},
-	{"ad5293", AD5293_ID},
-	{"ad7376", AD7376_ID},
-	{"ad8400", AD8400_ID},
-	{"ad8402", AD8402_ID},
-	{"ad8403", AD8403_ID},
-	{"adn2850", ADN2850_ID},
-	{"ad5270", AD5270_ID},
-	{"ad5271", AD5271_ID},
-	{}
+	{ .name = "ad5160", .driver_data = AD5160_ID },
+	{ .name = "ad5161", .driver_data = AD5161_ID },
+	{ .name = "ad5162", .driver_data = AD5162_ID },
+	{ .name = "ad5165", .driver_data = AD5165_ID },
+	{ .name = "ad5200", .driver_data = AD5200_ID },
+	{ .name = "ad5201", .driver_data = AD5201_ID },
+	{ .name = "ad5203", .driver_data = AD5203_ID },
+	{ .name = "ad5204", .driver_data = AD5204_ID },
+	{ .name = "ad5206", .driver_data = AD5206_ID },
+	{ .name = "ad5207", .driver_data = AD5207_ID },
+	{ .name = "ad5231", .driver_data = AD5231_ID },
+	{ .name = "ad5232", .driver_data = AD5232_ID },
+	{ .name = "ad5233", .driver_data = AD5233_ID },
+	{ .name = "ad5235", .driver_data = AD5235_ID },
+	{ .name = "ad5260", .driver_data = AD5260_ID },
+	{ .name = "ad5262", .driver_data = AD5262_ID },
+	{ .name = "ad5263", .driver_data = AD5263_ID },
+	{ .name = "ad5290", .driver_data = AD5290_ID },
+	{ .name = "ad5291", .driver_data = AD5291_ID },
+	{ .name = "ad5292", .driver_data = AD5292_ID },
+	{ .name = "ad5293", .driver_data = AD5293_ID },
+	{ .name = "ad7376", .driver_data = AD7376_ID },
+	{ .name = "ad8400", .driver_data = AD8400_ID },
+	{ .name = "ad8402", .driver_data = AD8402_ID },
+	{ .name = "ad8403", .driver_data = AD8403_ID },
+	{ .name = "adn2850", .driver_data = ADN2850_ID },
+	{ .name = "ad5270", .driver_data = AD5270_ID },
+	{ .name = "ad5271", .driver_data = AD5271_ID },
+	{ }
 };
 MODULE_DEVICE_TABLE(spi, ad_dpot_spi_id);
 
drivers/misc/gehc-achc.c +2 -2
index 1abfa6c257de..9792189c0923 100644
@@ -538,8 +538,8 @@ static int gehc_achc_probe(struct spi_device *spi)
 }
 
 static const struct spi_device_id gehc_achc_id[] = {
-	{ "ge,achc" },
-	{ "achc" },
+	{ .name = "ge,achc" },
+	{ .name = "achc" },
 	{ }
 };
 MODULE_DEVICE_TABLE(spi, gehc_achc_id);
drivers/misc/keba/lan9252.c +2 -2
index fc54afd1d05b..874dd50fac66 100644
@@ -339,8 +339,8 @@ static int lan9252_probe(struct spi_device *spi)
 }
 
 static const struct spi_device_id lan9252_id[] = {
-	{"lan9252"},
-	{}
+	{ .name = "lan9252" },
+	{ }
 };
 MODULE_DEVICE_TABLE(spi, lan9252_id);
 
drivers/misc/lattice-ecp3-config.c +2 -2
index 2b93d5660bf2..740b5cf53842 100644
@@ -219,8 +219,8 @@ static void lattice_ecp3_remove(struct spi_device *spi)
 }
 
 static const struct spi_device_id lattice_ecp3_id[] = {
-	{ "ecp3-17" },
-	{ "ecp3-35" },
+	{ .name = "ecp3-17" },
+	{ .name = "ecp3-35" },
 	{ }
 };
 MODULE_DEVICE_TABLE(spi, lattice_ecp3_id);
Signature · 1 line
2.55.0.11.g153666a7d9bb
#8 lore raw

PATCH v2 7/12 misc: mei: Use named initializers for acpi_device_id array

In reply to Uwe Kleine-König (The Capable Hub)

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

While touching this array, add a space to the list terminator to make it match the most common usage.

---
 drivers/misc/mei/vsc-tp.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/misc/mei/vsc-tp.c +5 -5
index 5ecf99883996..432bc59f11f9 100644
@@ -552,11 +552,11 @@ static void vsc_tp_remove(struct spi_device *spi)
 }
 
 static const struct acpi_device_id vsc_tp_acpi_ids[] = {
-	{ "INTC1009" }, /* Raptor Lake */
-	{ "INTC1058" }, /* Tiger Lake */
-	{ "INTC1094" }, /* Alder Lake */
-	{ "INTC10D0" }, /* Meteor Lake */
-	{}
+	{ .id = "INTC1009" }, /* Raptor Lake */
+	{ .id = "INTC1058" }, /* Tiger Lake */
+	{ .id = "INTC1094" }, /* Alder Lake */
+	{ .id = "INTC10D0" }, /* Meteor Lake */
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, vsc_tp_acpi_ids);
 
Signature · 1 line
2.55.0.11.g153666a7d9bb
#9 lore raw

PATCH v2 8/12 misc: mei: Use named initializer for platform_device_id array

In reply to Uwe Kleine-König (The Capable Hub)

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct platform_device_id that replaces .driver_data by an anonymous union (though this driver doesn't use .driver_data, so this patch isn't strictly necessary for the plan, but still ok for consistency).

This patch doesn't modify the compiled array, only its representation in source form benefits.

---
 drivers/misc/mei/platform-vsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/mei/platform-vsc.c +1 -1
index 5100234ba5b6..ef6dcc043862 100644
@@ -435,7 +435,7 @@ static int mei_vsc_resume(struct device *dev)
 static DEFINE_SIMPLE_DEV_PM_OPS(mei_vsc_pm_ops, mei_vsc_suspend, mei_vsc_resume);
 
 static const struct platform_device_id mei_vsc_id_table[] = {
-	{ MEI_VSC_DRV_NAME },
+	{ .name = MEI_VSC_DRV_NAME },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(platform, mei_vsc_id_table);
Signature · 1 line
2.55.0.11.g153666a7d9bb
#10 lore raw

PATCH v2 9/12 misc: ibmvmc: Use named initializers for vio_device_id array

In reply to Uwe Kleine-König (The Capable Hub)

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

While touching this array, also simplify the list terminator. This change doesn't introduce differences to the compiled result.

---
 drivers/misc/ibmvmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/misc/ibmvmc.c +2 -2
index beb18c34f20d..a1d4955db5f3 100644
@@ -2298,8 +2298,8 @@ static void ibmvmc_remove(struct vio_dev *vdev)
 }
 
 static struct vio_device_id ibmvmc_device_table[] = {
-	{ "ibm,vmc", "IBM,vmc" },
-	{ "", "" }
+	{ .type = "ibm,vmc", .compat = "IBM,vmc" },
+	{ }
 };
 MODULE_DEVICE_TABLE(vio, ibmvmc_device_table);
 
Signature · 1 line
2.55.0.11.g153666a7d9bb
#11 lore raw

PATCH v2 10/12 misc: eeprom: idt_89hpesx: Unify style of of_device_id array

In reply to Uwe Kleine-König (The Capable Hub)

Update the of_device_id array to conform to the most used and generally recommended coding style. That is:

- No comma after the list terminator;
- A comma after an initializer if (and only if) the closing } is not directly following;
- No explicit zeros in the list terminator;
- A space after an opening { and before a closing }, a single space in the list terminator;

Adapt the driver's array accordingly.

---
 drivers/misc/eeprom/idt_89hpesx.c | 94 +++++++++++++++----------------
 1 file changed, 47 insertions(+), 47 deletions(-)
drivers/misc/eeprom/idt_89hpesx.c +47 -47
index 5bc0294349a0..ea7478cfdd27 100644
@@ -1445,58 +1445,58 @@ static const struct i2c_device_id idt_ids[] = {
 MODULE_DEVICE_TABLE(i2c, idt_ids);
 
 static const struct of_device_id idt_of_match[] = {
-	{ .compatible = "idt,89hpes8nt2", },
-	{ .compatible = "idt,89hpes12nt3", },
+	{ .compatible = "idt,89hpes8nt2" },
+	{ .compatible = "idt,89hpes12nt3" },
 
-	{ .compatible = "idt,89hpes24nt6ag2", },
-	{ .compatible = "idt,89hpes32nt8ag2", },
-	{ .compatible = "idt,89hpes32nt8bg2", },
-	{ .compatible = "idt,89hpes12nt12g2", },
-	{ .compatible = "idt,89hpes16nt16g2", },
-	{ .compatible = "idt,89hpes24nt24g2", },
-	{ .compatible = "idt,89hpes32nt24ag2", },
-	{ .compatible = "idt,89hpes32nt24bg2", },
+	{ .compatible = "idt,89hpes24nt6ag2" },
+	{ .compatible = "idt,89hpes32nt8ag2" },
+	{ .compatible = "idt,89hpes32nt8bg2" },
+	{ .compatible = "idt,89hpes12nt12g2" },
+	{ .compatible = "idt,89hpes16nt16g2" },
+	{ .compatible = "idt,89hpes24nt24g2" },
+	{ .compatible = "idt,89hpes32nt24ag2" },
+	{ .compatible = "idt,89hpes32nt24bg2" },
 
-	{ .compatible = "idt,89hpes12n3", },
-	{ .compatible = "idt,89hpes12n3a", },
-	{ .compatible = "idt,89hpes24n3", },
-	{ .compatible = "idt,89hpes24n3a", },
+	{ .compatible = "idt,89hpes12n3" },
+	{ .compatible = "idt,89hpes12n3a" },
+	{ .compatible = "idt,89hpes24n3" },
+	{ .compatible = "idt,89hpes24n3a" },
 
-	{ .compatible = "idt,89hpes32h8", },
-	{ .compatible = "idt,89hpes32h8g2", },
-	{ .compatible = "idt,89hpes48h12", },
-	{ .compatible = "idt,89hpes48h12g2", },
-	{ .compatible = "idt,89hpes48h12ag2", },
-	{ .compatible = "idt,89hpes16h16", },
-	{ .compatible = "idt,89hpes22h16", },
-	{ .compatible = "idt,89hpes22h16g2", },
-	{ .compatible = "idt,89hpes34h16", },
-	{ .compatible = "idt,89hpes34h16g2", },
-	{ .compatible = "idt,89hpes64h16", },
-	{ .compatible = "idt,89hpes64h16g2", },
-	{ .compatible = "idt,89hpes64h16ag2", },
+	{ .compatible = "idt,89hpes32h8" },
+	{ .compatible = "idt,89hpes32h8g2" },
+	{ .compatible = "idt,89hpes48h12" },
+	{ .compatible = "idt,89hpes48h12g2" },
+	{ .compatible = "idt,89hpes48h12ag2" },
+	{ .compatible = "idt,89hpes16h16" },
+	{ .compatible = "idt,89hpes22h16" },
+	{ .compatible = "idt,89hpes22h16g2" },
+	{ .compatible = "idt,89hpes34h16" },
+	{ .compatible = "idt,89hpes34h16g2" },
+	{ .compatible = "idt,89hpes64h16" },
+	{ .compatible = "idt,89hpes64h16g2" },
+	{ .compatible = "idt,89hpes64h16ag2" },
 
-	{ .compatible = "idt,89hpes12t3g2", },
-	{ .compatible = "idt,89hpes24t3g2", },
+	{ .compatible = "idt,89hpes12t3g2" },
+	{ .compatible = "idt,89hpes24t3g2" },
 
-	{ .compatible = "idt,89hpes16t4", },
-	{ .compatible = "idt,89hpes4t4g2", },
-	{ .compatible = "idt,89hpes10t4g2", },
-	{ .compatible = "idt,89hpes16t4g2", },
-	{ .compatible = "idt,89hpes16t4ag2", },
-	{ .compatible = "idt,89hpes5t5", },
-	{ .compatible = "idt,89hpes6t5", },
-	{ .compatible = "idt,89hpes8t5", },
-	{ .compatible = "idt,89hpes8t5a", },
-	{ .compatible = "idt,89hpes24t6", },
-	{ .compatible = "idt,89hpes6t6g2", },
-	{ .compatible = "idt,89hpes24t6g2", },
-	{ .compatible = "idt,89hpes16t7", },
-	{ .compatible = "idt,89hpes32t8", },
-	{ .compatible = "idt,89hpes32t8g2", },
-	{ .compatible = "idt,89hpes48t12", },
-	{ .compatible = "idt,89hpes48t12g2", },
-	{ },
+	{ .compatible = "idt,89hpes16t4" },
+	{ .compatible = "idt,89hpes4t4g2" },
+	{ .compatible = "idt,89hpes10t4g2" },
+	{ .compatible = "idt,89hpes16t4g2" },
+	{ .compatible = "idt,89hpes16t4ag2" },
+	{ .compatible = "idt,89hpes5t5" },
+	{ .compatible = "idt,89hpes6t5" },
+	{ .compatible = "idt,89hpes8t5" },
+	{ .compatible = "idt,89hpes8t5a" },
+	{ .compatible = "idt,89hpes24t6" },
+	{ .compatible = "idt,89hpes6t6g2" },
+	{ .compatible = "idt,89hpes24t6g2" },
+	{ .compatible = "idt,89hpes16t7" },
+	{ .compatible = "idt,89hpes32t8" },
+	{ .compatible = "idt,89hpes32t8g2" },
+	{ .compatible = "idt,89hpes48t12" },
+	{ .compatible = "idt,89hpes48t12g2" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, idt_of_match);
 
Signature · 1 line
2.55.0.11.g153666a7d9bb
#12 lore raw

PATCH v2 11/12 misc: Unify style of of_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)

Update the various of_device_id arrays to conform to the most used and generally recommended coding style. That is:

- No comma after the list terminator;
- A comma after an initializer if (and only if) the closing } is not directly following;
- No explicit zeros in the list terminator;
- A space after an opening { and before a closing }, a single space in the list terminator;

Adapt the few offenders accordingly.

---
 drivers/misc/ds1682.c                  | 4 ++--
 drivers/misc/fastrpc.c                 | 6 +++---
 drivers/misc/hisi_hikey_usb.c          | 2 +-
 drivers/misc/lis3lv02d/lis3lv02d_i2c.c | 2 +-
 drivers/misc/lis3lv02d/lis3lv02d_spi.c | 2 +-
 drivers/misc/open-dice.c               | 2 +-
 drivers/misc/pvpanic/pvpanic-mmio.c    | 4 ++--
 drivers/misc/qcom-coincell.c           | 4 ++--
 drivers/misc/sram.c                    | 2 +-
 drivers/misc/ti_fpc202.c               | 2 +-
 drivers/misc/vcpu_stall_detector.c     | 4 ++--
 11 files changed, 17 insertions(+), 17 deletions(-)
drivers/misc/ds1682.c +2 -2
index f073a5067fc8..4500d7d0ea77 100644
@@ -277,8 +277,8 @@ static const struct i2c_device_id ds1682_id[] = {
 MODULE_DEVICE_TABLE(i2c, ds1682_id);
 
 static const struct of_device_id ds1682_of_match[] = {
-	{ .compatible = "dallas,ds1682", },
-	{}
+	{ .compatible = "dallas,ds1682" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, ds1682_of_match);
 
drivers/misc/fastrpc.c +3 -3
index d86e79134c68..f7b6aba8b71d 100644
@@ -2299,8 +2299,8 @@ static void fastrpc_cb_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id fastrpc_match_table[] = {
-	{ .compatible = "qcom,fastrpc-compute-cb", },
-	{}
+	{ .compatible = "qcom,fastrpc-compute-cb" },
+	{ }
 };
 
 static struct platform_driver fastrpc_cb_driver = {
@@ -2579,7 +2579,7 @@ static int fastrpc_rpmsg_callback(struct rpmsg_device *rpdev, void *data,
 static const struct of_device_id fastrpc_rpmsg_of_match[] = {
 	{ .compatible = "qcom,kaanapali-fastrpc", .data = &kaanapali_soc_data },
 	{ .compatible = "qcom,fastrpc", .data = &default_soc_data },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, fastrpc_rpmsg_of_match);
 
drivers/misc/hisi_hikey_usb.c +1 -1
index 79f06001259b..e68bc6e384d5 100644
@@ -254,7 +254,7 @@ static void hisi_hikey_usb_remove(struct platform_device *pdev)
 
 static const struct of_device_id id_table_hisi_hikey_usb[] = {
 	{ .compatible = "hisilicon,usbhub" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(of, id_table_hisi_hikey_usb);
 
drivers/misc/lis3lv02d/lis3lv02d_i2c.c +1 -1
index 36032fc125f3..7c3ca6d604d1 100644
@@ -95,7 +95,7 @@ static union axis_conversion lis3lv02d_axis_map =
 #ifdef CONFIG_OF
 static const struct of_device_id lis3lv02d_i2c_dt_ids[] = {
 	{ .compatible = "st,lis3lv02d" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(of, lis3lv02d_i2c_dt_ids);
 #endif
drivers/misc/lis3lv02d/lis3lv02d_spi.c +1 -1
index 203a108b8883..5bf95176a00e 100644
@@ -60,7 +60,7 @@ static union axis_conversion lis3lv02d_axis_normal =
 #ifdef CONFIG_OF
 static const struct of_device_id lis302dl_spi_dt_ids[] = {
 	{ .compatible = "st,lis302dl-spi" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(of, lis302dl_spi_dt_ids);
 #endif
drivers/misc/open-dice.c +1 -1
index 45060fb4ea27..77ab0c1e83d3 100644
@@ -177,7 +177,7 @@ static void open_dice_remove(struct platform_device *pdev)
 
 static const struct of_device_id open_dice_of_match[] = {
 	{ .compatible = "google,open-dice" },
-	{},
+	{ }
 };
 
 static struct platform_driver open_dice_driver = {
drivers/misc/pvpanic/pvpanic-mmio.c +2 -2
index 43a094bfdaec..724dfddf69e4 100644
@@ -51,8 +51,8 @@ static int pvpanic_mmio_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id pvpanic_mmio_match[] = {
-	{ .compatible = "qemu,pvpanic-mmio", },
-	{}
+	{ .compatible = "qemu,pvpanic-mmio" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, pvpanic_mmio_match);
 
drivers/misc/qcom-coincell.c +2 -2
index 3c57f7429147..b58bd34fc471 100644
@@ -124,8 +124,8 @@ static int qcom_coincell_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id qcom_coincell_match_table[] = {
-	{ .compatible = "qcom,pm8941-coincell", },
-	{}
+	{ .compatible = "qcom,pm8941-coincell" },
+	{ }
 };
 
 MODULE_DEVICE_TABLE(of, qcom_coincell_match_table);
drivers/misc/sram.c +1 -1
index 1919d24c8236..c8990e83a65a 100644
@@ -370,7 +370,7 @@ static const struct of_device_id sram_dt_ids[] = {
 	{ .compatible = "nvidia,tegra186-sysram", .data = &tegra_sysram_config },
 	{ .compatible = "nvidia,tegra194-sysram", .data = &tegra_sysram_config },
 	{ .compatible = "nvidia,tegra234-sysram", .data = &tegra_sysram_config },
-	{}
+	{ }
 };
 
 static int sram_probe(struct platform_device *pdev)
drivers/misc/ti_fpc202.c +1 -1
index 2aac83ec4a39..9e2d24f89457 100644
@@ -718,7 +718,7 @@ static void fpc202_remove(struct i2c_client *client)
 
 static const struct of_device_id fpc202_of_match[] = {
 	{ .compatible = "ti,fpc202" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(of, fpc202_of_match);
 
drivers/misc/vcpu_stall_detector.c +2 -2
index 26166357b255..1306b2c1ef99 100644
@@ -224,8 +224,8 @@ static void vcpu_stall_detect_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id vcpu_stall_detect_of_match[] = {
-	{ .compatible = "qemu,vcpu-stall-detector", },
-	{}
+	{ .compatible = "qemu,vcpu-stall-detector" },
+	{ }
 };
 
 MODULE_DEVICE_TABLE(of, vcpu_stall_detect_of_match);
Signature · 1 line
2.55.0.11.g153666a7d9bb
#14 lore raw

PATCH v2 12/12 misc: Unify code style for various *_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)

- Add a trailing comma for initializers unless the closing brace is on the same line and for the list terminator;
- Use a single space in the list terminator;
- A space after an opening { and before a closing };
- Use the PCI_DEVICE* macro in two drivers for pci_device_id entry which is usual for these arrays
- No explicit zeros in the list terminator;

None of these changes introduces changes to the compiled result.

---
 drivers/misc/amd-sbi/rmi-i2c.c                |   2 +-
 drivers/misc/bcm-vk/bcm_vk_dev.c              |   2 +-
 drivers/misc/cardreader/alcor_pci.c           |   2 +-
 drivers/misc/cb710/core.c                     |   5 +-
 drivers/misc/hi6421v600-irq.c                 |   2 +-
 drivers/misc/hpilo.c                          |   6 +-
 drivers/misc/ibmasm/module.c                  |   2 +-
 drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c |   2 +-
 .../misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c   |   4 +-
 .../misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c |   4 +-
 drivers/misc/mei/pci-csc.c                    |   2 +-
 drivers/misc/mei/pci-me.c                     | 166 +++++++++---------
 drivers/misc/mei/pci-txe.c                    |   6 +-
 drivers/misc/mrvl_cn10k_dpi.c                 |   2 +-
 drivers/misc/nsm.c                            |   2 +-
 drivers/misc/ocxl/pci.c                       |   2 +-
 drivers/misc/pci_endpoint_test.c              |  16 +-
 drivers/misc/phantom.c                        |   6 +-
 drivers/misc/pvpanic/pvpanic-pci.c            |   4 +-
 drivers/misc/rp1/rp1_pci.c                    |   2 +-
 drivers/misc/vmw_vmci/vmci_guest.c            |   4 +-
 21 files changed, 121 insertions(+), 122 deletions(-)
drivers/misc/amd-sbi/rmi-i2c.c +1 -1
index bbc0d14d1cfc..463a9a757464 100644
@@ -226,7 +226,7 @@ static const struct i3c_device_id sbrmi_i3c_id[] = {
 	I3C_DEVICE_EXTRA_INFO(0x0, 0x100, 0x118, NULL), /* Socket:1, Venice */
 	I3C_DEVICE_EXTRA_INFO(0x112, 0x0, 0x119, NULL), /* Socket:0, Venice */
 	I3C_DEVICE_EXTRA_INFO(0x112, 0x100, 0x119, NULL), /* Socket:1, Venice */
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(i3c, sbrmi_i3c_id);
 
drivers/misc/bcm-vk/bcm_vk_dev.c +1 -1
index 5773ffb46f0f..7aa818a7717a 100644
@@ -1632,7 +1632,7 @@ static void bcm_vk_shutdown(struct pci_dev *pdev)
 }
 
 static const struct pci_device_id bcm_vk_ids[] = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_VALKYRIE), },
+	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_VALKYRIE) },
 	{ }
 };
 MODULE_DEVICE_TABLE(pci, bcm_vk_ids);
drivers/misc/cardreader/alcor_pci.c +1 -1
index 8e7ea2c9142d..9e0f4f91763e 100644
@@ -47,7 +47,7 @@ static const struct pci_device_id pci_ids[] = {
 		.driver_data = (kernel_ulong_t)&au6621_cfg },
 	{ PCI_DEVICE(PCI_ID_ALCOR_MICRO, PCI_ID_AU6625),
 		.driver_data = (kernel_ulong_t)&au6625_cfg },
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(pci, pci_ids);
 
drivers/misc/cb710/core.c +2 -3
index 2dd212f04fed..8e0d11e59c4e 100644
@@ -292,9 +292,8 @@ static void cb710_remove_one(struct pci_dev *pdev)
 }
 
 static const struct pci_device_id cb710_pci_tbl[] = {
-	{ PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_CB710_FLASH,
-		PCI_ANY_ID, PCI_ANY_ID, },
-	{ 0, }
+	{ PCI_DEVICE(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_CB710_FLASH) },
+	{ }
 };
 
 static SIMPLE_DEV_PM_OPS(cb710_pm_ops, cb710_suspend, cb710_resume);
drivers/misc/hi6421v600-irq.c +1 -1
index 5ba40222eb12..143f2ffa846f 100644
@@ -285,7 +285,7 @@ static int hi6421v600_irq_probe(struct platform_device *pdev)
 
 static const struct platform_device_id hi6421v600_irq_table[] = {
 	{ .name = "hi6421v600-irq" },
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, hi6421v600_irq_table);
 
drivers/misc/hpilo.c +3 -3
index ff3f03ea577e..40e96d15164a 100644
@@ -33,10 +33,10 @@ static unsigned int max_ccb = 16;
 static char ilo_hwdev[MAX_ILO_DEV];
 static const struct pci_device_id ilo_blacklist[] = {
 	/* auxiliary iLO */
-	{PCI_DEVICE_SUB(PCI_VENDOR_ID_HP, 0x3307, PCI_VENDOR_ID_HP, 0x1979)},
+	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_HP, 0x3307, PCI_VENDOR_ID_HP, 0x1979) },
 	/* CL */
-	{PCI_DEVICE_SUB(PCI_VENDOR_ID_HP, 0x3307, PCI_VENDOR_ID_HP_3PAR, 0x0289)},
-	{}
+	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_HP, 0x3307, PCI_VENDOR_ID_HP_3PAR, 0x0289) },
+	{ }
 };
 
 static inline int get_entry_id(int entry)
drivers/misc/ibmasm/module.c +1 -1
index 4509c15a76a8..97f661f54b31 100644
@@ -178,7 +178,7 @@ static void ibmasm_remove_one(struct pci_dev *pdev)
 static struct pci_device_id ibmasm_pci_table[] =
 {
 	{ PCI_DEVICE(VENDORID_IBM, DEVICEID_RSA) },
-	{},
+	{ }
 };
 
 static struct pci_driver ibmasm_driver = {
drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c +1 -1
index 48bea1117771..b0b678e6b28d 100644
@@ -150,7 +150,7 @@ static const struct pci_device_id pci1xxxx_tbl[] = {
 	{ PCI_DEVICE(0x1055, 0xA035) },
 	{ PCI_DEVICE(0x1055, 0xA045) },
 	{ PCI_DEVICE(0x1055, 0xA055) },
-	{0,}
+	{ }
 };
 MODULE_DEVICE_TABLE(pci, pci1xxxx_tbl);
 
drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c +2 -2
index 8eddbaa1fccd..82635db04dc5 100644
@@ -513,8 +513,8 @@ static int pci1xxxx_gpio_probe(struct auxiliary_device *aux_dev,
 static DEFINE_SIMPLE_DEV_PM_OPS(pci1xxxx_gpio_pm_ops, pci1xxxx_gpio_suspend, pci1xxxx_gpio_resume);
 
 static const struct auxiliary_device_id pci1xxxx_gpio_auxiliary_id_table[] = {
-	{.name = "mchp_pci1xxxx_gp.gp_gpio"},
-	{}
+	{ .name = "mchp_pci1xxxx_gp.gp_gpio" },
+	{ }
 };
 MODULE_DEVICE_TABLE(auxiliary, pci1xxxx_gpio_auxiliary_id_table);
 
drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c +2 -2
index a2ed477e0370..09841c4f1a06 100644
@@ -419,8 +419,8 @@ static void pci1xxxx_otp_eeprom_remove(struct auxiliary_device *aux_dev)
 }
 
 static const struct auxiliary_device_id pci1xxxx_otp_eeprom_auxiliary_id_table[] = {
-	{.name = "mchp_pci1xxxx_gp.gp_otp_e2p"},
-	{},
+	{ .name = "mchp_pci1xxxx_gp.gp_otp_e2p" },
+	{ }
 };
 MODULE_DEVICE_TABLE(auxiliary, pci1xxxx_otp_eeprom_auxiliary_id_table);
 
drivers/misc/mei/pci-csc.c +1 -1
index 70792bf9b3c0..6e1e8008f267 100644
@@ -240,7 +240,7 @@ static const struct dev_pm_ops mei_csc_pm_ops = {
 
 static const struct pci_device_id mei_csc_pci_tbl[] = {
 	{ PCI_DEVICE_DATA(INTEL, MEI_CRI, MEI_ME_CSC_CFG) },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(pci, mei_csc_pci_tbl);
 
drivers/misc/mei/pci-me.c +83 -83

197 lines not on this page · raw message

drivers/misc/mei/pci-txe.c +3 -3
index f5441bc5efe2..815ca72877ce 100644
@@ -24,10 +24,10 @@
 #include "hw-txe.h"
 
 static const struct pci_device_id mei_txe_pci_tbl[] = {
-	{PCI_VDEVICE(INTEL, 0x0F18)}, /* Baytrail */
-	{PCI_VDEVICE(INTEL, 0x2298)}, /* Cherrytrail */
+	{ PCI_VDEVICE(INTEL, 0x0F18) }, /* Baytrail */
+	{ PCI_VDEVICE(INTEL, 0x2298) }, /* Cherrytrail */
 
-	{0, }
+	{ }
 };
 MODULE_DEVICE_TABLE(pci, mei_txe_pci_tbl);
 
drivers/misc/mrvl_cn10k_dpi.c +1 -1
index 7d5433121ff6..29b7a4110300 100644
@@ -658,7 +658,7 @@ static void dpi_remove(struct pci_dev *pdev)
 static const struct pci_device_id dpi_id_table[] = {
 	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_MRVL_CN10K_DPI_PF,
 			 PCI_VENDOR_ID_CAVIUM, PCI_SUBDEVID_MRVL_CN10K_DPI_PF) },
-	{ 0, }  /* end of table */
+	{ }  /* end of table */
 };
 
 static struct pci_driver dpi_driver = {
drivers/misc/nsm.c +1 -1
index ef7b32742340..7940e80979a9 100644
@@ -61,7 +61,7 @@ struct nsm {
 /* NSM device ID */
 static const struct virtio_device_id id_table[] = {
 	{ VIRTIO_ID_NITRO_SEC_MOD, VIRTIO_DEV_ANY_ID },
-	{ 0 },
+	{ }
 };
 
 static struct nsm *file_to_nsm(struct file *file)
drivers/misc/ocxl/pci.c +1 -1
index cb920aa88d3a..0cf38bd482a9 100644
@@ -9,7 +9,7 @@
  * vendor/device ID to help differentiate devices.
  */
 static const struct pci_device_id ocxl_pci_tbl[] = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_IBM, 0x062B), },
+	{ PCI_DEVICE(PCI_VENDOR_ID_IBM, 0x062B) },
 	{ }
 };
 MODULE_DEVICE_TABLE(pci, ocxl_pci_tbl);
drivers/misc/pci_endpoint_test.c +8 -8
index 3635741c3e7a..a10fce77e0b4 100644
@@ -1416,18 +1416,18 @@ static const struct pci_device_id pci_endpoint_test_tbl[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, 0x81c0),
 	  .driver_data = (kernel_ulong_t)&default_data,
 	},
-	{ PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, PCI_DEVICE_ID_IMX8),},
+	{ PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, PCI_DEVICE_ID_IMX8) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, PCI_DEVICE_ID_LS1088A),
 	  .driver_data = (kernel_ulong_t)&default_data,
 	},
 	{ PCI_DEVICE_DATA(SYNOPSYS, EDDA, NULL) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_AM654),
-	  .driver_data = (kernel_ulong_t)&am654_data
+	  .driver_data = (kernel_ulong_t)&am654_data,
 	},
-	{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774A1),},
-	{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774B1),},
-	{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774C0),},
-	{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774E1),},
+	{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774A1) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774B1) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774C0) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774E1) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A779F0),
 	  .driver_data = (kernel_ulong_t)&default_data,
 	},
@@ -1446,8 +1446,8 @@ static const struct pci_device_id pci_endpoint_test_tbl[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_ROCKCHIP, PCI_DEVICE_ID_ROCKCHIP_RK3588),
 	  .driver_data = (kernel_ulong_t)&rk3588_data,
 	},
-	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_TEGRA194_EP),},
-	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_TEGRA234_EP),},
+	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_TEGRA194_EP) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_TEGRA234_EP) },
 	{ }
 };
 MODULE_DEVICE_TABLE(pci, pci_endpoint_test_tbl);
drivers/misc/phantom.c +3 -3
index 34a5054a6b40..331cae539290 100644
@@ -481,10 +481,10 @@ static int __maybe_unused phantom_resume(struct device *dev_d)
 }
 
 static struct pci_device_id phantom_pci_tbl[] = {
-	{ .vendor = PCI_VENDOR_ID_PLX, .device = PCI_DEVICE_ID_PLX_9050,
-	  .subvendor = PCI_VENDOR_ID_PLX, .subdevice = PCI_DEVICE_ID_PLX_9050,
+	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
+			 PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050),
 	  .class = PCI_CLASS_BRIDGE_OTHER << 8, .class_mask = 0xffff00 },
-	{ 0, }
+	{ }
 };
 MODULE_DEVICE_TABLE(pci, phantom_pci_tbl);
 
drivers/misc/pvpanic/pvpanic-pci.c +2 -2
index b21598a18f6d..572c6148a297 100644
@@ -35,8 +35,8 @@ static int pvpanic_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
 }
 
 static const struct pci_device_id pvpanic_pci_id_tbl[]  = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_REDHAT, PCI_DEVICE_ID_REDHAT_PVPANIC)},
-	{}
+	{ PCI_DEVICE(PCI_VENDOR_ID_REDHAT, PCI_DEVICE_ID_REDHAT_PVPANIC) },
+	{ }
 };
 MODULE_DEVICE_TABLE(pci, pvpanic_pci_id_tbl);
 
drivers/misc/rp1/rp1_pci.c +1 -1
index 81685e3f3296..f5cdf05ae4ec 100644
@@ -288,7 +288,7 @@ static void rp1_remove(struct pci_dev *pdev)
 }
 
 static const struct pci_device_id dev_id_table[] = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_RPI, PCI_DEVICE_ID_RPI_RP1_C0), },
+	{ PCI_DEVICE(PCI_VENDOR_ID_RPI, PCI_DEVICE_ID_RPI_RP1_C0) },
 	{ }
 };
 MODULE_DEVICE_TABLE(pci, dev_id_table);
drivers/misc/vmw_vmci/vmci_guest.c +2 -2
index 476af89e751b..83355c0ec1d2 100644
@@ -960,8 +960,8 @@ static void vmci_guest_remove_device(struct pci_dev *pdev)
 }
 
 static const struct pci_device_id vmci_ids[] = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_VMWARE, PCI_DEVICE_ID_VMWARE_VMCI), },
-	{ 0 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_VMWARE, PCI_DEVICE_ID_VMWARE_VMCI) },
+	{ }
 };
 MODULE_DEVICE_TABLE(pci, vmci_ids);
 
Signature · 1 line
2.55.0.11.g153666a7d9bb
#15 lore raw

Re: [PATCH v2 12/12] misc: Unify code style for various *_device_id arrays

Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 11 lines

- Add a trailing comma for initializers unless the closing brace is on the same line and for the list terminator;
- Use a single space in the list terminator;
- A space after an opening { and before a closing };
- Use the PCI_DEVICE* macro in two drivers for pci_device_id entry which is usual for these arrays
- No explicit zeros in the list terminator;

None of these changes introduces changes to the compiled result.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=12
#7 lore raw

Re: [PATCH v2 06/12] misc: Use named initializers for arrays of spi_device_data

In reply to Uwe Kleine-König (The Capable Hub)

Hello,

Quoted 8 lines · Uwe Kleine-König (The Capable Hub)

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct spi_device_id that replaces .driver_data by an anonymous union.

Quoted 6 lines

While touching all these arrays, unify usage of whitespace.

This patch doesn't modify the compiled arrays, only their representation in source form benefits.

I fatfingered From: and S-o-b:, this should be

From: "Uwe Kleine-König (The Capable Hub)" <[email protected]>
and

respectively.

🤦, I even anticipated that error, but used git grep @kernel.org *.patch instead of plain grep ... and as the patches are not under version control, git showed no matches and I wrongly thought to have gotten this right.

If this version of the series is to be applied, I appreciate an according fixup.

Best regards
Uwe

maintainer Reviewed-by on v2 11/12
#13 lore raw

Re: [PATCH v2 11/12] misc: Unify style of of_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)

Hi Uwe,

Quoted 239 lines · On Friday, 17 July 2026 16:50:57 CEST Uwe Kleine-König (The Capable Hub) wrote:

Update the various of_device_id arrays to conform to the most used and

generally recommended coding style. That is:
- No comma after the list terminator;
- A comma after an initializer if (and only if) the closing } is not

   directly following;

- No explicit zeros in the list terminator;
- A space after an opening { and before a closing }, a single space in

   the list terminator;

Adapt the few offenders accordingly.

Signed-off-by: Uwe Kleine-König (The Capable Hub)
<[email protected]> ---

 drivers/misc/ds1682.c                  | 4 ++--
 drivers/misc/fastrpc.c                 | 6 +++---
 drivers/misc/hisi_hikey_usb.c          | 2 +-
 drivers/misc/lis3lv02d/lis3lv02d_i2c.c | 2 +-
 drivers/misc/lis3lv02d/lis3lv02d_spi.c | 2 +-
 drivers/misc/open-dice.c               | 2 +-
 drivers/misc/pvpanic/pvpanic-mmio.c    | 4 ++--
 drivers/misc/qcom-coincell.c           | 4 ++--
 drivers/misc/sram.c                    | 2 +-
 drivers/misc/ti_fpc202.c               | 2 +-
 drivers/misc/vcpu_stall_detector.c     | 4 ++--
 11 files changed, 17 insertions(+), 17 deletions(-)
drivers/misc/ds1682.c +2 -2
index f073a5067fc8..4500d7d0ea77 100644
@@ -277,8 +277,8 @@ static const struct i2c_device_id ds1682_id[] = {
 
 MODULE_DEVICE_TABLE(i2c, ds1682_id);
 
 static const struct of_device_id ds1682_of_match[] = {
 
-	{ .compatible = "dallas,ds1682", },
-	{}
+	{ .compatible = "dallas,ds1682" },
+	{ }
 

};
MODULE_DEVICE_TABLE(of, ds1682_of_match);

drivers/misc/fastrpc.c +2 -2
index d86e79134c68..f7b6aba8b71d 100644
@@ -2299,8 +2299,8 @@ static void fastrpc_cb_remove(struct platform_device
 *pdev) }
 
 static const struct of_device_id fastrpc_match_table[] = {
 
-	{ .compatible = "qcom,fastrpc-compute-cb", },
-	{}
+	{ .compatible = "qcom,fastrpc-compute-cb" },
+	{ }
 
 };

static struct platform_driver fastrpc_cb_driver = {

drivers/misc/fastrpc.c +1 -1
@@ -2579,7 +2579,7 @@ static int fastrpc_rpmsg_callback(struct rpmsg_device
 *rpdev, void *data, static const struct of_device_id
 fastrpc_rpmsg_of_match[] = {
 
 	{ .compatible = "qcom,kaanapali-fastrpc", .data = &kaanapali_soc_data },
 	{ .compatible = "qcom,fastrpc", .data = &default_soc_data },
 
-	{ },
+	{ }

};
MODULE_DEVICE_TABLE(of, fastrpc_rpmsg_of_match);

drivers/misc/hisi_hikey_usb.c +1 -1
index 79f06001259b..e68bc6e384d5 100644
@@ -254,7 +254,7 @@ static void hisi_hikey_usb_remove(struct platform_device
 *pdev)
 
 static const struct of_device_id id_table_hisi_hikey_usb[] = {
 
 	{ .compatible = "hisilicon,usbhub" },
 
-	{}
+	{ }

};
MODULE_DEVICE_TABLE(of, id_table_hisi_hikey_usb);

(quoted diff) +0 -0

b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c index 36032fc125f3..7c3ca6d604d1 100644

drivers/misc/lis3lv02d/lis3lv02d_i2c.c +1 -1
@@ -95,7 +95,7 @@ static union axis_conversion lis3lv02d_axis_map =
 
 #ifdef CONFIG_OF
 static const struct of_device_id lis3lv02d_i2c_dt_ids[] = {
 
 	{ .compatible = "st,lis3lv02d" },
 
-	{}
+	{ }

};
MODULE_DEVICE_TABLE(of, lis3lv02d_i2c_dt_ids);
#endif

(quoted diff) +0 -0

b/drivers/misc/lis3lv02d/lis3lv02d_spi.c index 203a108b8883..5bf95176a00e 100644

drivers/misc/lis3lv02d/lis3lv02d_spi.c +1 -1
@@ -60,7 +60,7 @@ static union axis_conversion lis3lv02d_axis_normal =
 
 #ifdef CONFIG_OF
 static const struct of_device_id lis302dl_spi_dt_ids[] = {
 
 	{ .compatible = "st,lis302dl-spi" },
 
-	{}
+	{ }

};
MODULE_DEVICE_TABLE(of, lis302dl_spi_dt_ids);
#endif

drivers/misc/open-dice.c +1 -1
index 45060fb4ea27..77ab0c1e83d3 100644
@@ -177,7 +177,7 @@ static void open_dice_remove(struct platform_device
 *pdev)
 
 static const struct of_device_id open_dice_of_match[] = {
 
 	{ .compatible = "google,open-dice" },
 
-	{},
+	{ }

};

static struct platform_driver open_dice_driver = {

(quoted diff) +0 -0

b/drivers/misc/pvpanic/pvpanic-mmio.c index 43a094bfdaec..724dfddf69e4 100644

drivers/misc/pvpanic/pvpanic-mmio.c +2 -2
@@ -51,8 +51,8 @@ static int pvpanic_mmio_probe(struct platform_device
 *pdev) }
 
 static const struct of_device_id pvpanic_mmio_match[] = {
 
-	{ .compatible = "qemu,pvpanic-mmio", },
-	{}
+	{ .compatible = "qemu,pvpanic-mmio" },
+	{ }
 
 };

MODULE_DEVICE_TABLE(of, pvpanic_mmio_match);

drivers/misc/qcom-coincell.c +2 -2
index 3c57f7429147..b58bd34fc471 100644
@@ -124,8 +124,8 @@ static int qcom_coincell_probe(struct platform_device
 *pdev) }
 
 static const struct of_device_id qcom_coincell_match_table[] = {
 
-	{ .compatible = "qcom,pm8941-coincell", },
-	{}
+	{ .compatible = "qcom,pm8941-coincell" },
+	{ }
 
 };

MODULE_DEVICE_TABLE(of, qcom_coincell_match_table);

drivers/misc/sram.c +1 -1
index 1919d24c8236..c8990e83a65a 100644
@@ -370,7 +370,7 @@ static const struct of_device_id sram_dt_ids[] = {
 
 	{ .compatible = "nvidia,tegra186-sysram", .data = &tegra_sysram_config },
 	{ .compatible = "nvidia,tegra194-sysram", .data = &tegra_sysram_config },
 	{ .compatible = "nvidia,tegra234-sysram", .data = &tegra_sysram_config },
 
-	{}
+	{ }
 

};

static int sram_probe(struct platform_device *pdev)

drivers/misc/ti_fpc202.c +1 -1
index 2aac83ec4a39..9e2d24f89457 100644
@@ -718,7 +718,7 @@ static void fpc202_remove(struct i2c_client *client)
 
 static const struct of_device_id fpc202_of_match[] = {
 
 	{ .compatible = "ti,fpc202" },
 
-	{}
+	{ }
 

};
MODULE_DEVICE_TABLE(of, fpc202_of_match);

(quoted diff) +0 -0

b/drivers/misc/vcpu_stall_detector.c index 26166357b255..1306b2c1ef99 100644

drivers/misc/vcpu_stall_detector.c +2 -2
@@ -224,8 +224,8 @@ static void vcpu_stall_detect_remove(struct
 platform_device *pdev) }
 
 static const struct of_device_id vcpu_stall_detect_of_match[] = {
 
-	{ .compatible = "qemu,vcpu-stall-detector", },
-	{}
+	{ .compatible = "qemu,vcpu-stall-detector" },
+	{ }
 
 };
Quoted 1 line

MODULE_DEVICE_TABLE(of, vcpu_stall_detect_of_match);

maintainer Acked-by on v2 12/12
#16 lore raw

Re: [PATCH v2 12/12] misc: Unify code style for various *_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)
Quoted 12 lines · Uwe Kleine-König (The Capable Hub)

- Add a trailing comma for initializers unless the closing brace is on the same line and for the list terminator;
- Use a single space in the list terminator;
- A space after an opening { and before a closing };
- Use the PCI_DEVICE* macro in two drivers for pci_device_id entry which is usual for these arrays
- No explicit zeros in the list terminator;

None of these changes introduces changes to the compiled result.

---

...

Quoted 1 line
 drivers/misc/cb710/core.c                     |   5 +-
maintainer Acked-by on v2 12/12
#17 lore raw

Re: [PATCH v2 12/12] misc: Unify code style for various *_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)

On Fri, Jul 17, 2026 at 04:50:58PM +0200, Uwe Kleine-König (The Capable Hub) wrote:

[...]

Quoted 30 lines
drivers/misc/pci_endpoint_test.c +6 -6
index 3635741c3e7a..a10fce77e0b4 100644
@@ -1416,18 +1416,18 @@ static const struct pci_device_id pci_endpoint_test_tbl[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, 0x81c0),
 	  .driver_data = (kernel_ulong_t)&default_data,
 	},
-	{ PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, PCI_DEVICE_ID_IMX8),},
+	{ PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, PCI_DEVICE_ID_IMX8) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, PCI_DEVICE_ID_LS1088A),
 	  .driver_data = (kernel_ulong_t)&default_data,
 	},
 	{ PCI_DEVICE_DATA(SYNOPSYS, EDDA, NULL) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_AM654),
-	  .driver_data = (kernel_ulong_t)&am654_data
+	  .driver_data = (kernel_ulong_t)&am654_data,
 	},
-	{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774A1),},
-	{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774B1),},
-	{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774C0),},
-	{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774E1),},
+	{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774A1) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774B1) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774C0) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774E1) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A779F0),
 	  .driver_data = (kernel_ulong_t)&default_data,
 	},

drivers/misc/pci_endpoint_test.c static const struct pci_device_id pci_endpoint_test_tbl[] = { · line 1453

Quoted 10 lines
drivers/misc/pci_endpoint_test.c +2 -2
@@ -1446,8 +1446,8 @@ static const struct pci_device_id pci_endpoint_test_tbl[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_ROCKCHIP, PCI_DEVICE_ID_ROCKCHIP_RK3588),
 	  .driver_data = (kernel_ulong_t)&rk3588_data,
 	},
-	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_TEGRA194_EP),},
-	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_TEGRA234_EP),},
+	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_TEGRA194_EP) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_TEGRA234_EP) },
 	{ }
 };
 MODULE_DEVICE_TABLE(pci, pci_endpoint_test_tbl);

- Mani

Signature · 1 line
மணிவண்ணன் சதாசிவம்