Re: [PATCH] regulator: s2m,s5m: constify regulator_ops structures

2015-12-22 Thread Julia Lawall
On Wed, 23 Dec 2015, Mark Brown wrote: > On Sat, Dec 19, 2015 at 03:58:00PM +0100, Julia Lawall wrote: > > The regulator_ops structures are never modified, so declare them as const. > > > > Done with the help of Coccinelle. > > This doesn't apply against current co

[PATCH] regulator: s2m,s5m: constify regulator_ops structures

2015-12-19 Thread Julia Lawall
The regulator_ops structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/regulator/s2mpa01.c |4 ++-- drivers/regulator/s2mps11.c | 16 drivers/regulator/s5m8767.c

Re: [PATCH v2 11/25] coccinelle: nand: detect and correct drivers embedding an mtd_info object

2015-12-01 Thread Julia Lawall
On Tue, 1 Dec 2015, Boris Brezillon wrote: > Add nand-priv-no-mtd.cocci to detect and correct NAND controller drivers > directly embedding an mtd_info struct in their private struct. > > Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> > Cc: Julia Lawall

Re: [PATCH 14/27] mtd: nand: use the mtd instance embedded in struct nand_chip

2015-11-17 Thread Julia Lawall
On Tue, 17 Nov 2015, Boris Brezillon wrote: > Hi Julia, > > On Tue, 17 Nov 2015 10:05:03 +0100 (CET) > Julia Lawall <julia.law...@lip6.fr> wrote: > > > > > (This isn't the worst one, but it just happens to be one of the first.) > > > > There

Re: [PATCH 14/27] mtd: nand: use the mtd instance embedded in struct nand_chip

2015-11-17 Thread Julia Lawall
> > (This isn't the worst one, but it just happens to be one of the first.) > > There are many cases where the typical style would be to declare a new > > variable at the top of the function, where you perform the > > macro/function-call to convert from one abstraction to another. Like > > > >

[PATCH 3/3] ARM: EXYNOS: delete unneeded of_node_put

2015-10-12 Thread Julia Lawall
Device node iterators perform an of_node_put on each iteration, so putting an of_node_put before going around to the next iteration results in a double put. Problem found using Coccinelle. Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- arch/arm/mach-exynos/pm_domains.c

[PATCH 0/3] delete unneeded of_node_put

2015-10-12 Thread Julia Lawall
Device node iterators perform an of_node_put on each iteration, so putting an of_node_put before going around to the next iteration results in a double put. The complete semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // @r exists@ expression e1,e2; local

[PATCH] thermal: exynos: fix semicolon.cocci warnings

2015-10-01 Thread Julia Lawall
Remove unneeded semicolons. Generated by: scripts/coccinelle/misc/semicolon.cocci Signed-off-by: Julia Lawall <julia.law...@lip6.fr> Signed-off-by: Fengguang Wu <fengguang...@intel.com> --- exynos_tmu.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/the

[PATCH 00/11] fix error return code

2015-08-22 Thread Julia Lawall
The complate semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr/) // smpl @ok exists@ identifier f,ret,i; expression e; constant c; @@ // identify a function that returns a negative return value at least once. f(...) { ... when any ( return -c@i; | ret = -c@i; ...

[PATCH 08/11] drm/exynos: mic: fix error return code

2015-08-22 Thread Julia Lawall
*if(...) { ... when != ret = e2 when forall return ret; } // /smpl Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/gpu/drm/exynos/exynos_drm_mic.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos

[PATCH 1/20] mtd: s3c2410: fix misspelling of current function in string

2014-12-07 Thread Julia Lawall
Villemoes. Signed-off-by: Julia Lawall julia.law...@lip6.fr --- The semantic patch is difficult to summarize, but is available in the cover letter of this patch series. drivers/mtd/nand/s3c2410.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/s3c2410.c b/drivers

[PATCH 0/20] fix misspelling of current function in string

2014-12-07 Thread Julia Lawall
These patches replace what appears to be a reference to the name of the current function but is misspelled in some way by either the name of the function itself, or by %s and then __func__ in an argument list. // smpl // sudo apt-get install python-pip // sudo pip install python-Levenshtein //

Re: [PATCH 0/20] fix misspelling of current function in string

2014-12-07 Thread Julia Lawall
On Mon, 8 Dec 2014, Julian Calaby wrote: Hi Julia, On Mon, Dec 8, 2014 at 6:20 AM, Julia Lawall julia.law...@lip6.fr wrote: These patches replace what appears to be a reference to the name of the current function but is misspelled in some way by either the name of the function itself

Re: [PATCH 1/20] mtd: s3c2410: fix misspelling of current function in string

2014-12-07 Thread Julia Lawall
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c index 35aef5e..0a9c41f 100644 --- a/drivers/mtd/nand/s3c2410.c +++ b/drivers/mtd/nand/s3c2410.c @@ -948,7 +948,7 @@ static int s3c24xx_nand_probe(struct platform_device *pdev) cpu_type =

[PATCH 0/5] fix error return code

2014-11-23 Thread Julia Lawall
The complate semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr/) // smpl @ok exists@ identifier f,ret,i; expression e; constant c; @@ // identify a function that returns a negative return value at least once. f(...) { ... when any ( return -c@i; | ret = -c@i; ...

[PATCH 2/5] drm/exynos/ipp: fix error return code

2014-11-23 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Propagate the returned error code on failure. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // smpl @@ identifier ret; expression e1,e2; @@ ( if (\(ret 0\|ret != 0\)) { ... return ret

Re: [PATCH 1/1] thermal: Exynos: Deletion of unnecessary checks before two function calls

2014-11-21 Thread Julia Lawall
On Fri, 21 Nov 2014, SF Markus Elfring wrote: From: Markus Elfring elfr...@users.sourceforge.net Date: Fri, 21 Nov 2014 11:06:33 +0100 The functions cpufreq_cooling_unregister() and thermal_zone_device_unregister() test whether their argument is NULL and then return immediately. Thus the

[PATCH 23/25] thermal: exynos: fix error return code

2013-12-29 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Set the return variable to an error code as done elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // smpl ( if@p1 (\(ret 0\|ret != 0\)) { ... return ret; } | ret@p1

[PATCH 0/25] fix error return code

2013-12-29 Thread Julia Lawall
These patches fix cases where the return variable is not set to an error code in an error case. -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 20/29] watchdog: s3c2410_wdt: simplify use of devm_ioremap_resource

2013-08-14 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Remove unneeded error handling on the result of a call to platform_get_resource when the value is passed to devm_ioremap_resource. Move the call to platform_get_resource adjacent to the call to devm_ioremap_resource to make the connection between them more

[PATCH 0/29] simplify use of devm_ioremap_resource

2013-08-14 Thread Julia Lawall
devm_ioremap_resource often uses the result of a call to platform_get_resource as its last argument. devm_ioremap_resource does appropriate error handling on this argument, so error handling can be removed from the call site. To make the connection between the call to platform_get_resource and

[PATCH 12/29] sound/soc/samsung/ac97.c: simplify use of devm_ioremap_resource

2013-08-14 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Remove unneeded error handling on the result of a call to platform_get_resource when the value is passed to devm_ioremap_resource. Move the call to platform_get_resource adjacent to the call to devm_ioremap_resource to make the connection between them more

Re: question about arch/arm/mach-s3c24xx/irq.c

2013-02-24 Thread Julia Lawall
[Adding the person who introduced the code] On Sun, 24 Feb 2013, Russell King - ARM Linux wrote: On Sun, Feb 24, 2013 at 12:45:11PM +0100, Julia Lawall wrote: The function s3c24xx_irq_map in arch/arm/mach-s3c24xx/irq.c contains the code: parent_irq_data = parent_intc

Re: question about arch/arm/mach-s3c24xx/irq.c

2013-02-24 Thread Julia Lawall
On Sun, 24 Feb 2013, Heiko Stübner wrote: Am Sonntag, 24. Februar 2013, 14:39:45 schrieb Julia Lawall: [Adding the person who introduced the code] On Sun, 24 Feb 2013, Russell King - ARM Linux wrote: On Sun, Feb 24, 2013 at 12:45:11PM +0100, Julia Lawall wrote: The function

[PATCH] arch/arm/mach-s3c24xx/mach-h1940.c: delete double assignment

2012-09-12 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Delete successive assignments to the same location. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // smpl @@ expression i; @@ *i = ...; i = ...; // /smpl Signed-off-by: Julia Lawall

Re: [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code

2012-08-22 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Initialize return variable before exiting on an error path. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // smpl ( if@p1 (\(ret 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when

[PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code

2012-08-19 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Initialize return variable before exiting on an error path. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // smpl ( if@p1 (\(ret 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when

[PATCH 5/10] arch/arm/mach-s5pv210/cpufreq.c: add missing clk_put

2011-06-01 Thread Julia Lawall
From: Julia Lawall ju...@diku.dk The successive calls to clk_get each call clk_put in the case of failure, but this is not done for subsequent error handling code. The calls to clk_get are moved to the end of the function, and appropriate gotos are added. A simplified version of the semantic