Skip to contentSkip to conversation

net: ethernet: ti: davinci_mdio: Drop commas after match table sentinels

PATCH Applied Geert Uytterhoeven 5 participants 8 messages Sep 3 – Sep 8

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

PATCH 1/1 net: ethernet: ti: davinci_mdio: Drop commas after match table sentinels

It does not make sense to have a comma after a sentinel, as any new elements must be added before the sentinel.

---
 drivers/net/ethernet/ti/davinci_mdio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/ti/davinci_mdio.c +2 -2
index 48f85a3649b26548..5bec72f2f51dc548 100644
@@ -510,7 +510,7 @@ static const struct soc_device_attribute k3_mdio_socinfo[] = {
 	{ .family = "J7200", .data = &am65_mdio_soc_data },
 	{ .family = "J721E", .data = &am65_mdio_soc_data },
 	{ .family = "J721S2", .data = &am65_mdio_soc_data },
-	{ /* sentinel */ },
+	{ /* sentinel */ }
 };
 
 #if IS_ENABLED(CONFIG_OF)
@@ -521,7 +521,7 @@ static const struct davinci_mdio_of_param of_cpsw_mdio_data = {
 static const struct of_device_id davinci_mdio_of_mtable[] = {
 	{ .compatible = "ti,davinci_mdio", },
 	{ .compatible = "ti,cpsw-mdio", .data = &of_cpsw_mdio_data},
-	{ /* sentinel */ },
+	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, davinci_mdio_of_mtable);
 #endif
Signature · 1 line
2.43.0
#1 lore raw
Quoted 2 lines · Geert Uytterhoeven

It does not make sense to have a comma after a sentinel, as any new elements must be added before the sentinel.

While I agree with it, this seems to require a 'cleanup-series' rather than an individual patch, given the following statistics:

As of [0], running
git grep "sentinel.*}" drivers/net/ | wc -l
gives

	84
and looking for the ones that terminate in a comma by running
	git grep "sentinel.*}," drivers/net/ | wc -l
gives
	38

So there are '37' other instances (apart from davinci_mdio.c) in drivers/net alone that require a cleanup.

Looking at Linux overall by running

	git grep "sentinel.*}," | wc -l
gives
	396

Since this isn't a functional change, I am not sure why a specific change is required in davinci_mdio.c, unless you plan to cleanup the remaining '395' occurrences in the remaining code as well. I am not against the patch, but the reason for picking just davinci_mdio.c for cleanup isn't clear to me based on the commit message.

[0]: commit 940de590b839 Merge tag 'hardening-v7.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Quoted 20 lines
---
  drivers/net/ethernet/ti/davinci_mdio.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/ti/davinci_mdio.c +1 -1
index 48f85a3649b26548..5bec72f2f51dc548 100644
@@ -510,7 +510,7 @@ static const struct soc_device_attribute k3_mdio_socinfo[] = {
  	{ .family = "J7200", .data = &am65_mdio_soc_data },
  	{ .family = "J721E", .data = &am65_mdio_soc_data },
  	{ .family = "J721S2", .data = &am65_mdio_soc_data },
-	{ /* sentinel */ },
+	{ /* sentinel */ }
  };
 
  #if IS_ENABLED(CONFIG_OF)

drivers/net/ethernet/ti/davinci_mdio.c static const struct davinci_mdio_of_param of_cpsw_mdio_data = { · line 527

Quoted 8 lines
drivers/net/ethernet/ti/davinci_mdio.c +1 -1
@@ -521,7 +521,7 @@ static const struct davinci_mdio_of_param of_cpsw_mdio_data = {
  static const struct of_device_id davinci_mdio_of_mtable[] = {
  	{ .compatible = "ti,davinci_mdio", },
  	{ .compatible = "ti,cpsw-mdio", .data = &of_cpsw_mdio_data},
-	{ /* sentinel */ },
+	{ /* sentinel */ }
  };
  MODULE_DEVICE_TABLE(of, davinci_mdio_of_mtable);
  #endif

Regards,
Siddharth.

#2 lore raw
Quoted 15 lines · Siddharth Vadapalli
Quoted 2 lines · Geert Uytterhoeven

It does not make sense to have a comma after a sentinel, as any new elements must be added before the sentinel.

While I agree with it, this seems to require a 'cleanup-series' rather than an individual patch, given the following statistics:

As of [0], running
    git grep "sentinel.*}" drivers/net/ | wc -l
gives
    84
and looking for the ones that terminate in a comma by running
    git grep "sentinel.*}," drivers/net/ | wc -l
gives
    38

Quoted 2 lines

So there are '37' other instances (apart from davinci_mdio.c) in drivers/net alone that require a cleanup.

I have posted the following series to cleanup all networking drivers (excluding davinci_mdio.c since that is done by your patch) at:
https://lore.kernel.org/r/[email protected]/

Regards,
Siddharth.

Quoted 43 lines

Looking at Linux overall by running
    git grep "sentinel.*}," | wc -l
gives
    396

Since this isn't a functional change, I am not sure why a specific change is required in davinci_mdio.c, unless you plan to cleanup the remaining '395' occurrences in the remaining code as well. I am not against the patch, but the reason for picking just davinci_mdio.c for cleanup isn't clear to me based on the commit message.

[0]: commit 940de590b839 Merge tag 'hardening-v7.3-rc2' of git:// git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Quoted 28 lines

---
  drivers/net/ethernet/ti/davinci_mdio.c | 4 ++--

  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/ti/davinci_mdio.c +2 -2
index 48f85a3649b26548..5bec72f2f51dc548 100644
@@ -510,7 +510,7 @@ static const struct soc_device_attribute 
 k3_mdio_socinfo[] = {
       { .family = "J7200", .data = &am65_mdio_soc_data },
       { .family = "J721E", .data = &am65_mdio_soc_data },
       { .family = "J721S2", .data = &am65_mdio_soc_data },
-    { /* sentinel */ },
+    { /* sentinel */ }
   };
   #if IS_ENABLED(CONFIG_OF)
@@ -521,7 +521,7 @@ static const struct davinci_mdio_of_param 
 of_cpsw_mdio_data = {
   static const struct of_device_id davinci_mdio_of_mtable[] = {
       { .compatible = "ti,davinci_mdio", },
       { .compatible = "ti,cpsw-mdio", .data = &of_cpsw_mdio_data},
-    { /* sentinel */ },
+    { /* sentinel */ }
   };
   MODULE_DEVICE_TABLE(of, davinci_mdio_of_mtable);
Quoted 1 line

  #endif

Regards,
Siddharth.

#3 lore raw
Quoted 19 lines · Siddharth Vadapalli
Quoted 18 lines · Siddharth Vadapalli
Quoted 2 lines · Geert Uytterhoeven

It does not make sense to have a comma after a sentinel, as any new elements must be added before the sentinel.

While I agree with it, this seems to require a 'cleanup-series' rather than an individual patch, given the following statistics:

As of [0], running
git grep "sentinel.*}" drivers/net/ | wc -l
gives

     84
and looking for the ones that terminate in a comma by running
     git grep "sentinel.*}," drivers/net/ | wc -l
gives
     38

So there are '37' other instances (apart from davinci_mdio.c) in drivers/net alone that require a cleanup.

[...]

Quoted 5 lines
Quoted 5 lines

Since this isn't a functional change, I am not sure why a specific change is required in davinci_mdio.c, unless you plan to cleanup the remaining '395' occurrences in the remaining code as well. I am not against the patch, but the reason for picking just davinci_mdio.c for cleanup isn't clear to me based on the commit message.

I know. Over the past few years, I fixed several of them I encountered, but never got to fixing all of them. After rc1, I flushed a few patches that could be sent independently, so there it was!

Quoted 3 lines

I have posted the following series to cleanup all networking drivers (excluding davinci_mdio.c since that is done by your patch) at:
https://lore.kernel.org/r/[email protected]/

Happy to see my single patch triggered your great response! Thanks!

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
#4 lore raw
Quoted 29 lines · Geert Uytterhoeven
Quoted 19 lines · Siddharth Vadapalli
Quoted 18 lines · Siddharth Vadapalli
Quoted 2 lines · Geert Uytterhoeven

It does not make sense to have a comma after a sentinel, as any new elements must be added before the sentinel.

While I agree with it, this seems to require a 'cleanup-series' rather than an individual patch, given the following statistics:

As of [0], running
git grep "sentinel.*}" drivers/net/ | wc -l
gives

      84
and looking for the ones that terminate in a comma by running
      git grep "sentinel.*}," drivers/net/ | wc -l
gives
      38

So there are '37' other instances (apart from davinci_mdio.c) in drivers/net alone that require a cleanup.

[...]

Quoted 5 lines
Quoted 5 lines

Since this isn't a functional change, I am not sure why a specific change is required in davinci_mdio.c, unless you plan to cleanup the remaining '395' occurrences in the remaining code as well. I am not against the patch, but the reason for picking just davinci_mdio.c for cleanup isn't clear to me based on the commit message.

Quoted 3 lines

I know. Over the past few years, I fixed several of them I encountered, but never got to fixing all of them. After rc1, I flushed a few patches that could be sent independently, so there it was!

Thank you for providing the context for the current patch.

Quoted 7 lines
Quoted 4 lines

I have posted the following series to cleanup all networking drivers (excluding davinci_mdio.c since that is done by your patch) at:
https://lore.kernel.org/r/[email protected]/

Happy to see my single patch triggered your great response! Thanks!

:)

Regards,
Siddharth.

#6 lore raw

Hi Andrew,

Quoted 7 lines · Andrew Lunn
Quoted 4 lines · Geert Uytterhoeven

It does not make sense to have a comma after a sentinel, as any new elements must be added before the sentinel.

net-next.

Bummer. I have added a check to my checkpatch wrapper script, so hopefully this was the last time I made that mistake ;-)

Quoted 1 line

Thanks!

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
#7 lore raw
In reply to Geert Uytterhoeven
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 7 lines · On Thu, 3 Sep 2026 14:06:47 +0200 you wrote:

It does not make sense to have a comma after a sentinel, as any new elements must be added before the sentinel.

---
 drivers/net/ethernet/ti/davinci_mdio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Here is the summary with links:
- net: ethernet: ti: davinci_mdio: Drop commas after match table sentinels

    https://git.kernel.org/netdev/net-next/c/615bcbb822cb

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html