Skip to contentSkip to conversation

staging: etnaviv: fix platform_no_drv_owner.cocci warnings

PATCH New Julia Lawall 2 participants 2 messages Nov 6, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: etnaviv: fix platform_no_drv_owner.cocci warnings

No need to set .owner here. The core will do it.

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

---

 etnaviv_drv.c |    1 -
 1 file changed, 1 deletion(-)
drivers/staging/etnaviv/etnaviv_drv.c +0 -1
@@ -587,7 +587,6 @@ static struct platform_driver etnaviv_pl
 	.probe      = etnaviv_pdev_probe,
 	.remove     = etnaviv_pdev_remove,
 	.driver     = {
-		.owner  = THIS_MODULE,
 		.name   = "vivante",
 		.of_match_table = dt_match,
 	},
#1 lore raw

PATCH 1/1 staging: etnaviv: fix platform_no_drv_owner.cocci warnings

Quoted 7 lines · On Friday 06 November 2015 07:47:58 Julia Lawall wrote:

No need to set .owner here. The core will do it.

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Patch looks good of course.

It looks like the conversion is stagnating, probably as we seem to have some unmaintained drivers, slow maintainers, or cases that platform_no_drv_owner.cocci doesn't catch:

for i in v3.18 v3.19 v4.0 v4.1 v4.2 v4.3 next/master ; do
echo $i git grep -A15 -w platform_driver $i | grep owner.*THIS_MODULE | wc -l
done

v3.18 1798
v3.19 112
v4.0 98
v4.1 94
v4.2 98
v4.3 80
next/master 85

(this includes some false positives)

Is there any way we can prevent new ones from creeping in after we remove the remaining ones? A compile-time check would be best, but I can't think of one as there are other subsystems that still set .owner. Maybe add a WARN_ON to platform_driver_register() and add that to linux-next on top of a patch (or series of patches) that removes the remaining ones?

Arnd