Skip to contentSkip to conversation

pwm: Unify arrays of various *_device_id

PATCH In review Uwe Kleine-König (The Capable Hub) 5 participants 13 messages Jul 5 – Jul 10

Subsystems (34)
lore
Share & tools
lore
#0 lore raw

cover pwm: Unify arrays of various *_device_id

Hello,

this series is part of a preparation for changing .driver_data (and similarily named members) of *_device_id to an anonymous union. See e.g.
https://lore.kernel.org/all/[email protected]/
for the idea behind it. I also grabbed the opportunity to unify the coding style for all these arrays while going through these.

The patch series is based on pwm/for-next + "pwm: pxa: Depend on OF and simplify accordingly" [1].

Best regards
Uwe

[1] https://lore.kernel.org/linux-pwm/[email protected]

Uwe Kleine-König (The Capable Hub) (5):
pwm: pca9685: Drop unused assignment of acpi_device_id driver data
pwm: Use named initializers for arrays of acpi_device_id
pwm: Unify coding style of acpi_device_id arrays
pwm: Unify coding style of of_device_id arrays
pwm: lpss-pci: Unify coding style of pci_device_id array

 drivers/pwm/pwm-apple.c           |  2 +-
 drivers/pwm/pwm-argon-fan-hat.c   |  2 +-
 drivers/pwm/pwm-atmel-hlcdc.c     | 15 ++++++---------
 drivers/pwm/pwm-atmel-tcb.c       |  6 +++---
 drivers/pwm/pwm-atmel.c           |  3 +--
 drivers/pwm/pwm-bcm-iproc.c       |  2 +-
 drivers/pwm/pwm-bcm-kona.c        |  2 +-
 drivers/pwm/pwm-bcm2835.c         |  2 +-
 drivers/pwm/pwm-berlin.c          |  2 +-
 drivers/pwm/pwm-brcmstb.c         |  2 +-
 drivers/pwm/pwm-clk.c             |  2 +-
 drivers/pwm/pwm-clps711x.c        |  2 +-
 drivers/pwm/pwm-cros-ec.c         |  2 +-
 drivers/pwm/pwm-hibvt.c           |  2 +-
 drivers/pwm/pwm-imx-tpm.c         |  2 +-
 drivers/pwm/pwm-imx1.c            |  2 +-
 drivers/pwm/pwm-imx27.c           |  2 +-
 drivers/pwm/pwm-ipq.c             |  4 ++--
 drivers/pwm/pwm-jz4740.c          |  2 +-
 drivers/pwm/pwm-loongson.c        |  2 +-
 drivers/pwm/pwm-lp3943.c          |  2 +-
 drivers/pwm/pwm-lpc18xx-sct.c     |  2 +-
 drivers/pwm/pwm-lpc32xx.c         |  2 +-
 drivers/pwm/pwm-lpss-pci.c        |  2 +-
 drivers/pwm/pwm-lpss-platform.c   | 10 +++++-----
 drivers/pwm/pwm-mediatek.c        |  2 +-
 drivers/pwm/pwm-meson.c           |  9 ++++-----
 drivers/pwm/pwm-mtk-disp.c        |  8 ++++----
 drivers/pwm/pwm-mxs.c             |  2 +-
 drivers/pwm/pwm-omap-dmtimer.c    |  4 ++--
 drivers/pwm/pwm-pca9685.c         |  6 +++---
 drivers/pwm/pwm-pxa.c             |  8 ++++----
 drivers/pwm/pwm-raspberrypi-poe.c |  2 +-
 drivers/pwm/pwm-rcar.c            |  4 ++--
 drivers/pwm/pwm-renesas-tpu.c     | 10 +++++-----
 drivers/pwm/pwm-rockchip.c        |  8 ++++----
 drivers/pwm/pwm-rzg2l-gpt.c       |  2 +-
 drivers/pwm/pwm-samsung.c         |  2 +-
 drivers/pwm/pwm-sifive.c          |  2 +-
 drivers/pwm/pwm-sl28cpld.c        |  2 +-
 drivers/pwm/pwm-sophgo-sg2042.c   |  7 +++----
 drivers/pwm/pwm-sprd.c            |  4 ++--
 drivers/pwm/pwm-sti.c             |  2 +-
 drivers/pwm/pwm-stm32-lp.c        |  4 ++--
 drivers/pwm/pwm-stm32.c           |  6 +++---
 drivers/pwm/pwm-sun4i.c           |  2 +-
 drivers/pwm/pwm-sunplus.c         |  4 ++--
 drivers/pwm/pwm-tiecap.c          |  6 +++---
 drivers/pwm/pwm-tiehrpwm.c        |  2 +-
 drivers/pwm/pwm-twl-led.c         |  2 +-
 drivers/pwm/pwm-twl.c             |  2 +-
 drivers/pwm/pwm-visconti.c        |  2 +-
 drivers/pwm/pwm-vt8500.c          |  2 +-
 drivers/pwm/pwm-xilinx.c          |  4 ++--
 54 files changed, 96 insertions(+), 102 deletions(-)

base-commit: 1a4920940ebfd8d907858abd8f8dd09b13752946
prerequisite-patch-id: b423a9d049b4520ef37b40635c95004363ecf692

Signature · 1 line
2.55.0.11.g153666a7d9bb
#1 lore raw

PATCH 1/5 pwm: pca9685: Drop unused assignment of acpi_device_id driver data

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

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

---
 drivers/pwm/pwm-pca9685.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/pwm-pca9685.c +1 -1
index a02255a64ea8..617a74de68c7 100644
@@ -544,7 +544,7 @@ static const struct i2c_device_id pca9685_id[] = {
 MODULE_DEVICE_TABLE(i2c, pca9685_id);
 
 static const struct acpi_device_id pca9685_acpi_ids[] = {
-	{ "INT3492", 0 },
+	{ "INT3492" },
 	{ /* sentinel */ },
 };
 MODULE_DEVICE_TABLE(acpi, pca9685_acpi_ids);
Signature · 1 line
2.55.0.11.g153666a7d9bb
#2 lore raw

PATCH 2/5 pwm: Use named initializers for arrays of acpi_device_id

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 acpi_device_id that replaces .driver_data by an anonymous union.

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

---
 drivers/pwm/pwm-loongson.c      | 2 +-
 drivers/pwm/pwm-lpss-platform.c | 8 ++++----
 drivers/pwm/pwm-pca9685.c       | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/pwm/pwm-loongson.c +1 -1
index 31a57edecfd0..f2fb35b7af2b 100644
@@ -269,7 +269,7 @@ static const struct of_device_id pwm_loongson_of_ids[] = {
 MODULE_DEVICE_TABLE(of, pwm_loongson_of_ids);
 
 static const struct acpi_device_id pwm_loongson_acpi_ids[] = {
-	{ "LOON0006" },
+	{ .id = "LOON0006" },
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, pwm_loongson_acpi_ids);
drivers/pwm/pwm-lpss-platform.c +4 -4
index 653ec9d0c8bf..0d4f8bf04e9f 100644
@@ -59,10 +59,10 @@ static int pwm_lpss_probe_platform(struct platform_device *pdev)
 }
 
 static const struct acpi_device_id pwm_lpss_acpi_match[] = {
-	{ "80860F09", (unsigned long)&pwm_lpss_byt_info },
-	{ "80862288", (unsigned long)&pwm_lpss_bsw_info },
-	{ "80862289", (unsigned long)&pwm_lpss_bsw_info },
-	{ "80865AC8", (unsigned long)&pwm_lpss_bxt_info },
+	{ .id = "80860F09", .driver_data = (unsigned long)&pwm_lpss_byt_info },
+	{ .id = "80862288", .driver_data = (unsigned long)&pwm_lpss_bsw_info },
+	{ .id = "80862289", .driver_data = (unsigned long)&pwm_lpss_bsw_info },
+	{ .id = "80865AC8", .driver_data = (unsigned long)&pwm_lpss_bxt_info },
 	{ },
 };
 MODULE_DEVICE_TABLE(acpi, pwm_lpss_acpi_match);
drivers/pwm/pwm-pca9685.c +1 -1
index 617a74de68c7..0982ba4f566c 100644
@@ -544,7 +544,7 @@ static const struct i2c_device_id pca9685_id[] = {
 MODULE_DEVICE_TABLE(i2c, pca9685_id);
 
 static const struct acpi_device_id pca9685_acpi_ids[] = {
-	{ "INT3492" },
+	{ .id = "INT3492" },
 	{ /* sentinel */ },
 };
 MODULE_DEVICE_TABLE(acpi, pca9685_acpi_ids);
Signature · 1 line
2.55.0.11.g153666a7d9bb
#3 lore raw

PATCH 3/5 pwm: Unify coding style of acpi_device_id arrays

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

Use no comma after the array terminator.

---
 drivers/pwm/pwm-lpss-platform.c | 2 +-
 drivers/pwm/pwm-pca9685.c       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/pwm/pwm-lpss-platform.c +1 -1
index 0d4f8bf04e9f..529daec1cd3f 100644
@@ -63,7 +63,7 @@ static const struct acpi_device_id pwm_lpss_acpi_match[] = {
 	{ .id = "80862288", .driver_data = (unsigned long)&pwm_lpss_bsw_info },
 	{ .id = "80862289", .driver_data = (unsigned long)&pwm_lpss_bsw_info },
 	{ .id = "80865AC8", .driver_data = (unsigned long)&pwm_lpss_bxt_info },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, pwm_lpss_acpi_match);
 
drivers/pwm/pwm-pca9685.c +1 -1
index 0982ba4f566c..8babd29f161c 100644
@@ -545,7 +545,7 @@ MODULE_DEVICE_TABLE(i2c, pca9685_id);
 
 static const struct acpi_device_id pca9685_acpi_ids[] = {
 	{ .id = "INT3492" },
-	{ /* sentinel */ },
+	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(acpi, pca9685_acpi_ids);
 
Signature · 1 line
2.55.0.11.g153666a7d9bb
#4 lore raw

PATCH 4/5 pwm: Unify coding style of of_device_id arrays

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

- Use a single space in a of_device_id array terminator; A single space after the opening { and before the closing } in non-empty initializers;
- No comma after an array terminator;
- Also no trailing comma after a named initializer iff the closing } is on the same line;

---
 drivers/pwm/pwm-apple.c           |  2 +-
 drivers/pwm/pwm-argon-fan-hat.c   |  2 +-
 drivers/pwm/pwm-atmel-hlcdc.c     | 15 ++++++---------
 drivers/pwm/pwm-atmel-tcb.c       |  6 +++---
 drivers/pwm/pwm-atmel.c           |  3 +--
 drivers/pwm/pwm-bcm-iproc.c       |  2 +-
 drivers/pwm/pwm-bcm-kona.c        |  2 +-
 drivers/pwm/pwm-bcm2835.c         |  2 +-
 drivers/pwm/pwm-berlin.c          |  2 +-
 drivers/pwm/pwm-brcmstb.c         |  2 +-
 drivers/pwm/pwm-clk.c             |  2 +-
 drivers/pwm/pwm-clps711x.c        |  2 +-
 drivers/pwm/pwm-cros-ec.c         |  2 +-
 drivers/pwm/pwm-hibvt.c           |  2 +-
 drivers/pwm/pwm-imx-tpm.c         |  2 +-
 drivers/pwm/pwm-imx1.c            |  2 +-
 drivers/pwm/pwm-imx27.c           |  2 +-
 drivers/pwm/pwm-ipq.c             |  4 ++--
 drivers/pwm/pwm-jz4740.c          |  2 +-
 drivers/pwm/pwm-lp3943.c          |  2 +-
 drivers/pwm/pwm-lpc18xx-sct.c     |  2 +-
 drivers/pwm/pwm-lpc32xx.c         |  2 +-
 drivers/pwm/pwm-mediatek.c        |  2 +-
 drivers/pwm/pwm-meson.c           |  9 ++++-----
 drivers/pwm/pwm-mtk-disp.c        |  8 ++++----
 drivers/pwm/pwm-mxs.c             |  2 +-
 drivers/pwm/pwm-omap-dmtimer.c    |  4 ++--
 drivers/pwm/pwm-pca9685.c         |  2 +-
 drivers/pwm/pwm-pxa.c             |  8 ++++----
 drivers/pwm/pwm-raspberrypi-poe.c |  2 +-
 drivers/pwm/pwm-rcar.c            |  4 ++--
 drivers/pwm/pwm-renesas-tpu.c     | 10 +++++-----
 drivers/pwm/pwm-rockchip.c        |  8 ++++----
 drivers/pwm/pwm-rzg2l-gpt.c       |  2 +-
 drivers/pwm/pwm-samsung.c         |  2 +-
 drivers/pwm/pwm-sifive.c          |  2 +-
 drivers/pwm/pwm-sl28cpld.c        |  2 +-
 drivers/pwm/pwm-sophgo-sg2042.c   |  7 +++----
 drivers/pwm/pwm-sprd.c            |  4 ++--
 drivers/pwm/pwm-sti.c             |  2 +-
 drivers/pwm/pwm-stm32-lp.c        |  4 ++--
 drivers/pwm/pwm-stm32.c           |  6 +++---
 drivers/pwm/pwm-sun4i.c           |  2 +-
 drivers/pwm/pwm-sunplus.c         |  4 ++--
 drivers/pwm/pwm-tiecap.c          |  6 +++---
 drivers/pwm/pwm-tiehrpwm.c        |  2 +-
 drivers/pwm/pwm-twl-led.c         |  2 +-
 drivers/pwm/pwm-twl.c             |  2 +-
 drivers/pwm/pwm-visconti.c        |  2 +-
 drivers/pwm/pwm-vt8500.c          |  2 +-
 drivers/pwm/pwm-xilinx.c          |  4 ++--
 51 files changed, 87 insertions(+), 93 deletions(-)
drivers/pwm/pwm-apple.c +1 -1
index 6e58aca2f13c..3c8ae739ffdb 100644
@@ -142,7 +142,7 @@ static int apple_pwm_probe(struct platform_device *pdev)
 
 static const struct of_device_id apple_pwm_of_match[] = {
 	{ .compatible = "apple,s5l-fpwm" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(of, apple_pwm_of_match);
 
drivers/pwm/pwm-argon-fan-hat.c +1 -1
index 2c59bd142d40..b480663e87d5 100644
@@ -89,7 +89,7 @@ static int argon_fan_hat_i2c_probe(struct i2c_client *i2c)
 
 static const struct of_device_id argon_fan_hat_dt_ids[] = {
 	{ .compatible = "argon40,fan-hat" },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, argon_fan_hat_dt_ids);
 
drivers/pwm/pwm-atmel-hlcdc.c +6 -9
index 387a0d1fa4f2..1ba2c9a049b9 100644
@@ -217,23 +217,20 @@ static const struct of_device_id atmel_hlcdc_dt_ids[] = {
 		.compatible = "atmel,at91sam9n12-hlcdc",
 		/* 9n12 has same errata as 9x5 HLCDC PWM */
 		.data = &atmel_hlcdc_pwm_at91sam9x5_errata,
-	},
-	{
+	}, {
 		.compatible = "atmel,at91sam9x5-hlcdc",
 		.data = &atmel_hlcdc_pwm_at91sam9x5_errata,
-	},
-	{
+	}, {
 		.compatible = "atmel,sama5d2-hlcdc",
-	},
-	{
+	}, {
 		.compatible = "atmel,sama5d3-hlcdc",
 		.data = &atmel_hlcdc_pwm_sama5d3_errata,
-	},
-	{
+	}, {
 		.compatible = "atmel,sama5d4-hlcdc",
 		.data = &atmel_hlcdc_pwm_sama5d3_errata,
+	}, {
+		.compatible = "microchip,sam9x60-hlcdc",
 	},
-	{	.compatible = "microchip,sam9x60-hlcdc", },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, atmel_hlcdc_dt_ids);
drivers/pwm/pwm-atmel-tcb.c +3 -3
index a765ef279b51..f74a42d75b81 100644
@@ -374,9 +374,9 @@ static struct atmel_tcb_config tcb_sama5d2_config = {
 };
 
 static const struct of_device_id atmel_tcb_of_match[] = {
-	{ .compatible = "atmel,at91rm9200-tcb", .data = &tcb_rm9200_config, },
-	{ .compatible = "atmel,at91sam9x5-tcb", .data = &tcb_sam9x5_config, },
-	{ .compatible = "atmel,sama5d2-tcb", .data = &tcb_sama5d2_config, },
+	{ .compatible = "atmel,at91rm9200-tcb", .data = &tcb_rm9200_config },
+	{ .compatible = "atmel,at91sam9x5-tcb", .data = &tcb_sam9x5_config },
+	{ .compatible = "atmel,sama5d2-tcb", .data = &tcb_sama5d2_config },
 	{ /* sentinel */ }
 };
 
drivers/pwm/pwm-atmel.c +1 -2
index 06d22d0f7b26..86918523d821 100644
@@ -441,9 +441,8 @@ static const struct of_device_id atmel_pwm_dt_ids[] = {
 	}, {
 		.compatible = "microchip,sam9x60-pwm",
 		.data = &mchp_sam9x60_pwm_data,
-	}, {
-		/* sentinel */
 	},
+	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, atmel_pwm_dt_ids);
 
drivers/pwm/pwm-bcm-iproc.c +1 -1
index f4c9f10e490e..dc1e792b1e08 100644
@@ -230,7 +230,7 @@ static int iproc_pwmc_probe(struct platform_device *pdev)
 
 static const struct of_device_id bcm_iproc_pwmc_dt[] = {
 	{ .compatible = "brcm,iproc-pwm" },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, bcm_iproc_pwmc_dt);
 
drivers/pwm/pwm-bcm-kona.c +1 -1
index 022c078aae84..ecfa3e3707f4 100644
@@ -319,7 +319,7 @@ static int kona_pwmc_probe(struct platform_device *pdev)
 
 static const struct of_device_id bcm_kona_pwmc_dt[] = {
 	{ .compatible = "brcm,kona-pwm" },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, bcm_kona_pwmc_dt);
 
drivers/pwm/pwm-bcm2835.c +1 -1
index 532903da521f..a4fbf9cfc6f7 100644
@@ -165,7 +165,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(bcm2835_pwm_pm_ops, bcm2835_pwm_suspend,
 				bcm2835_pwm_resume);
 
 static const struct of_device_id bcm2835_pwm_of_match[] = {
-	{ .compatible = "brcm,bcm2835-pwm", },
+	{ .compatible = "brcm,bcm2835-pwm" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, bcm2835_pwm_of_match);
drivers/pwm/pwm-berlin.c +1 -1
index 858d36991374..5db4d41a7442 100644
@@ -191,7 +191,7 @@ static const struct pwm_ops berlin_pwm_ops = {
 
 static const struct of_device_id berlin_pwm_match[] = {
 	{ .compatible = "marvell,berlin-pwm" },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, berlin_pwm_match);
 
drivers/pwm/pwm-brcmstb.c +1 -1
index 82d27d07ba91..790ef7ffbbe5 100644
@@ -222,7 +222,7 @@ static const struct pwm_ops brcmstb_pwm_ops = {
 };
 
 static const struct of_device_id brcmstb_pwm_of_match[] = {
-	{ .compatible = "brcm,bcm7038-pwm", },
+	{ .compatible = "brcm,bcm7038-pwm" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, brcmstb_pwm_of_match);
drivers/pwm/pwm-clk.c +1 -1
index f8f5af57acba..1907f2f10e5c 100644
@@ -119,7 +119,7 @@ static void pwm_clk_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id pwm_clk_dt_ids[] = {
-	{ .compatible = "clk-pwm", },
+	{ .compatible = "clk-pwm" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, pwm_clk_dt_ids);
drivers/pwm/pwm-clps711x.c +1 -1
index 2c92ce754872..1ce12ee0329b 100644
@@ -91,7 +91,7 @@ static int clps711x_pwm_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id clps711x_pwm_dt_ids[] = {
-	{ .compatible = "cirrus,ep7209-pwm", },
+	{ .compatible = "cirrus,ep7209-pwm" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, clps711x_pwm_dt_ids);
drivers/pwm/pwm-cros-ec.c +1 -1
index 67cfa17f58e0..08a24a45c76d 100644
@@ -267,7 +267,7 @@ static int cros_ec_pwm_probe(struct platform_device *pdev)
 static const struct of_device_id cros_ec_pwm_of_match[] = {
 	{ .compatible = "google,cros-ec-pwm" },
 	{ .compatible = "google,cros-ec-pwm-type" },
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(of, cros_ec_pwm_of_match);
 #endif
drivers/pwm/pwm-hibvt.c +1 -1
index e02ee6383dbc..29ad8d0b5536 100644
@@ -266,7 +266,7 @@ static const struct of_device_id hibvt_pwm_of_match[] = {
 	  .data = &hi3559v100_shub_soc_info },
 	{ .compatible = "hisilicon,hi3559v100-pwm",
 	  .data = &hi3559v100_soc_info },
-	{  }
+	{ }
 };
 MODULE_DEVICE_TABLE(of, hibvt_pwm_of_match);
 
drivers/pwm/pwm-imx-tpm.c +1 -1
index 80fdb3303400..c20753a36d6d 100644
@@ -442,7 +442,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(imx_tpm_pwm_pm,
 				pwm_imx_tpm_suspend, pwm_imx_tpm_resume);
 
 static const struct of_device_id imx_tpm_pwm_dt_ids[] = {
-	{ .compatible = "fsl,imx7ulp-pwm", },
+	{ .compatible = "fsl,imx7ulp-pwm" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, imx_tpm_pwm_dt_ids);
drivers/pwm/pwm-imx1.c +1 -1
index d5535d208005..075d46180dff 100644
@@ -151,7 +151,7 @@ static const struct pwm_ops pwm_imx1_ops = {
 };
 
 static const struct of_device_id pwm_imx1_dt_ids[] = {
-	{ .compatible = "fsl,imx1-pwm", },
+	{ .compatible = "fsl,imx1-pwm" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, pwm_imx1_dt_ids);
drivers/pwm/pwm-imx27.c +1 -1
index c8b801fcb525..7c1ad15008d2 100644
@@ -378,7 +378,7 @@ static const struct pwm_ops pwm_imx27_ops = {
 };
 
 static const struct of_device_id pwm_imx27_dt_ids[] = {
-	{ .compatible = "fsl,imx27-pwm", },
+	{ .compatible = "fsl,imx27-pwm" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, pwm_imx27_dt_ids);
drivers/pwm/pwm-ipq.c +2 -2
index c53373948136..6b7aec566f7e 100644
@@ -245,8 +245,8 @@ static int ipq_pwm_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id pwm_ipq_dt_match[] = {
-	{ .compatible = "qcom,ipq6018-pwm", },
-	{}
+	{ .compatible = "qcom,ipq6018-pwm" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, pwm_ipq_dt_match);
 
drivers/pwm/pwm-jz4740.c +1 -1
index e0b5966fc7fe..0db1474c7c8c 100644
@@ -261,7 +261,7 @@ static const struct of_device_id jz4740_pwm_dt_ids[] = {
 	{ .compatible = "ingenic,jz4740-pwm", .data = &jz4740_soc_info },
 	{ .compatible = "ingenic,jz4725b-pwm", .data = &jz4725b_soc_info },
 	{ .compatible = "ingenic,x1000-pwm", .data = &x1000_soc_info },
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(of, jz4740_pwm_dt_ids);
 
drivers/pwm/pwm-lp3943.c +1 -1
index 90b0733c00c1..10537e74be28 100644
@@ -296,7 +296,7 @@ static int lp3943_pwm_probe(struct platform_device *pdev)
 
 #ifdef CONFIG_OF
 static const struct of_device_id lp3943_pwm_of_match[] = {
-	{ .compatible = "ti,lp3943-pwm", },
+	{ .compatible = "ti,lp3943-pwm" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, lp3943_pwm_of_match);
drivers/pwm/pwm-lpc18xx-sct.c +1 -1
index 1e614b2a0227..4a1950635850 100644
@@ -330,7 +330,7 @@ static const struct pwm_ops lpc18xx_pwm_ops = {
 
 static const struct of_device_id lpc18xx_pwm_of_match[] = {
 	{ .compatible = "nxp,lpc1850-sct-pwm" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(of, lpc18xx_pwm_of_match);
 
drivers/pwm/pwm-lpc32xx.c +1 -1
index c748537e57d1..19ec53648f40 100644
@@ -155,7 +155,7 @@ static int lpc32xx_pwm_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id lpc32xx_pwm_dt_ids[] = {
-	{ .compatible = "nxp,lpc3220-pwm", },
+	{ .compatible = "nxp,lpc3220-pwm" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, lpc32xx_pwm_dt_ids);
drivers/pwm/pwm-mediatek.c +1 -1
index 992137a27750..0bb49be657b7 100644
@@ -627,7 +627,7 @@ static const struct of_device_id pwm_mediatek_of_match[] = {
 	{ .compatible = "mediatek,mt8183-pwm", .data = &mt8183_pwm_data },
 	{ .compatible = "mediatek,mt8365-pwm", .data = &mt8365_pwm_data },
 	{ .compatible = "mediatek,mt8516-pwm", .data = &mt8516_pwm_data },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, pwm_mediatek_of_match);
 
drivers/pwm/pwm-meson.c +4 -5
index 8c6bf3d49753..20e6cd07127c 100644
@@ -596,15 +596,14 @@ static const struct of_device_id meson_pwm_matches[] = {
 	{
 		.compatible = "amlogic,meson8-pwm-v2",
 		.data = &pwm_meson8_v2_data
-	},
-	{
+	}, {
 		.compatible = "amlogic,meson-axg-pwm-v2",
 		.data = &pwm_meson_axg_v2_data
-	},
-	{
+	}, {
 		.compatible = "amlogic,meson-g12-pwm-v2",
 		.data = &pwm_meson_axg_v2_data
 	},
+
 	/* The following compatibles are obsolete */
 	{
 		.compatible = "amlogic,meson8b-pwm",
@@ -642,7 +641,7 @@ static const struct of_device_id meson_pwm_matches[] = {
 		.compatible = "amlogic,meson-s4-pwm",
 		.data = &pwm_s4_data
 	},
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(of, meson_pwm_matches);
 
drivers/pwm/pwm-mtk-disp.c +4 -4
index bafd6b6195f6..b5409e15dac8 100644
@@ -295,10 +295,10 @@ static const struct mtk_pwm_data mt8183_pwm_data = {
 };
 
 static const struct of_device_id mtk_disp_pwm_of_match[] = {
-	{ .compatible = "mediatek,mt2701-disp-pwm", .data = &mt2701_pwm_data},
-	{ .compatible = "mediatek,mt6595-disp-pwm", .data = &mt8173_pwm_data},
-	{ .compatible = "mediatek,mt8173-disp-pwm", .data = &mt8173_pwm_data},
-	{ .compatible = "mediatek,mt8183-disp-pwm", .data = &mt8183_pwm_data},
+	{ .compatible = "mediatek,mt2701-disp-pwm", .data = &mt2701_pwm_data },
+	{ .compatible = "mediatek,mt6595-disp-pwm", .data = &mt8173_pwm_data },
+	{ .compatible = "mediatek,mt8173-disp-pwm", .data = &mt8173_pwm_data },
+	{ .compatible = "mediatek,mt8183-disp-pwm", .data = &mt8183_pwm_data },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, mtk_disp_pwm_of_match);
drivers/pwm/pwm-mxs.c +1 -1
index 8cad214b1c29..e1a3df6549fc 100644
@@ -163,7 +163,7 @@ static int mxs_pwm_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id mxs_pwm_dt_ids[] = {
-	{ .compatible = "fsl,imx23-pwm", },
+	{ .compatible = "fsl,imx23-pwm" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, mxs_pwm_dt_ids);
drivers/pwm/pwm-omap-dmtimer.c +2 -2
index 1858a77401f8..51830a87275c 100644
@@ -444,8 +444,8 @@ static void pwm_omap_dmtimer_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id pwm_omap_dmtimer_of_match[] = {
-	{.compatible = "ti,omap-dmtimer-pwm"},
-	{}
+	{ .compatible = "ti,omap-dmtimer-pwm" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, pwm_omap_dmtimer_of_match);
 
drivers/pwm/pwm-pca9685.c +1 -1
index 8babd29f161c..a2792b803643 100644
@@ -550,7 +550,7 @@ static const struct acpi_device_id pca9685_acpi_ids[] = {
 MODULE_DEVICE_TABLE(acpi, pca9685_acpi_ids);
 
 static const struct of_device_id pca9685_dt_ids[] = {
-	{ .compatible = "nxp,pca9685-pwm", },
+	{ .compatible = "nxp,pca9685-pwm" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, pca9685_dt_ids);
drivers/pwm/pwm-pxa.c +4 -4
index 157735d0d054..07f5e09f1b1a 100644
@@ -144,10 +144,10 @@ static const struct pwm_ops pxa_pwm_ops = {
  * supported identically.
  */
 static const struct of_device_id pwm_of_match[] = {
-	{ .compatible = "marvell,pxa250-pwm", .data = &pwm_id_table[0]},
-	{ .compatible = "marvell,pxa270-pwm", .data = &pwm_id_table[0]},
-	{ .compatible = "marvell,pxa168-pwm", .data = &pwm_id_table[0]},
-	{ .compatible = "marvell,pxa910-pwm", .data = &pwm_id_table[0]},
+	{ .compatible = "marvell,pxa250-pwm", .data = &pwm_id_table[0] },
+	{ .compatible = "marvell,pxa270-pwm", .data = &pwm_id_table[0] },
+	{ .compatible = "marvell,pxa168-pwm", .data = &pwm_id_table[0] },
+	{ .compatible = "marvell,pxa910-pwm", .data = &pwm_id_table[0] },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, pwm_of_match);
drivers/pwm/pwm-raspberrypi-poe.c +1 -1
index 8921e7ea2cea..7cea6561c730 100644
@@ -177,7 +177,7 @@ static int raspberrypi_pwm_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id raspberrypi_pwm_of_match[] = {
-	{ .compatible = "raspberrypi,firmware-poe-pwm", },
+	{ .compatible = "raspberrypi,firmware-poe-pwm" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, raspberrypi_pwm_of_match);
drivers/pwm/pwm-rcar.c +2 -2
index 578dbdd2d5a7..1733cd700693 100644
@@ -248,8 +248,8 @@ static void rcar_pwm_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id rcar_pwm_of_table[] = {
-	{ .compatible = "renesas,pwm-rcar", },
-	{ },
+	{ .compatible = "renesas,pwm-rcar" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, rcar_pwm_of_table);
 
drivers/pwm/pwm-renesas-tpu.c +5 -5
index 2196080b4177..140fd0bcb93f 100644
@@ -479,11 +479,11 @@ static int tpu_probe(struct platform_device *pdev)
 
 #ifdef CONFIG_OF
 static const struct of_device_id tpu_of_table[] = {
-	{ .compatible = "renesas,tpu-r8a73a4", },
-	{ .compatible = "renesas,tpu-r8a7740", },
-	{ .compatible = "renesas,tpu-r8a7790", },
-	{ .compatible = "renesas,tpu", },
-	{ },
+	{ .compatible = "renesas,tpu-r8a73a4" },
+	{ .compatible = "renesas,tpu-r8a7740" },
+	{ .compatible = "renesas,tpu-r8a7790" },
+	{ .compatible = "renesas,tpu" },
+	{ }
 };
 
 MODULE_DEVICE_TABLE(of, tpu_of_table);
drivers/pwm/pwm-rockchip.c +4 -4
index 67b85bdb491b..050ca8aad0ca 100644
@@ -292,10 +292,10 @@ static const struct rockchip_pwm_data pwm_data_v3 = {
 };
 
 static const struct of_device_id rockchip_pwm_dt_ids[] = {
-	{ .compatible = "rockchip,rk2928-pwm", .data = &pwm_data_v1},
-	{ .compatible = "rockchip,rk3288-pwm", .data = &pwm_data_v2},
-	{ .compatible = "rockchip,vop-pwm", .data = &pwm_data_vop},
-	{ .compatible = "rockchip,rk3328-pwm", .data = &pwm_data_v3},
+	{ .compatible = "rockchip,rk2928-pwm", .data = &pwm_data_v1 },
+	{ .compatible = "rockchip,rk3288-pwm", .data = &pwm_data_v2 },
+	{ .compatible = "rockchip,vop-pwm", .data = &pwm_data_vop },
+	{ .compatible = "rockchip,rk3328-pwm", .data = &pwm_data_v3 },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, rockchip_pwm_dt_ids);
drivers/pwm/pwm-rzg2l-gpt.c +1 -1
index dfa1d11a48a8..ac8399b96ad1 100644
@@ -437,7 +437,7 @@ static int rzg2l_gpt_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id rzg2l_gpt_of_table[] = {
-	{ .compatible = "renesas,rzg2l-gpt", },
+	{ .compatible = "renesas,rzg2l-gpt" },
 	{ /* Sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, rzg2l_gpt_of_table);
drivers/pwm/pwm-samsung.c +1 -1
index 951b38ff5f8e..331e81f1594a 100644
@@ -501,7 +501,7 @@ static const struct of_device_id samsung_pwm_matches[] = {
 	{ .compatible = "samsung,s5p6440-pwm", .data = &s5p64x0_variant },
 	{ .compatible = "samsung,s5pc100-pwm", .data = &s5pc100_variant },
 	{ .compatible = "samsung,exynos4210-pwm", .data = &s5p64x0_variant },
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(of, samsung_pwm_matches);
 
drivers/pwm/pwm-sifive.c +1 -1
index 4a07315b0744..d5000ea9084a 100644
@@ -356,7 +356,7 @@ static void pwm_sifive_remove(struct platform_device *dev)
 
 static const struct of_device_id pwm_sifive_of_match[] = {
 	{ .compatible = "sifive,pwm0" },
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(of, pwm_sifive_of_match);
 
drivers/pwm/pwm-sl28cpld.c +1 -1
index 934378d6a002..ba6bec0b9289 100644
@@ -245,7 +245,7 @@ static int sl28cpld_pwm_probe(struct platform_device *pdev)
 
 static const struct of_device_id sl28cpld_pwm_of_match[] = {
 	{ .compatible = "kontron,sl28cpld-pwm" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(of, sl28cpld_pwm_of_match);
 
drivers/pwm/pwm-sophgo-sg2042.c +3 -4
index 7d07b0ca7d29..0b6461172e6a 100644
@@ -225,11 +225,10 @@ static const struct sg2042_chip_data sg2044_chip_data = {
 static const struct of_device_id sg2042_pwm_ids[] = {
 	{
 		.compatible = "sophgo,sg2042-pwm",
-		.data = &sg2042_chip_data
-	},
-	{
+		.data = &sg2042_chip_data,
+	}, {
 		.compatible = "sophgo,sg2044-pwm",
-		.data = &sg2044_chip_data
+		.data = &sg2044_chip_data,
 	},
 	{ }
 };
drivers/pwm/pwm-sprd.c +2 -2
index 4c76ca5e4cdd..88928f9e7557 100644
@@ -277,8 +277,8 @@ static int sprd_pwm_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id sprd_pwm_of_match[] = {
-	{ .compatible = "sprd,ums512-pwm", },
-	{ },
+	{ .compatible = "sprd,ums512-pwm" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, sprd_pwm_of_match);
 
drivers/pwm/pwm-sti.c +1 -1
index 3b702b8f0c7f..e5c3cf594571 100644
@@ -625,7 +625,7 @@ static int sti_pwm_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id sti_pwm_of_match[] = {
-	{ .compatible = "st,sti-pwm", },
+	{ .compatible = "st,sti-pwm" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, sti_pwm_of_match);
drivers/pwm/pwm-stm32-lp.c +2 -2
index 4789eafb8bac..2aa88f4985f5 100644
@@ -412,8 +412,8 @@ static DEFINE_SIMPLE_DEV_PM_OPS(stm32_pwm_lp_pm_ops, stm32_pwm_lp_suspend,
 				stm32_pwm_lp_resume);
 
 static const struct of_device_id stm32_pwm_lp_of_match[] = {
-	{ .compatible = "st,stm32-pwm-lp", },
-	{},
+	{ .compatible = "st,stm32-pwm-lp" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, stm32_pwm_lp_of_match);
 
drivers/pwm/pwm-stm32.c +3 -3
index c708e4a7ad70..ea5a51a2800f 100644
@@ -918,9 +918,9 @@ static int stm32_pwm_resume(struct device *dev)
 static DEFINE_SIMPLE_DEV_PM_OPS(stm32_pwm_pm_ops, stm32_pwm_suspend, stm32_pwm_resume);
 
 static const struct of_device_id stm32_pwm_of_match[] = {
-	{ .compatible = "st,stm32-pwm",	},
-	{ .compatible = "st,stm32mp25-pwm", },
-	{ /* end node */ },
+	{ .compatible = "st,stm32-pwm" },
+	{ .compatible = "st,stm32mp25-pwm" },
+	{ /* end node */ }
 };
 MODULE_DEVICE_TABLE(of, stm32_pwm_of_match);
 
drivers/pwm/pwm-sun4i.c +1 -1
index 6c5591ca868b..0752152b1470 100644
@@ -369,7 +369,7 @@ static const struct of_device_id sun4i_pwm_dt_ids[] = {
 		.data = &sun50i_h6_pwm_data,
 	}, {
 		/* sentinel */
-	},
+	}
 };
 MODULE_DEVICE_TABLE(of, sun4i_pwm_dt_ids);
 
drivers/pwm/pwm-sunplus.c +2 -2
index b342b843247b..b578f3f1a3a3 100644
@@ -214,8 +214,8 @@ static int sunplus_pwm_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id sunplus_pwm_of_match[] = {
-	{ .compatible = "sunplus,sp7021-pwm", },
-	{}
+	{ .compatible = "sunplus,sp7021-pwm" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, sunplus_pwm_of_match);
 
drivers/pwm/pwm-tiecap.c +3 -3
index 67cc5e8bdb0e..3751737ead43 100644
@@ -211,9 +211,9 @@ static const struct pwm_ops ecap_pwm_ops = {
 };
 
 static const struct of_device_id ecap_of_match[] = {
-	{ .compatible	= "ti,am3352-ecap" },
-	{ .compatible	= "ti,am33xx-ecap" },
-	{},
+	{ .compatible = "ti,am3352-ecap" },
+	{ .compatible = "ti,am33xx-ecap" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, ecap_of_match);
 
drivers/pwm/pwm-tiehrpwm.c +1 -1
index 2533c95b0ba9..3a53489f0b98 100644
@@ -407,7 +407,7 @@ static const struct pwm_ops ehrpwm_pwm_ops = {
 static const struct of_device_id ehrpwm_of_match[] = {
 	{ .compatible = "ti,am3352-ehrpwm" },
 	{ .compatible = "ti,am33xx-ehrpwm" },
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(of, ehrpwm_of_match);
 
drivers/pwm/pwm-twl-led.c +1 -1
index a555cc3be4b3..e1b6871af81e 100644
@@ -338,7 +338,7 @@ static int twl_pwmled_probe(struct platform_device *pdev)
 static const struct of_device_id twl_pwmled_of_match[] = {
 	{ .compatible = "ti,twl4030-pwmled" },
 	{ .compatible = "ti,twl6030-pwmled" },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, twl_pwmled_of_match);
 #endif
drivers/pwm/pwm-twl.c +1 -1
index 8f981ffff4b4..99c1caf4f19c 100644
@@ -362,7 +362,7 @@ static int twl_pwm_probe(struct platform_device *pdev)
 static const struct of_device_id twl_pwm_of_match[] = {
 	{ .compatible = "ti,twl4030-pwm" },
 	{ .compatible = "ti,twl6030-pwm" },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, twl_pwm_of_match);
 #endif
drivers/pwm/pwm-visconti.c +1 -1
index 28fae4979e3f..830aef483bd0 100644
@@ -156,7 +156,7 @@ static int visconti_pwm_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id visconti_pwm_of_match[] = {
-	{ .compatible = "toshiba,visconti-pwm", },
+	{ .compatible = "toshiba,visconti-pwm" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, visconti_pwm_of_match);
drivers/pwm/pwm-vt8500.c +1 -1
index 016c82d65527..3f2c8031a626 100644
@@ -227,7 +227,7 @@ static const struct pwm_ops vt8500_pwm_ops = {
 };
 
 static const struct of_device_id vt8500_pwm_dt_ids[] = {
-	{ .compatible = "via,vt8500-pwm", },
+	{ .compatible = "via,vt8500-pwm" },
 	{ /* Sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, vt8500_pwm_dt_ids);
drivers/pwm/pwm-xilinx.c +2 -2
index 52c241982807..fa2d10e658dd 100644
@@ -281,8 +281,8 @@ static int xilinx_pwm_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id xilinx_pwm_of_match[] = {
-	{ .compatible = "xlnx,xps-timer-1.00.a", },
-	{},
+	{ .compatible = "xlnx,xps-timer-1.00.a" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, xilinx_pwm_of_match);
 
Signature · 1 line
2.55.0.11.g153666a7d9bb
maintainer Reviewed-by on v1 4/5
#5 lore raw

Re: [PATCH v1 4/5] pwm: Unify coding style of of_device_id arrays

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

- Use a single space in a of_device_id array terminator; A single space after the opening { and before the closing } in non-empty initializers;
- No comma after an array terminator;
- Also no trailing comma after a named initializer iff the

iff -> if

Quoted 3 lines
    closing } is on the same line;

[......]

Quoted 9 lines
drivers/pwm/pwm-sophgo-sg2042.c +0 -1
index 7d07b0ca7d29..0b6461172e6a 100644
@@ -225,11 +225,10 @@ static const struct sg2042_chip_data sg2044_chip_data = {
  static const struct of_device_id sg2042_pwm_ids[] = {
  	{
  		.compatible = "sophgo,sg2042-pwm",
-		.data = &sg2042_chip_data

drivers/pwm/pwm-sophgo-sg2042.c static const struct sg2042_chip_data sg2044_chip_data = { · line 234

Quoted 10 lines
drivers/pwm/pwm-sophgo-sg2042.c +3 -3
-	},
-	{
+		.data = &sg2042_chip_data,
+	}, {
  		.compatible = "sophgo,sg2044-pwm",
-		.data = &sg2044_chip_data
+		.data = &sg2044_chip_data,
  	},
  	{ }
  };

Changes to sophgo related files:

Thanks,

Chen

[......]

#6 lore raw

Re: [PATCH v1 4/5] pwm: Unify coding style of of_device_id arrays

Hello Chen,

Quoted 7 lines · Chen Wang
Quoted 5 lines · Uwe Kleine-König (The Capable Hub)

- Use a single space in a of_device_id array terminator; A single space after the opening { and before the closing } in non-empty initializers;
- No comma after an array terminator;
- Also no trailing comma after a named initializer iff the

iff -> if

This is actually intended. iff = "if and only if", see e.g.
https://en.wikipedia.org/wiki/If_and_only_if .

Quoted 28 lines
Quoted 3 lines
    closing } is on the same line;

[......]

Quoted 9 lines
drivers/pwm/pwm-sophgo-sg2042.c +0 -1
index 7d07b0ca7d29..0b6461172e6a 100644
@@ -225,11 +225,10 @@ static const struct sg2042_chip_data sg2044_chip_data = {
  static const struct of_device_id sg2042_pwm_ids[] = {
  	{
  		.compatible = "sophgo,sg2042-pwm",
-		.data = &sg2042_chip_data

drivers/pwm/pwm-sophgo-sg2042.c static const struct sg2042_chip_data sg2044_chip_data = { · line 234

Quoted 10 lines
drivers/pwm/pwm-sophgo-sg2042.c +3 -3
-	},
-	{
+		.data = &sg2042_chip_data,
+	}, {
  		.compatible = "sophgo,sg2044-pwm",
-		.data = &sg2044_chip_data
+		.data = &sg2044_chip_data,
  	},
  	{ }
  };

Changes to sophgo related files:

Quoted 1 line

Thanks
Uwe

#7 lore raw

Re: [PATCH v1 4/5] pwm: Unify coding style of of_device_id arrays

Hi Uwe,

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

Hello Chen,

Quoted 6 lines · Chen Wang
Quoted 5 lines · Uwe Kleine-König (The Capable Hub)

- Use a single space in a of_device_id array terminator; A single space after the opening { and before the closing } in non-empty initializers;
- No comma after an array terminator;
- Also no trailing comma after a named initializer iff the

Quoted 4 lines
Quoted 1 line

iff -> if

This is actually intended. iff = "if and only if", see e.g.
https://en.wikipedia.org/wiki/If_and_only_if .

I agree this scientific idiomatic expression is not well known by non-native English speakers, and using the expanded form is just simpler to review (thinking at non-native English speaker reading your commit in the future).

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
     closing } is on the same line;

[......]

#8 lore raw

Re: [PATCH v1 4/5] pwm: Unify coding style of of_device_id arrays

Hello,

Quoted 14 lines · Philippe Mathieu-Daudé

Hi Uwe,

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

Hello Chen,

Quoted 7 lines · Chen Wang
Quoted 5 lines · Uwe Kleine-König (The Capable Hub)

- Use a single space in a of_device_id array terminator; A single space after the opening { and before the closing } in non-empty initializers;
- No comma after an array terminator;
- Also no trailing comma after a named initializer iff the

iff -> if

Quoted 7 lines
Quoted 2 lines

This is actually intended. iff = "if and only if", see e.g.
https://en.wikipedia.org/wiki/If_and_only_if .

I agree this scientific idiomatic expression is not well known by non-native English speakers, and using the expanded form is just simpler to review (thinking at non-native English speaker reading your commit in the future).

fine for me, I'll fixup to

- Also no trailing comma after a named initializer if (and only if) the closing } is on the same line;

when applying.

Best regards
Uwe

#9 lore raw

Re: [PATCH v1 4/5] pwm: Unify coding style of of_device_id arrays

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

Hello,

Quoted 17 lines · Philippe Mathieu-Daudé

Hi Uwe,

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

Hello Chen,

Quoted 7 lines · Chen Wang
Quoted 5 lines · Uwe Kleine-König (The Capable Hub)

- Use a single space in a of_device_id array terminator; A single space after the opening { and before the closing } in non-empty initializers;
- No comma after an array terminator;
- Also no trailing comma after a named initializer iff the

iff -> if

This is actually intended. iff = "if and only if", see e.g.
https://en.wikipedia.org/wiki/If_and_only_if .

Quoted 6 lines
Quoted 4 lines

I agree this scientific idiomatic expression is not well known by non-native English speakers, and using the expanded form is just simpler to review (thinking at non-native English speaker reading your commit in the future).

fine for me, I'll fixup to

Noooo, really, this is nitpicking on this commit. Not that I like that commit - it's just churn - but 'iff' is widely known and widely used in Linux kernel. It's completely correct, it is common and expected.

It is not scientific expression. It is common in the kernel docs.

Best regards,
Krzysztof

Reviewed-by on v1 4/5
#10 lore raw

Re: [PATCH v1 4/5] pwm: Unify coding style of of_device_id arrays

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

- Use a single space in a of_device_id array terminator; A single space after the opening { and before the closing } in non-empty initializers;
- No comma after an array terminator;
- Also no trailing comma after a named initializer iff the closing } is on the same line;

Quoted 5 lines
 drivers/pwm/pwm-rcar.c            |  4 ++--
 drivers/pwm/pwm-renesas-tpu.c     | 10 +++++-----
 drivers/pwm/pwm-rzg2l-gpt.c       |  2 +-

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#11 lore raw

PATCH 5/5 pwm: lpss-pci: Unify coding style of pci_device_id array

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

Don't use a comma after an array terminator.

---
 drivers/pwm/pwm-lpss-pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/pwm-lpss-pci.c +1 -1
index 3a0fd6593520..bcbfda1a6624 100644
@@ -57,7 +57,7 @@ static const struct pci_device_id pwm_lpss_pci_ids[] = {
 	{ PCI_VDEVICE(INTEL, 0x2289), .driver_data = (unsigned long)&pwm_lpss_bsw_info },
 	{ PCI_VDEVICE(INTEL, 0x31c8), .driver_data = (unsigned long)&pwm_lpss_bxt_info },
 	{ PCI_VDEVICE(INTEL, 0x5ac8), .driver_data = (unsigned long)&pwm_lpss_bxt_info },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(pci, pwm_lpss_pci_ids);
 
Signature · 1 line
2.55.0.11.g153666a7d9bb
#12 lore raw
In reply to Uwe Kleine-König (The Capable Hub)

Hello,

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

this series is part of a preparation for changing .driver_data (and similarily named members) of *_device_id to an anonymous union. See e.g.
https://lore.kernel.org/all/[email protected]/
for the idea behind it. I also grabbed the opportunity to unify the coding style for all these arrays while going through these.

The patch series is based on pwm/for-next + "pwm: pxa: Depend on OF and simplify accordingly" [1].

Applied the series with s/iff/if (and only if)/ in the of_device_id style patch.

Best regards
Uwe