Re: coccinelle and bitmask arithmetic (was: Re: [patch] TTY: synclink, small cleanup in dtr_rts())

2013-01-29 Thread Julia Lawall
On Tue, 29 Jan 2013, Joe Perches wrote: > On Tue, 2013-01-29 at 10:55 -0500, valdis.kletni...@vt.edu wrote: > > On Sun, 27 Jan 2013 23:19:47 +0300, Dan Carpenter said: > > > > > Yeah. I think it would be, but adding bitflags together instead of > > > doing bitwise ORs is very common as well. >

Re: coccinelle and bitmask arithmetic (was: Re: [patch] TTY: synclink, small cleanup in dtr_rts())

2013-01-29 Thread Julia Lawall
How about the following (from today's linux-next). They appear to be trying to do the same calculation, once with + and once with |. arch/arm/common/it8152.c int dma_set_coherent_mask(struct device *dev, u64 mask) { if (mask >= PHYS_OFFSET + SZ_64M - 1) return 0;

Re: coccinelle and bitmask arithmetic (was: Re: [patch] TTY: synclink, small cleanup in dtr_rts())

2013-01-29 Thread Julia Lawall
The following rule looks promising: @r@ constant c; identifier i; expression e; @@ ( e | c@i | e & c@i | e |= c@i | e &= c@i ) @@ constant r.c,c1; identifier i1; expression e; @@ *c1@i1 + c That is, the sum of two constants where at least one of them has been used with & or |. julia -- To uns

Re: coccinelle and bitmask arithmetic

2013-01-30 Thread Julia Lawall
On Wed, 30 Jan 2013, Russell King - ARM Linux wrote: > On Wed, Jan 30, 2013 at 09:21:28AM +0100, walter harms wrote: > > Great hit Joe :) > > > > Sometimes i am really surprised what code can be found > > in the kernal and it is still working. > > Having no clue of the code i suspect somebody tr

[PATCH] scripts/coccinelle: find constant additions that could be bit ors

2013-02-02 Thread Julia Lawall
From: Julia Lawall Semantic patch (http://coccinelle.lip6.fr/) to check for constants that are added but are used elsewhere as bitmasks. Signed-off-by: Julia Lawall --- scripts/coccinelle/misc/orplus.cocci | 55 +++ 1 file changed, 55 insertions(+) diff

Re: [PATCH] scripts/coccinelle: find constant additions that could be bit ors

2013-02-23 Thread Julia Lawall
On Sat, 23 Feb 2013, Dan Carpenter wrote: > On Fri, Feb 22, 2013 at 11:44:31AM +0100, Michal Marek wrote: > > On Sat, Feb 02, 2013 at 05:19:55PM +0100, Julia Lawall wrote: > > > From: Julia Lawall > > > > > > Semantic patch (http://coccinelle.lip6.fr/) to

[PATCH 1/2] drivers/gpu/drm/tilcdc/tilcdc_drv.c: adjust duplicate test

2013-02-24 Thread Julia Lawall
From: Julia Lawall Delete successive tests to the same location. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @s exists@ local idexpression y; expression x,e; @@ *if ( \(x == NULL\|IS_ERR(x)\|y != 0\) ) { ... when forall

[PATCH 2/2] drivers/regulator/s5m8767.c: adjust duplicate test

2013-02-24 Thread Julia Lawall
From: Julia Lawall Delete successive tests to the same location. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @s exists@ local idexpression y; expression x,e; @@ *if ( \(x == NULL\|IS_ERR(x)\|y != 0\) ) { ... when forall

[PATCH 0/2] adjust duplicate test

2013-02-24 Thread Julia Lawall
These patches fix cases where a value is tested that was previously tested. Often the problem is that the tested value has not been updated properly. Sometimes the test is simply duplicated. These problems were found using the following semantic match (http://coccinelle.lip6.fr/): // @r exists

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

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, J

[PATCH 0/7] fix error return code

2012-08-29 Thread Julia Lawall
These patches fix cases where the return code appears to be unintentially nonnegative. The complete semantic match that finds the problem is as follows: (http://coccinelle.lip6.fr/) // @ok exists@ identifier f,ret,i; expression e; constant c; @@ f(...) { <+... ( return -c@i; | ret = -c@i; ... w

[PATCH 2/7] net: ipv6: fix error return code

2012-08-29 Thread Julia Lawall
From: Julia Lawall Initialize return variable before exiting on an error path. The initial initialization of the return variable is also dropped, because that value is never used. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr

[PATCH 7/7] net/netfilter/nf_conntrack_netlink.c: fix error return code

2012-08-29 Thread Julia Lawall
From: Julia Lawall 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/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 w

[PATCH 1/7] ipvs: fix error return code

2012-08-29 Thread Julia Lawall
From: Julia Lawall 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/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 w

[PATCH 3/7] logfs: fix error return code

2012-08-29 Thread Julia Lawall
From: Julia Lawall 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/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 w

[PATCH 6/7] net/netfilter/nfnetlink_log.c: fix error return code

2012-08-29 Thread Julia Lawall
From: Julia Lawall 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/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 w

[PATCH 5/7] net/xfrm/xfrm_state.c: fix error return code

2012-08-29 Thread Julia Lawall
From: Julia Lawall 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/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 w

[PATCH 4/7] net/bluetooth/rfcomm/core.c: fix error return code

2012-08-29 Thread Julia Lawall
From: Julia Lawall 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/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 w

[PATCH 0/4] drop frees of devm_ alloc'd data

2012-09-01 Thread Julia Lawall
Drop frees of devm_ alloc'd data. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

[PATCH 1/4] drivers/spi/spi-sh-hspi.c: drop frees of devm_ alloc'd data

2012-09-01 Thread Julia Lawall
From: Julia Lawall devm free functions should not have to be explicitly used. A semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ @@ ( * devm_kfree(...); | * devm_free_irq(...); | * devm_iounmap(...); | * devm_release_region

[PATCH 4/4] drivers/mtd/nand/mpc5121_nfc.c: some devm_ cleanups

2012-09-01 Thread Julia Lawall
From: Julia Lawall devm free functions should not have to be explicitly used. The only thing left that is useful in the function mpc5121_nfc_free is the call to clk_disable, which is moved to the call sites. This function also incorrectly called iounmap on devm_ioremap allocated data. Use

[PATCH 3/4] drivers/mtd/maps/autcpu12-nvram.c: drop frees of devm_ alloc'd data

2012-09-01 Thread Julia Lawall
From: Julia Lawall devm free functions should not have to be explicitly used. A semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ @@ ( * devm_kfree(...); | * devm_free_irq(...); | * devm_iounmap(...); | * devm_release_region

[PATCH 2/4] drivers/tty/serial/sirfsoc_uart.c: drop frees of devm_ alloc'd data

2012-09-01 Thread Julia Lawall
From: Julia Lawall devm free functions should not have to be explicitly used. A semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ @@ ( * devm_kfree(...); | * devm_free_irq(...); | * devm_iounmap(...); | * devm_release_region

Re: [PATCH 4/4] drivers/mtd/nand/mpc5121_nfc.c: some devm_ cleanups

2012-09-04 Thread Julia Lawall
On Tue, 4 Sep 2012, Lars-Peter Clausen wrote: > On 09/04/2012 10:42 AM, Artem Bityutskiy wrote: > > Aiaiai! :-) [1] [2] > > > > I've build-tested this using aiaiai and it reports that this change breaks > > the build: > > > > dedekind@blue:~/git/maintaining$ ./verify ../l2-mtd/ mpc5121_nfc < > >

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

2012-09-12 Thread Julia Lawall
From: Julia Lawall 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/) // @@ expression i; @@ *i = ...; i = ...; // Signed-off-by: Julia Lawall --- Not compiled, and this may

Re: [PATCH 19/20] drivers/net/ethernet/marvell/skge.c: fix error return code

2012-10-04 Thread Julia Lawall
On Thu, 4 Oct 2012, Joe Perches wrote: On Thu, 2012-10-04 at 14:54 -0400, David Miller wrote: From: Peter Senna Tschudin On Thu, Oct 4, 2012 at 8:23 PM, David Miller wrote: We want to know the implications of the bug being fixed. Does it potentially cause an OOPS? Bad reference counting an

Re: [PATCH 19/20] drivers/net/ethernet/marvell/skge.c: fix error return code

2012-10-05 Thread Julia Lawall
On Fri, 5 Oct 2012, Joe Perches wrote: On Fri, 2012-10-05 at 07:22 +0200, Julia Lawall wrote: A tool was used to find a potential problem, and then Peter studied the code to see what fix was appropriate. Hi Julia. Was it true that a static analysis tool found the original potential issue

[PATCH 1/6] arch/x86/xen: Use DIV_ROUND_UP

2008-02-14 Thread Julia Lawall
From: Julia Lawall <[EMAIL PROTECTED]> The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / (d)) but is perhaps more readable. An extract of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @haskernel@ @@ #i

[PATCH 2/6] fs/direct-io.c: Use DIV_ROUND_UP

2008-02-14 Thread Julia Lawall
From: Julia Lawall <[EMAIL PROTECTED]> The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / (d)) but is perhaps more readable. An extract of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @haskernel@ @@ #i

[PATCH 3/6] fs/ocfs2: Use DIV_ROUND_UP

2008-02-14 Thread Julia Lawall
From: Julia Lawall <[EMAIL PROTECTED]> The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / (d)) but is perhaps more readable. An extract of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @haskernel@ @@ #i

[PATCH 4/6] fs/udf: Use DIV_ROUND_UP

2008-02-14 Thread Julia Lawall
From: Julia Lawall <[EMAIL PROTECTED]> The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / (d)) but is perhaps more readable. An extract of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @haskernel@ @@ #i

[PATCH 5/6] drivers/atm: Use DIV_ROUND_UP

2008-02-14 Thread Julia Lawall
that "case round_down" is implemented by DIV_ROUND_UP, twice. The round_down and default (ie round_up) cases seem to be inversed. --- From: Julia Lawall <[EMAIL PROTECTED]> The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / (d)) but is perhaps more reada

[PATCH 6/6] drivers/hid: Use DIV_ROUND_UP

2008-02-14 Thread Julia Lawall
From: Julia Lawall <[EMAIL PROTECTED]> The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / (d)) but is perhaps more readable. An extract of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @haskernel@ @@ #i

Re: [PATCH 2/6] fs/direct-io.c: Use DIV_ROUND_UP

2008-02-14 Thread Julia Lawall
On Thu, 14 Feb 2008, Pekka Enberg wrote: > Hi Nishanth, > > On Thu, Feb 14, 2008 at 7:38 PM, Nishanth Aravamudan <[EMAIL PROTECTED]> > wrote: > > Is it just me, or does > > > > ((user_addr + iov[seg].iov_len + PAGE_SIZE - 1)/PAGE_SIZE - > > user_addr/PAGE_SIZE) > > > > not simplify to

[PATCH 1/4] : More use DIV_ROUND_UP

2008-02-16 Thread Julia Lawall
From: Julia Lawall <[EMAIL PROTECTED]> The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / (d)) but is perhaps more readable. An extract of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @haskernel@ @@ #i

[PATCH 2/4] : More use DIV_ROUND_UP or roundup

2008-02-16 Thread Julia Lawall
From: Julia Lawall <[EMAIL PROTECTED]> The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / (d)) but is perhaps more readable. An extract of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @haskernel@ @@ #i

[PATCH 3/4] : More use DIV_ROUND_UP

2008-02-16 Thread Julia Lawall
From: Julia Lawall <[EMAIL PROTECTED]> The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / (d)) but is perhaps more readable. An extract of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @haskernel@ @@ #i

[PATCH 4/4] : More use DIV_ROUND_UP

2008-02-16 Thread Julia Lawall
From: Julia Lawall <[EMAIL PROTECTED]> The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / (d)) but is perhaps more readable. An extract of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @haskernel@ @@ #i

Re: Expressing linux-next collateral evolutions in formal grammar

2012-11-02 Thread Julia Lawall
The way I would envision this to be easier to manage is to break them down by subsystem and the reviewer can then go and read the grammar for their own subsystem of preference. The long term benefit of this is that even if folks don't use SmPL for collateral evolutions we have a possibility here o

[PATCH 0/16] use WARN

2012-11-03 Thread Julia Lawall
These patches use WARN, which combines printk and WARN_ON(1), or WARN_ONCE, which combines printk and WARN_ON_ONCE(1). This does not appear to affect the behavior, but makes the code a little more concise. The semantic patch that makes this transformation is as follows (http://coccinelle.lip6.fr/

[PATCH 3/16] drivers/md/raid5.c: use WARN

2012-11-03 Thread Julia Lawall
From: Julia Lawall Use WARN rather than printk followed by WARN_ON(1), for conciseness. A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON(1); // Signed-off-by

[PATCH 5/16] drivers/scsi: use WARN

2012-11-03 Thread Julia Lawall
From: Julia Lawall Use WARN rather than printk followed by WARN_ON(1), for conciseness. A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON(1); // Signed-off-by

[PATCH 10/16] drivers/net/ethernet/ibm/emac/mal.c: use WARN

2012-11-03 Thread Julia Lawall
From: Julia Lawall Use WARN rather than printk followed by WARN_ON(1), for conciseness. A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON(1); // Signed-off-by

[PATCH 11/16] drivers/misc/kgdbts.c: use WARN

2012-11-03 Thread Julia Lawall
From: Julia Lawall Use WARN rather than printk followed by WARN_ON(1), for conciseness. A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON(1); // Signed-off-by

[PATCH 12/16] fs/logfs/gc.c: use WARN

2012-11-03 Thread Julia Lawall
From: Julia Lawall Use WARN rather than printk followed by WARN_ON(1), for conciseness. A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON(1); // Signed-off-by

[PATCH 16/16] drivers/infiniband/hw/nes: use WARN

2012-11-03 Thread Julia Lawall
From: Julia Lawall Use WARN rather than printk followed by WARN_ON(1), for conciseness. A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON(1); // Signed-off-by

[PATCH 15/16] drivers/parisc/pdc_stable.c: use WARN

2012-11-03 Thread Julia Lawall
From: Julia Lawall Use WARN rather than printk followed by WARN_ON(1), for conciseness. A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON(1); // Signed-off-by

[PATCH 4/16] drivers/usb/wusbcore: use WARN

2012-11-03 Thread Julia Lawall
From: Julia Lawall Use WARN rather than printk followed by WARN_ON(1), for conciseness. A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON(1); // Signed-off-by

[PATCH 14/16] drivers/ssb/main.c: use WARN

2012-11-03 Thread Julia Lawall
From: Julia Lawall Use WARN rather than printk followed by WARN_ON(1), for conciseness. A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON(1); // Signed-off-by

[PATCH 13/16] fs/btrfs: use WARN

2012-11-03 Thread Julia Lawall
From: Julia Lawall Use WARN rather than printk followed by WARN_ON(1), for conciseness. A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON(1); // Signed-off-by

[PATCH 9/16] fs/ext4/indirect.c: use WARN

2012-11-03 Thread Julia Lawall
From: Julia Lawall Use WARN rather than printk followed by WARN_ON(1), for conciseness. A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON(1); // Signed-off-by

[PATCH 8/16] drivers/infiniband/hw/cxgb3/iwch_cm.c: use WARN

2012-11-03 Thread Julia Lawall
From: Julia Lawall Use WARN rather than printk followed by WARN_ON(1), for conciseness. A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON(1); // Signed-off-by

[PATCH 7/16] drivers/scsi/gdth.c: use WARN

2012-11-03 Thread Julia Lawall
From: Julia Lawall Use WARN rather than printk followed by WARN_ON(1), for conciseness. If (count) is also merged into WARN, for further conciseness. A simplified version of the semantic patch that makes part of this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression

[PATCH 6/16] drivers/infiniband/hw/cxgb4/cm.c: use WARN

2012-11-03 Thread Julia Lawall
From: Julia Lawall Use WARN rather than printk followed by WARN_ON(1), for conciseness. A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON(1); // Signed-off-by

[PATCH 2/16] fs/hfsplus/bnode.c: use WARN

2012-11-03 Thread Julia Lawall
From: Julia Lawall Use WARN rather than printk followed by WARN_ON(1), for conciseness. A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON(1); // Signed-off-by

[PATCH 1/16] drivers/gpu/drm/drm_cache.c: use WARN_ONCE

2012-11-03 Thread Julia Lawall
From: Julia Lawall Use WARN_ONCE rather than printk followed by WARN_ON_ONCE(1), for conciseness. A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression list es; @@ -printk( +WARN_ONCE(1, es); -WARN_ON_ONCE(1

Re: [PATCH 10/16] drivers/net/ethernet/ibm/emac/mal.c: use WARN

2012-11-03 Thread Julia Lawall
On Sat, 3 Nov 2012, walter harms wrote: Am 03.11.2012 11:58, schrieb Julia Lawall: From: Julia Lawall Use WARN rather than printk followed by WARN_ON(1), for conciseness. A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr

[PATCH] drivers/misc/kgdbts.c: remove eprintk

2012-11-03 Thread Julia Lawall
From: Julia Lawall eprintk is really just WARN(1, KERN_ERR ...). Use WARN to be more consistent with the rest of the code. Signed-off-by: Julia Lawall --- drivers/misc/kgdbts.c | 38 +- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a

Re: [PATCH 10/16] drivers/net/ethernet/ibm/emac/mal.c: use WARN

2012-11-03 Thread Julia Lawall
While looking i have noticed that a lot of drivers define there private "assert" macro. It is very similar to warn. (e.g.) #define RTL819x_DEBUG #ifdef RTL819x_DEBUG #define assert(expr) \ if (!(expr)) { \ printk( "Assertion failed! %s,%s,%

[PATCH] scripts/coccinelle/misc/warn.cocci: use WARN

2012-11-03 Thread Julia Lawall
From: Julia Lawall Use WARN(1,...) rather than printk followed by WARN(1). Signed-off-by: Julia Lawall --- scripts/coccinelle/misc/warn.cocci | 109 + 1 file changed, 109 insertions(+) diff --git a/scripts/coccinelle/misc/warn.cocci b/scripts/coccinelle

[PATCH 0/8] drop if around WARN_ON

2012-11-03 Thread Julia Lawall
These patches convert a conditional with a simple test expression and a then branch that only calls WARN_ON(1) to just a call to WARN_ON, which will test the condition. // @@ expression e; @@ ( if(<+...e(...)...+>) WARN_ON(1); | - if (e) WARN_ON(1); + WARN_ON(e); )// -- To unsubscribe from thi

[PATCH 3/8] arch/x86/kernel/cpu/mtrr/cleanup.c: drop if around WARN_ON

2012-11-03 Thread Julia Lawall
From: Julia Lawall Just use WARN_ON rather than an if containing only WARN_ON(1). A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression e; @@ - if (e) WARN_ON(1); + WARN_ON(e); // Signed-off-by: Julia Lawall

[PATCH 1/8] fs/btrfs: drop if around WARN_ON

2012-11-03 Thread Julia Lawall
From: Julia Lawall Just use WARN_ON rather than an if containing only WARN_ON(1). A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression e; @@ - if (e) WARN_ON(1); + WARN_ON(e); // Signed-off-by: Julia Lawall

[PATCH 5/8] drivers/scsi/qla2xxx/qla_nx.c: drop if around WARN_ON

2012-11-03 Thread Julia Lawall
From: Julia Lawall Just use WARN_ON rather than an if containing only WARN_ON(1). A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression e; @@ - if (e) WARN_ON(1); + WARN_ON(e); // Signed-off-by: Julia Lawall

[PATCH 6/8] arch/arm/mach-omap2/dpll3xxx.c: drop if around WARN_ON

2012-11-03 Thread Julia Lawall
From: Julia Lawall Just use WARN_ON rather than an if containing only WARN_ON(1). A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression e; @@ - if (e) WARN_ON(1); + WARN_ON(e); // Signed-off-by: Julia Lawall

[PATCH 7/8] drivers/scsi/scsi_transport_fc.c: drop if around WARN_ON

2012-11-03 Thread Julia Lawall
From: Julia Lawall Just use WARN_ON rather than an if containing only WARN_ON(1). A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression e; @@ - if (e) WARN_ON(1); + WARN_ON(e); // Signed-off-by: Julia Lawall

[PATCH 8/8] drivers/net/wireless/ath/ath6kl/hif.c: drop if around WARN_ON

2012-11-03 Thread Julia Lawall
From: Julia Lawall Just use WARN_ON rather than an if containing only WARN_ON(1). A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression e; @@ - if (e) WARN_ON(1); + WARN_ON(e); // Signed-off-by: Julia Lawall

[PATCH 2/8] drivers/scsi/bfa/bfa_svc.c: drop if around WARN_ON

2012-11-03 Thread Julia Lawall
From: Julia Lawall Just use WARN_ON rather than an if containing only WARN_ON(1). A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression e; @@ - if (e) WARN_ON(1); + WARN_ON(e); // Signed-off-by: Julia Lawall

[PATCH 4/8] fs/ext3/inode.c: drop if around WARN_ON

2012-11-03 Thread Julia Lawall
From: Julia Lawall Just use WARN_ON rather than an if containing only WARN_ON(1). A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression e; @@ - if (e) WARN_ON(1); + WARN_ON(e); // Signed-off-by: Julia Lawall

Re: [PATCH 0/8] drop if around WARN_ON

2012-11-04 Thread Julia Lawall
On Sun, 4 Nov 2012, Sasha Levin wrote: Hi Julia, On Sat, Nov 3, 2012 at 4:30 PM, Julia Lawall wrote: These patches convert a conditional with a simple test expression and a then branch that only calls WARN_ON(1) to just a call to WARN_ON, which will test the condition. // @@ expression e

Re: [PATCH 0/8] drop if around WARN_ON

2012-11-04 Thread Julia Lawall
On Sun, 4 Nov 2012, Sasha Levin wrote: On Sun, Nov 4, 2012 at 10:57 AM, Julia Lawall wrote: On Sun, 4 Nov 2012, Sasha Levin wrote: Hi Julia, On Sat, Nov 3, 2012 at 4:30 PM, Julia Lawall wrote: These patches convert a conditional with a simple test expression and a then branch that only

Re: [PATCH] drivers/misc/kgdbts.c: remove eprintk

2012-11-04 Thread Julia Lawall
On Sun, 4 Nov 2012, Arnd Bergmann wrote: On Saturday 03 November 2012, Julia Lawall wrote: @@ -113,10 +113,6 @@ printk(KERN_INFO a); \ touch_nmi_watchdog(); \ } while (0) -#define eprintk(a...) do { \ - printk(KERN_ERR a

merging printk and WARN

2012-11-04 Thread Julia Lawall
It looks like these patches were not a good idea, because in each case the printk provides an error level, and WARN then provides another one. Sorry for the noise. julia -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.

Re: [PATCH] drivers/misc/kgdbts.c: remove eprintk

2012-11-04 Thread Julia Lawall
On Sun, 4 Nov 2012, Arnd Bergmann wrote: On Sunday 04 November 2012, Julia Lawall wrote: Hmm, I did not think that WARN() took a KERN_ERR argument, which should really be implied here. Looking at the code, it really seems to be required at the moment, but only 5 out of 117 callers use it this

Re: [PATCH] drivers/misc/kgdbts.c: remove eprintk

2012-11-05 Thread Julia Lawall
On Mon, 5 Nov 2012, Arnd Bergmann wrote: > On Sunday 04 November 2012, Julia Lawall wrote: > > > > > > I don't see yet where that KERN_WARNING gets added. Looking at > > > warn_slowpath_common, there are two or three lines that get printed at > > > KER

[PATCH 1/9] drivers/usb/host/ehci-atmel.c: use devm_ functions

2012-07-29 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH] use devm_ functions

2012-07-29 Thread Julia Lawall
The semantic patch (http://coccinelle.lip6.fr/) used in generating this patch is as follows. Some manual cleanup may be required. This improves on the previous version in that more devm functions are treated. virtual after_start virtual returned virtual returnedDup virtual arg virtual all_args v

[PATCH 4/9] drivers/usb/host/ehci-grlib.c: use devm_ functions

2012-07-29 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 5/9] drivers/usb/host/ehci-ixp4xx.c: use devm_ functions

2012-07-29 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 2/9] drivers/usb/host/ehci-au1xxx.c: use devm_ functions

2012-07-29 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 6/9] drivers/usb/host/ehci-ls1x.c: use devm_ functions

2012-07-29 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 7/9] drivers/usb/host/ehci-msm.c: use devm_ functions

2012-07-29 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. The original code was also missing a call to

[PATCH 8/9] drivers/usb/host/ehci-mv.c: use devm_ functions

2012-07-29 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. A new label name is created in one case to

[PATCH 9/9] drivers/usb/host/ehci-mxc.c: use devm_ functions

2012-07-29 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 3/9] drivers/usb/host/ehci-cns3xxx.c: use devm_ functions

2012-07-29 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 1/7] drivers/usb/host/ehci-ppc-of.c: use devm_ functions

2012-07-30 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 7/7] drivers/usb/host/ehci-xilinx-of.c: use devm_ functions

2012-07-30 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 5/7] drivers/usb/host/ehci-tegra.c: use devm_ functions

2012-07-30 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 2/7] drivers/usb/host/ehci-s5p.c: use devm_ functions

2012-07-30 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 3/7] drivers/usb/host/ehci-sead3.c: use devm_ functions

2012-07-30 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 4/7] drivers/usb/host/ehci-sh.c: use devm_ functions

2012-07-30 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 6/7] drivers/usb/host/ehci-vt8500.c: use devm_ functions

2012-07-30 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 1/3] drivers/media/radio/radio-timb.c: use devm_ functions

2012-07-31 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- drivers

[PATCH 3/3] drivers/media/radio/radio-wl1273.c: use devm_ functions

2012-07-31 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. In two cases, the original memory allocation

[PATCH 2/3] drivers/media/radio/radio-si4713.c: use devm_ functions

2012-07-31 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- drivers

[PATCH] drivers/iio/adc/at91_adc.c: use devm_ functions

2012-07-31 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. The call to platform_get_resource(pdev

Re: [PATCH] drivers/iio/adc/at91_adc.c: use devm_ functions

2012-07-31 Thread Julia Lawall
On Tue, 31 Jul 2012, Lars-Peter Clausen wrote: > Hi, > > On 07/31/2012 12:09 PM, Julia Lawall wrote: > > From: Julia Lawall > > @@ -720,20 +698,14 @@ error_ret: > > static int __devexit at91_adc_remove(struct platform_device *pdev) > > { > > struct ii

Re: [PATCH] drivers/iio/adc/at91_adc.c: use devm_ functions

2012-07-31 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. The call to platform_get_resource(pdev

Re: [PATCH] drivers/iio/adc/at91_adc.c: use devm_ functions

2012-07-31 Thread Julia Lawall
On Tue, 31 Jul 2012, Lars-Peter Clausen wrote: > Hi, > > On 07/31/2012 12:09 PM, Julia Lawall wrote: > > From: Julia Lawall > > @@ -720,20 +698,14 @@ error_ret: > > static int __devexit at91_adc_remove(struct platform_device *pdev) > > { > > stru

  1   2   3   4   5   6   7   8   9   10   >