Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1274455 > unrolled thread

[PATCH 1/1] Add SPI to platform_no_drv_owner.cocci warnings

Started by"Andrew F. Davis" <afd@ti.com>
First post2015-11-20 23:10 +0100
Last post2015-11-21 07:50 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/1] Add SPI to platform_no_drv_owner.cocci warnings "Andrew F. Davis" <afd@ti.com> - 2015-11-20 23:10 +0100
    Re: [PATCH 1/1] Add SPI to platform_no_drv_owner.cocci warnings Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-11-21 05:40 +0100
    Re: [PATCH 1/1] Add SPI to platform_no_drv_owner.cocci warnings Julia Lawall <julia.lawall@lip6.fr> - 2015-11-21 07:50 +0100

#1274455 — [PATCH 1/1] Add SPI to platform_no_drv_owner.cocci warnings

From"Andrew F. Davis" <afd@ti.com>
Date2015-11-20 23:10 +0100
Subject[PATCH 1/1] Add SPI to platform_no_drv_owner.cocci warnings
Message-ID<qx22t-4OV-1@gated-at.bofh.it>
Remove .owner field if calls are used which set it automatically.

Signed-off-by: Andrew F. Davis <afd@ti.com>
---
 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)
+
-- 
1.9.1

--
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/

[toc] | [next] | [standalone]


#1274604

FromKrzysztof Kozlowski <k.kozlowski@samsung.com>
Date2015-11-21 05:40 +0100
Message-ID<qx87U-iO-5@gated-at.bofh.it>
In reply to#1274455
W dniu 21.11.2015 o 07:02, Andrew F. Davis pisze:
> Remove .owner field if calls are used which set it automatically.
> 
> Signed-off-by: Andrew F. Davis <afd@ti.com>
> ---
>  scripts/coccinelle/api/platform_no_drv_owner.cocci | 73 ++++++++++++++++++++++
>  1 file changed, 73 insertions(+)
> 

Symmetric to i2c driver, looks good:

Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Best regards,
Krzysztof


--
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/

[toc] | [prev] | [next] | [standalone]


#1274608

FromJulia Lawall <julia.lawall@lip6.fr>
Date2015-11-21 07:50 +0100
Message-ID<qxa9H-1BH-3@gated-at.bofh.it>
In reply to#1274455

On Fri, 20 Nov 2015, Andrew F. Davis wrote:

> Remove .owner field if calls are used which set it automatically.
> 
> Signed-off-by: Andrew F. Davis <afd@ti.com>

Acked-by: Julia Lawall <julia.lawall@lip6.fr>

> ---
>  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)
> +
> -- 
> 1.9.1
> 
> 
--
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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web