public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: julia.lawall@lip6.fr (Julia Lawall)
To: linux-arm-kernel@lists.infradead.org
Subject: [Cocci] [RFC] drop owner assignment from platform_drivers
Date: Fri, 10 Oct 2014 09:54:16 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1410100951250.2402@hadrien> (raw)
In-Reply-To: <20141010072439.GA1741@katana>

> @match1@
> declarer name module_platform_driver;
> declarer name module_platform_driver_probe;
> identifier __driver;
> @@
> (
> 	module_platform_driver(__driver);
> |
> 	module_platform_driver_probe(__driver, ...);
> )
>
> @fix1 depends on match1@
> identifier match1.__driver;
> @@
> 	static struct platform_driver __driver = {
> 		.driver = {
> -			.owner = THIS_MODULE,
> 		}
> 	};
>
> @match2@
> identifier __driver;
> @@
> (
> 	platform_driver_register(&__driver)
> |
> 	platform_driver_probe(&__driver, ...)
> |
> 	platform_create_bundle(&__driver, ...)
> )
>
> @fix2 depends on match2@
> identifier match2.__driver;
> @@
> 	static struct platform_driver __driver = {
> 		.driver = {
> -			.owner = THIS_MODULE,
> 		}
> 	};

The semantic patch looks fine.  I'm a little surprised that it doesn't
complain about the lack of a comma after

.driver = { .owner = THIS_MODULE, }

but it seems that it does not.

If you think that it would be useful to have this in the Linux kernel, so
people don't add the owner initializer back in the future, you can try

coccinelle/tools/sgen/sgen

(run make in the coccinelle/tools/sgen directory).  That will guide you
through the process of making a Linux-ready semantic patch.  Feedback
would be appreciated.

julia

  reply	other threads:[~2014-10-10  7:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-10  7:24 [RFC] drop owner assignment from platform_drivers Wolfram Sang
2014-10-10  7:54 ` Julia Lawall [this message]
2014-10-10 18:04   ` [Cocci] " Wolfram Sang
2014-10-10  8:30 ` Arnd Bergmann
2014-10-10 18:12   ` Wolfram Sang
2014-10-10 19:39     ` Arnd Bergmann
2014-10-10  8:36 ` Russell King - ARM Linux
2014-10-10 18:26   ` Wolfram Sang
2014-10-10 19:42     ` Arnd Bergmann
2014-10-11 16:56       ` Wolfram Sang
2014-10-11 17:15         ` Russell King - ARM Linux
2014-10-11 20:55         ` Greg KH
2014-10-12  5:51           ` Wolfram Sang
2014-10-12 14:24             ` Greg KH
2014-10-12 17:01               ` Wolfram Sang
2014-10-10 21:34     ` Russell King - ARM Linux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.10.1410100951250.2402@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox