From patchwork Wed Oct 28 17:49:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 7513521 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5D3299F37F for ; Wed, 28 Oct 2015 17:49:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5833E20863 for ; Wed, 28 Oct 2015 17:49:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5E797208B1 for ; Wed, 28 Oct 2015 17:49:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753887AbbJ1RtX (ORCPT ); Wed, 28 Oct 2015 13:49:23 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:40247 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751874AbbJ1RtX (ORCPT ); Wed, 28 Oct 2015 13:49:23 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id t9SHnGCk014564; Wed, 28 Oct 2015 12:49:17 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t9SHnGl2007788; Wed, 28 Oct 2015 12:49:16 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.224.2; Wed, 28 Oct 2015 12:49:17 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t9SHnGJa026357; Wed, 28 Oct 2015 12:49:16 -0500 Received: from localhost (uda0226330.am.dhcp.ti.com [128.247.8.252]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id t9SHnG919277; Wed, 28 Oct 2015 12:49:16 -0500 (CDT) From: "Andrew F. Davis" To: Mark Brown , Sebastian Reichel CC: , , "Andrew F. Davis" Subject: [PATCH] Add SPI to platform_no_drv_owner.cocci warnings Date: Wed, 28 Oct 2015 12:49:07 -0500 Message-ID: <1446054547-23859-1-git-send-email-afd@ti.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove .owner field if calls are used which set it automatically Signed-off-by: Andrew F. Davis --- scripts/coccinelle/api/platform_no_drv_owner.cocci | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/scripts/coccinelle/api/platform_no_drv_owner.cocci b/scripts/coccinelle/api/platform_no_drv_owner.cocci index c5e3f73f..52d5f53 100644 --- a/scripts/coccinelle/api/platform_no_drv_owner.cocci +++ b/scripts/coccinelle/api/platform_no_drv_owner.cocci @@ -12,6 +12,7 @@ virtual report declarer name module_i2c_driver; declarer name module_platform_driver; declarer name module_platform_driver_probe; +declarer name module_spi_driver; identifier __driver; @@ ( @@ -20,6 +21,8 @@ identifier __driver; module_platform_driver(__driver); | module_platform_driver_probe(__driver, ...); +| + module_spi_driver(__driver); ) @fix1 depends on match1 && patch && !context && !org && !report@ @@ -40,6 +43,15 @@ identifier match1.__driver; } }; +@fix1_spi depends on match1 && patch && !context && !org && !report@ +identifier match1.__driver; +@@ + static struct spi_driver __driver = { + .driver = { +- .owner = THIS_MODULE, + } + }; + @match2@ identifier __driver; @@ @@ -51,6 +63,8 @@ identifier __driver; platform_create_bundle(&__driver, ...) | i2c_add_driver(&__driver) +| + spi_register_driver(&__driver) ) @fix2 depends on match2 && patch && !context && !org && !report@ @@ -71,6 +85,15 @@ identifier match2.__driver; } }; +@fix2_spi depends on match2 && patch && !context && !org && !report@ +identifier match2.__driver; +@@ + static struct spi_driver __driver = { + .driver = { +- .owner = THIS_MODULE, + } + }; + // ---------------------------------------------------------------------------- @fix1_context depends on match1 && !patch && (context || org || report)@ @@ -95,6 +118,17 @@ position j0; } }; +@fix1_spi_context depends on match1 && !patch && (context || org || report)@ +identifier match1.__driver; +position j0; +@@ + + static struct spi_driver __driver = { + .driver = { +* .owner@j0 = THIS_MODULE, + } + }; + @fix2_context depends on match2 && !patch && (context || org || report)@ identifier match2.__driver; position j0; @@ -117,6 +151,17 @@ position j0; } }; +@fix2_spi_context depends on match2 && !patch && (context || org || report)@ +identifier match2.__driver; +position j0; +@@ + + static struct spi_driver __driver = { + .driver = { +* .owner@j0 = THIS_MODULE, + } + }; + // ---------------------------------------------------------------------------- @script:python fix1_org depends on org@ @@ -133,6 +178,13 @@ j0 << fix1_i2c_context.j0; msg = "No need to set .owner here. The core will do it." coccilib.org.print_todo(j0[0], msg) +@script:python fix1_spi_org depends on org@ +j0 << fix1_spi_context.j0; +@@ + +msg = "No need to set .owner here. The core will do it." +coccilib.org.print_todo(j0[0], msg) + @script:python fix2_org depends on org@ j0 << fix2_context.j0; @@ @@ -147,6 +199,13 @@ j0 << fix2_i2c_context.j0; msg = "No need to set .owner here. The core will do it." coccilib.org.print_todo(j0[0], msg) +@script:python fix2_spi_org depends on org@ +j0 << fix2_spi_context.j0; +@@ + +msg = "No need to set .owner here. The core will do it." +coccilib.org.print_todo(j0[0], msg) + // ---------------------------------------------------------------------------- @script:python fix1_report depends on report@ @@ -163,6 +222,13 @@ j0 << fix1_i2c_context.j0; msg = "No need to set .owner here. The core will do it." coccilib.report.print_report(j0[0], msg) +@script:python fix1_spi_report depends on report@ +j0 << fix1_spi_context.j0; +@@ + +msg = "No need to set .owner here. The core will do it." +coccilib.report.print_report(j0[0], msg) + @script:python fix2_report depends on report@ j0 << fix2_context.j0; @@ @@ -177,3 +243,10 @@ j0 << fix2_i2c_context.j0; msg = "No need to set .owner here. The core will do it." coccilib.report.print_report(j0[0], msg) +@script:python fix2_spi_report depends on report@ +j0 << fix2_spi_context.j0; +@@ + +msg = "No need to set .owner here. The core will do it." +coccilib.report.print_report(j0[0], msg) +