Re: [PATCH] net: ethernet: ti: davinci_mdio: Drop commas after match table sentinels

From: Siddharth Vadapalli

Date: Thu Sep 03 2026 - 08:35:53 EST


On 03/09/26 17:36, Geert Uytterhoeven wrote:
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


Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
---
drivers/net/ethernet/ti/davinci_mdio.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
index 48f85a3649b26548..5bec72f2f51dc548 100644
--- a/drivers/net/ethernet/ti/davinci_mdio.c
+++ b/drivers/net/ethernet/ti/davinci_mdio.c
@@ -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

Regards,
Siddharth.