Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752063AbaJJHy2 (ORCPT ); Fri, 10 Oct 2014 03:54:28 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:56551 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751446AbaJJHy0 (ORCPT ); Fri, 10 Oct 2014 03:54:26 -0400 X-IronPort-AV: E=Sophos;i="5.04,690,1406584800"; d="scan'208";a="100378549" Date: Fri, 10 Oct 2014 09:54:16 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Wolfram Sang cc: linux-kernel@vger.kernel.org, Greg KH , kernel-janitors@vger.kernel.org, cocci@systeme.lip6.fr, linux-arm-kernel@lists.infradead.org Subject: Re: [Cocci] [RFC] drop owner assignment from platform_drivers In-Reply-To: <20141010072439.GA1741@katana> Message-ID: References: <20141010072439.GA1741@katana> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > @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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/