diff mbox series

[v2,16/21] gpio: Unify style of acpi_device_id arrays

Message ID bf617dc2c662e80833406bd3a3f23cecdde071e4.1784133987.git.u.kleine-koenig@baylibre.com
State Handled Elsewhere
Headers show
Series gpio: Improvements around device-id arrays | expand

Commit Message

Uwe Kleine-König July 15, 2026, 4:55 p.m. UTC
Update the various acpi_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. Additionally sort the entries by
.id.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
 drivers/gpio/gpio-amdpt.c           | 2 +-
 drivers/gpio/gpio-dwapb.c           | 2 +-
 drivers/gpio/gpio-graniterapids.c   | 2 +-
 drivers/gpio/gpio-hisi.c            | 2 +-
 drivers/gpio/gpio-loongson-64bit.c  | 2 +-
 drivers/gpio/gpio-mlxbf.c           | 2 +-
 drivers/gpio/gpio-mlxbf2.c          | 2 +-
 drivers/gpio/gpio-mlxbf3.c          | 2 +-
 drivers/gpio/gpio-novalake-events.c | 2 +-
 drivers/gpio/gpio-tegra186.c        | 2 +-
 drivers/gpio/gpio-xgene-sb.c        | 2 +-
 drivers/gpio/gpio-xgene.c           | 2 +-
 drivers/gpio/gpio-xlp.c             | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

Comments

Andy Shevchenko July 16, 2026, 5:41 p.m. UTC | #1
On Wed, Jul 15, 2026 at 06:55:21PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> Update the various acpi_device_id arrays to conform to the most used and
> generally recommended coding style. That is:

...

>  static const struct acpi_device_id dwapb_acpi_match[] = {
> -	{ .id = "HISI0181", .driver_data = GPIO_REG_OFFSET_V1 },
>  	{ .id = "APMC0D07", .driver_data = GPIO_REG_OFFSET_V1 },
>  	{ .id = "APMC0D81", .driver_data = GPIO_REG_OFFSET_V2 },
>  	{ .id = "FUJI200A", .driver_data = GPIO_REG_OFFSET_V1 },
> +	{ .id = "HISI0181", .driver_data = GPIO_REG_OFFSET_V1 },
>  	{ .id = "LECA0001", .driver_data = GPIO_REG_OFFSET_V1 },
>  	{ }

Why this churn? It simply should be folded to the previous patch.
Uwe Kleine-König July 17, 2026, 8:31 a.m. UTC | #2
Hello Andy,

On Thu, Jul 16, 2026 at 08:41:15PM +0300, Andy Shevchenko wrote:
> On Wed, Jul 15, 2026 at 06:55:21PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> > Update the various acpi_device_id arrays to conform to the most used and
> > generally recommended coding style. That is:
> 
> ...
> 
> >  static const struct acpi_device_id dwapb_acpi_match[] = {
> > -	{ .id = "HISI0181", .driver_data = GPIO_REG_OFFSET_V1 },
> >  	{ .id = "APMC0D07", .driver_data = GPIO_REG_OFFSET_V1 },
> >  	{ .id = "APMC0D81", .driver_data = GPIO_REG_OFFSET_V2 },
> >  	{ .id = "FUJI200A", .driver_data = GPIO_REG_OFFSET_V1 },
> > +	{ .id = "HISI0181", .driver_data = GPIO_REG_OFFSET_V1 },
> >  	{ .id = "LECA0001", .driver_data = GPIO_REG_OFFSET_V1 },
> >  	{ }
> 
> Why this churn? It simply should be folded to the previous patch.

I guess with "previous patch" you mean "[PATCH v2 12/21] gpio: Use named
initializers for acpi_device_id array"? I didn't fold the reordering
into that, because reordering isn't about using named initializers and
mixing in other changes makes reviewing harder. And given that there is
a "churn" patch anyhow (which is "needed" because not all arrays that
use unusual styling have an earlier change) fixing the ordering in the
"unify style" patch IMHO fits better.

But note that for removing trailing , and spacing in the lines that I
touch in patch #12, I agree to do that there. So we're talking about
grey and subjective areas. But note that reordering breaks the promise
of patch #12 "This patch doesn't modify the compiled arrays", which was
the relevant reason for my choice when considering where to implement
your sort request.

Also note that folding cleanups into patches that touch the same code
area also makes it harder to keep commit logs up-to-date, which you
already noticed I didn't master even with only doing one thing per
patch.

Best regards
Uwe
Andy Shevchenko July 17, 2026, 10:27 a.m. UTC | #3
On Fri, Jul 17, 2026 at 10:31:36AM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> On Thu, Jul 16, 2026 at 08:41:15PM +0300, Andy Shevchenko wrote:
> > On Wed, Jul 15, 2026 at 06:55:21PM +0200, Uwe Kleine-König (The Capable Hub) wrote:

...

> > >  static const struct acpi_device_id dwapb_acpi_match[] = {
> > > -	{ .id = "HISI0181", .driver_data = GPIO_REG_OFFSET_V1 },
> > >  	{ .id = "APMC0D07", .driver_data = GPIO_REG_OFFSET_V1 },
> > >  	{ .id = "APMC0D81", .driver_data = GPIO_REG_OFFSET_V2 },
> > >  	{ .id = "FUJI200A", .driver_data = GPIO_REG_OFFSET_V1 },
> > > +	{ .id = "HISI0181", .driver_data = GPIO_REG_OFFSET_V1 },
> > >  	{ .id = "LECA0001", .driver_data = GPIO_REG_OFFSET_V1 },
> > >  	{ }
> > 
> > Why this churn? It simply should be folded to the previous patch.
> 
> I guess with "previous patch" you mean "[PATCH v2 12/21] gpio: Use named
> initializers for acpi_device_id array"?

> I didn't fold the reordering
> into that, because reordering isn't about using named initializers and
> mixing in other changes makes reviewing harder.

I have, obviously, the opposite opinion. This makes an additional unneeded
churn while reordering does naturally fit the other patch.

> And given that there is
> a "churn" patch anyhow (which is "needed" because not all arrays that
> use unusual styling have an earlier change) fixing the ordering in the
> "unify style" patch IMHO fits better.
> 
> But note that for removing trailing , and spacing in the lines that I
> touch in patch #12, I agree to do that there. So we're talking about
> grey and subjective areas. But note that reordering breaks the promise
> of patch #12 "This patch doesn't modify the compiled arrays", which was
> the relevant reason for my choice when considering where to implement
> your sort request.
> 
> Also note that folding cleanups into patches that touch the same code
> area also makes it harder to keep commit logs up-to-date, which you
> already noticed I didn't master even with only doing one thing per
> patch.

Sometimes being too pedantic is not a good thing. You can tell it towards my
review as well, but my point here is to bend a rule very slightly to avoid
unneeded churn. Having stuck with "one patch — one logical change" makes a lot
of noise in such a conversion.
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-amdpt.c b/drivers/gpio/gpio-amdpt.c
index 32c4d0ee8101..74b40e2c3485 100644
--- a/drivers/gpio/gpio-amdpt.c
+++ b/drivers/gpio/gpio-amdpt.c
@@ -128,7 +128,7 @@  static const struct acpi_device_id pt_gpio_acpi_match[] = {
 	{ .id = "AMDF030", .driver_data = PT_TOTAL_GPIO },
 	{ .id = "AMDIF030", .driver_data = PT_TOTAL_GPIO },
 	{ .id = "AMDIF031", .driver_data = PT_TOTAL_GPIO_EX },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, pt_gpio_acpi_match);
 
diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c
index e159c3f98f1c..3b24daabcf0f 100644
--- a/drivers/gpio/gpio-dwapb.c
+++ b/drivers/gpio/gpio-dwapb.c
@@ -720,10 +720,10 @@  static const struct of_device_id dwapb_of_match[] = {
 MODULE_DEVICE_TABLE(of, dwapb_of_match);
 
 static const struct acpi_device_id dwapb_acpi_match[] = {
-	{ .id = "HISI0181", .driver_data = GPIO_REG_OFFSET_V1 },
 	{ .id = "APMC0D07", .driver_data = GPIO_REG_OFFSET_V1 },
 	{ .id = "APMC0D81", .driver_data = GPIO_REG_OFFSET_V2 },
 	{ .id = "FUJI200A", .driver_data = GPIO_REG_OFFSET_V1 },
+	{ .id = "HISI0181", .driver_data = GPIO_REG_OFFSET_V1 },
 	{ .id = "LECA0001", .driver_data = GPIO_REG_OFFSET_V1 },
 	{ }
 };
diff --git a/drivers/gpio/gpio-graniterapids.c b/drivers/gpio/gpio-graniterapids.c
index 6a77a5864d09..72be289c65fa 100644
--- a/drivers/gpio/gpio-graniterapids.c
+++ b/drivers/gpio/gpio-graniterapids.c
@@ -395,7 +395,7 @@  static DEFINE_SIMPLE_DEV_PM_OPS(gnr_gpio_pm_ops, gnr_gpio_suspend, gnr_gpio_resu
 
 static const struct acpi_device_id gnr_gpio_acpi_match[] = {
 	{ .id = "INTC1109" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, gnr_gpio_acpi_match);
 
diff --git a/drivers/gpio/gpio-hisi.c b/drivers/gpio/gpio-hisi.c
index 1a89695ce515..f03df71e3296 100644
--- a/drivers/gpio/gpio-hisi.c
+++ b/drivers/gpio/gpio-hisi.c
@@ -223,7 +223,7 @@  static void hisi_gpio_init_irq(struct hisi_gpio *hisi_gpio)
 
 static const struct acpi_device_id hisi_gpio_acpi_match[] = {
 	{ .id = "HISI0184" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, hisi_gpio_acpi_match);
 
diff --git a/drivers/gpio/gpio-loongson-64bit.c b/drivers/gpio/gpio-loongson-64bit.c
index 0fdf15faa344..d76c3cf177d1 100644
--- a/drivers/gpio/gpio-loongson-64bit.c
+++ b/drivers/gpio/gpio-loongson-64bit.c
@@ -556,7 +556,7 @@  static const struct acpi_device_id loongson_gpio_acpi_match[] = {
 		.id = "LOON000F",
 		.driver_data = (kernel_ulong_t)&loongson_gpio_ls3a6000_data,
 	},
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, loongson_gpio_acpi_match);
 
diff --git a/drivers/gpio/gpio-mlxbf.c b/drivers/gpio/gpio-mlxbf.c
index b2a7a41f1437..3fbb65200c55 100644
--- a/drivers/gpio/gpio-mlxbf.c
+++ b/drivers/gpio/gpio-mlxbf.c
@@ -134,7 +134,7 @@  static int mlxbf_gpio_resume(struct platform_device *pdev)
 
 static const struct acpi_device_id mlxbf_gpio_acpi_match[] = {
 	{ "MLNXBF02" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, mlxbf_gpio_acpi_match);
 
diff --git a/drivers/gpio/gpio-mlxbf2.c b/drivers/gpio/gpio-mlxbf2.c
index ecb0feb9b73f..dd4cac6d96da 100644
--- a/drivers/gpio/gpio-mlxbf2.c
+++ b/drivers/gpio/gpio-mlxbf2.c
@@ -450,7 +450,7 @@  static DEFINE_SIMPLE_DEV_PM_OPS(mlxbf2_pm_ops, mlxbf2_gpio_suspend, mlxbf2_gpio_
 
 static const struct acpi_device_id mlxbf2_gpio_acpi_match[] = {
 	{ "MLNXBF22" },
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, mlxbf2_gpio_acpi_match);
 
diff --git a/drivers/gpio/gpio-mlxbf3.c b/drivers/gpio/gpio-mlxbf3.c
index 99b880596330..dd4df1fba60a 100644
--- a/drivers/gpio/gpio-mlxbf3.c
+++ b/drivers/gpio/gpio-mlxbf3.c
@@ -272,7 +272,7 @@  static void mlxbf3_gpio_shutdown(struct platform_device *pdev)
 
 static const struct acpi_device_id mlxbf3_gpio_acpi_match[] = {
 	{ .id = "MLNXBF33" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, mlxbf3_gpio_acpi_match);
 
diff --git a/drivers/gpio/gpio-novalake-events.c b/drivers/gpio/gpio-novalake-events.c
index d5a3bd48bed3..113a4069120a 100644
--- a/drivers/gpio/gpio-novalake-events.c
+++ b/drivers/gpio/gpio-novalake-events.c
@@ -305,7 +305,7 @@  static int nvl_gpio_probe(struct platform_device *pdev)
 
 static const struct acpi_device_id nvl_gpio_acpi_match[] = {
 	{ .id = "INTC1114" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, nvl_gpio_acpi_match);
 
diff --git a/drivers/gpio/gpio-tegra186.c b/drivers/gpio/gpio-tegra186.c
index d9a2dedf50ea..e94eaf23a5db 100644
--- a/drivers/gpio/gpio-tegra186.c
+++ b/drivers/gpio/gpio-tegra186.c
@@ -1543,7 +1543,7 @@  static const struct acpi_device_id  tegra186_gpio_acpi_match[] = {
 	{ .id = "NVDA0608", .driver_data = (kernel_ulong_t)&tegra241_aon_soc },
 	{ .id = "NVDA0708", .driver_data = (kernel_ulong_t)&tegra410_compute_soc },
 	{ .id = "NVDA0808", .driver_data = (kernel_ulong_t)&tegra410_system_soc },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, tegra186_gpio_acpi_match);
 
diff --git a/drivers/gpio/gpio-xgene-sb.c b/drivers/gpio/gpio-xgene-sb.c
index 6f2907468507..30b6e9f3f8ba 100644
--- a/drivers/gpio/gpio-xgene-sb.c
+++ b/drivers/gpio/gpio-xgene-sb.c
@@ -340,7 +340,7 @@  MODULE_DEVICE_TABLE(of, xgene_gpio_sb_of_match);
 
 static const struct acpi_device_id xgene_gpio_sb_acpi_match[] = {
 	{ .id = "APMC0D15" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, xgene_gpio_sb_acpi_match);
 
diff --git a/drivers/gpio/gpio-xgene.c b/drivers/gpio/gpio-xgene.c
index 84c1cc165024..f4adf2962557 100644
--- a/drivers/gpio/gpio-xgene.c
+++ b/drivers/gpio/gpio-xgene.c
@@ -196,7 +196,7 @@  MODULE_DEVICE_TABLE(of, xgene_gpio_of_match);
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id xgene_gpio_acpi_match[] = {
 	{ .id = "APMC0D14" },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, xgene_gpio_acpi_match);
 #endif
diff --git a/drivers/gpio/gpio-xlp.c b/drivers/gpio/gpio-xlp.c
index 50625f98f8e2..d659112d7f1c 100644
--- a/drivers/gpio/gpio-xlp.c
+++ b/drivers/gpio/gpio-xlp.c
@@ -306,7 +306,7 @@  static int xlp_gpio_probe(struct platform_device *pdev)
 static const struct acpi_device_id xlp_gpio_acpi_match[] = {
 	{ .id = "BRCM9006" },
 	{ .id = "CAV9006" },
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, xlp_gpio_acpi_match);
 #endif