[PATCH 8/8] : Use FIELD_SIZEOF

2008-02-10 Thread Julia Lawall
From: Julia Lawall [EMAIL PROTECTED] Robert P.J. Day proposed to use the macro FIELD_SIZEOF in replace of code that matches its definition. The modification was made using the following semantic patch (http://www.emn.fr/x-info/coccinelle/) // smpl @haskernel@ @@ #include linux/kernel.h

[PATCH 6/8] drivers/net/igb: Use FIELD_SIZEOF

2008-02-10 Thread Julia Lawall
From: Julia Lawall [EMAIL PROTECTED] Robert P.J. Day proposed to use the macro FIELD_SIZEOF in replace of code that matches its definition. The modification was made using the following semantic patch (http://www.emn.fr/x-info/coccinelle/) // smpl @haskernel@ @@ #include linux/kernel.h

[PATCH 3/8] drivers/net/e1000: Use FIELD_SIZEOF

2008-02-10 Thread Julia Lawall
From: Julia Lawall [EMAIL PROTECTED] Robert P.J. Day proposed to use the macro FIELD_SIZEOF in replace of code that matches its definition. The modification was made using the following semantic patch (http://www.emn.fr/x-info/coccinelle/) // smpl @haskernel@ @@ #include linux/kernel.h

[PATCH 7/8] drivers/usb: Use FIELD_SIZEOF

2008-02-10 Thread Julia Lawall
From: Julia Lawall [EMAIL PROTECTED] Robert P.J. Day proposed to use the macro FIELD_SIZEOF in replace of code that matches its definition. The modification was made using the following semantic patch (http://www.emn.fr/x-info/coccinelle/) // smpl @haskernel@ @@ #include linux/kernel.h

[PATCH 5/8] drivers/net/mv643xx_eth.c: Use FIELD_SIZEOF

2008-02-10 Thread Julia Lawall
From: Julia Lawall [EMAIL PROTECTED] Robert P.J. Day proposed to use the macro FIELD_SIZEOF in replace of code that matches its definition. The modification was made using the following semantic patch (http://www.emn.fr/x-info/coccinelle/) // smpl @haskernel@ @@ #include linux/kernel.h

[PATCH 2/8] drivers/block: Use FIELD_SIZEOF

2008-02-10 Thread Julia Lawall
From: Julia Lawall [EMAIL PROTECTED] Robert P.J. Day proposed to use the macro FIELD_SIZEOF in replace of code that matches its definition. The modification was made using the following semantic patch (http://www.emn.fr/x-info/coccinelle/) // smpl @haskernel@ @@ #include linux/kernel.h

[PATCH 4/8] : Use FIELD_SIZEOF

2008-02-10 Thread Julia Lawall
From: Julia Lawall [EMAIL PROTECTED] Robert P.J. Day proposed to use the macro FIELD_SIZEOF in replace of code that matches its definition. The modification was made using the following semantic patch (http://www.emn.fr/x-info/coccinelle/) // smpl @haskernel@ @@ #include linux/kernel.h

[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/) // smpl @haskernel@ @@ #include

[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/) // smpl @haskernel@ @@ #include

[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/) // smpl @haskernel@ @@ #include

[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/) // smpl @haskernel@ @@ #include

[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 readable. An extract

[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/) // smpl @haskernel@ @@ #include

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 =

Re: [PATCH] scripts/coccinelle/misc/semicolon.cocci: Add unnecessary semicolon test

2012-10-30 Thread Julia Lawall
; case MMC_POWER_UP: default: - /* ignore */; } There are 37 patches accepted reported by this semantic patch and more than 300 fixes to be applied. Signed-off-by: Peter Senna Tschudin peter.se...@gmail.com Acked-by: Julia Lawall julia.law...@lip6.fr

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

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

2012-10-05 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 peter.se...@gmail.com On Thu, Oct 4, 2012 at 8:23 PM, David Miller da...@davemloft.net wrote: We want to know the implications of the bug being fixed. Does it potentially

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/13] include/linux/i2c.h: introduce macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr This patch introduces some macros for describing how an i2c_msg is being initialized. There are three macros: I2C_MSG_READ, for a read message, I2C_MSG_WRITE, for a write message, and I2C_MSG_OP, for some other kind of message, which is expected to be very

[PATCH 0/11] introduce macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
This patch set introduces some macros for describing how an i2c_msg is being initialized. There are three macros: I2C_MSG_READ, for a read message, I2C_MSG_WRITE, for a write message, and I2C_MSG_OP, for some other kind of message, which is expected to be very rarely used. Some i2c_msg

[PATCH 3/13] drivers/media/tuners/qt1010.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. A length expressed as an explicit constant is also re-expressed as the size of the buffer, when this is possible. A simplified version of the semantic patch that makes this change is as follows

[PATCH 6/13] drivers/media/tuners/tda18271-common.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ expression a,b,c; identifier x; @@ struct i2c_msg x = - {.addr = a, .buf = b

[PATCH 7/13] drivers/media/tuners/tua9001.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ expression a,b,c; identifier x; @@ struct i2c_msg x = - {.addr = a, .buf = b

[PATCH 4/13] drivers/media/tuners/tda18212.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. In the second initialization, a length expressed as an explicit constant is also re-expressed as the size of the buffer (reg). A simplified version of the semantic patch that makes this change

[PATCH 11/13] drivers/media/tuners/tda18218.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ expression a,b,c; identifier x; @@ struct i2c_msg x = - {.addr = a, .buf = b

[PATCH 10/13] drivers/media/tuners/tda8290.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. A length expressed as an explicit constant is also re-expressed as the size of the bufferin each case. A simplified version of the semantic patch that makes this change is as follows: (http

[PATCH 8/13] drivers/media/tuners/fc2580.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. A length expressed as an explicit constant is also re-expressed as the size of the buffer in each case. A simplified version of the semantic patch that makes this change is as follows: (http

[PATCH 12/13] drivers/media/tuners/max2165.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. A length expressed as an explicit constant is also re-expressed as the size of the buffer, when this is possible. The second case is simplified to use simple variables rather than arrays

[PATCH 9/13] drivers/media/tuners/fc0011.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. A length expressed as an explicit constant is also re-expressed as the size of the buffer in each case. A simplified version of the semantic patch that makes this change is as follows: (http

[PATCH 5/13] drivers/media/tuners: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. A length expressed as an explicit constant is also re-expressed as the size of the buffer, when this is possible. A simplified version of the semantic patch that makes this change is as follows

[PATCH 2/13] drivers/media/tuners/mxl5007t.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. In each case, a length expressed as an explicit constant is also re-expressed as the size of the buffer, when this is possible. A simplified version of the semantic patch that makes this change

[PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. In the second i2c_msg structure, a length expressed as an explicit constant is also re-expressed as the size of the buffer, reg. A simplified version of the semantic patch that makes this change

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
On Sun, 7 Oct 2012, walter harms wrote: Am 07.10.2012 17:38, schrieb Julia Lawall: From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. In the second i2c_msg structure, a length expressed as an explicit constant is also re-expressed as the size

Re: [PATCH 9/13] drivers/media/tuners/fc0011.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
On Sun, 7 Oct 2012, walter harms wrote: Am 07.10.2012 17:38, schrieb Julia Lawall: From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. A length expressed as an explicit constant is also re-expressed as the size of the buffer in each case

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
On Sun, 7 Oct 2012, walter harms wrote: Am 07.10.2012 18:44, schrieb Julia Lawall: On Sun, 7 Oct 2012, walter harms wrote: Am 07.10.2012 17:38, schrieb Julia Lawall: From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. In the second i2c_msg

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
Some people thought that it would be nice to have the macros rather than the inlined field initializations, especially since there is no flag for write. A separate question is whether an array of one element is useful, or whether one should systematically use on a simple variable of the

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
On Sun, 7 Oct 2012, Joe Perches wrote: On Sun, 2012-10-07 at 20:56 +0200, Julia Lawall wrote: Some people thought that it would be nice to have the macros rather than the inlined field initializations, especially since there is no flag for write. A separate question is whether an array of one

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
On Sun, 7 Oct 2012, Joe Perches wrote: On Sun, 2012-10-07 at 23:43 +0200, Julia Lawall wrote: On Sun, 7 Oct 2012, Joe Perches wrote: Are READ and WRITE the action names? They are really the important information in this case. Yes, most (all?) uses of _READ and _WRITE macros actually

Re: [PATCH 3/13] drivers/media/tuners/qt1010.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
On Mon, 8 Oct 2012, Ryan Mallon wrote: On 08/10/12 02:38, Julia Lawall wrote: From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. A length expressed as an explicit constant is also re-expressed as the size of the buffer, when this is possible

Re: [PATCH 5/13] drivers/media/tuners: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
in question is a pointer, so sizeof would give the wrong result. If it is preferred, I could not use sizeof for the other structure in the same code, but it seems just a little safer to use it. thanks, julia On Mon, 8 Oct 2012, Ryan Mallon wrote: On 08/10/12 02:38, Julia Lawall wrote: From: Julia

Re: [PATCH 12/13] drivers/media/tuners/max2165.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
On Mon, 8 Oct 2012, Ryan Mallon wrote: On 08/10/12 02:38, Julia Lawall wrote: From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. A length expressed as an explicit constant is also re-expressed as the size of the buffer, when this is possible

Re: [PATCH 3/13] drivers/media/tuners/qt1010.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
Sorry, I mean either: I2C_MSG_WRITE(priv-cfg-i2c_address, reg, sizeof(reg)), I2C_MSG_READ(priv-cfg-i2c_address, val, sizeof(*val)), Of course. Sorry for not having seen that. I can do that. julia -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-08 Thread Julia Lawall
I found only 15 uses of I2C_MSG_OP, out of 653 uses of one of the three macros. Since I2C_MSG_OP has the complete set of flags, I think it should be OK? One of the uses, in drivers/media/i2c/adv7604.c, is as follows: struct i2c_msg msg[2] = { { client-addr, 0, 1, msgbuf0 },

[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

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression list es; @@ -printk( +WARN_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 julia.law...@lip6.fr 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

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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 julia.law...@lip6.fr --- drivers/misc/kgdbts.c | 38 +- 1 file changed, 17

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!

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

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

[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. // smpl @@ expression e; @@ ( if(+...e(...)...+) WARN_ON(1); | - if (e) WARN_ON(1); + WARN_ON(e); )// /smpl -- To unsubscribe

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression e; @@ - if (e) WARN_ON(1); + WARN_ON(e); // /smpl

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression e; @@ - if (e) WARN_ON(1); + WARN_ON(e); // /smpl

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression e; @@ - if (e) WARN_ON(1); + WARN_ON(e); // /smpl

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression e; @@ - if (e) WARN_ON(1); + WARN_ON(e); // /smpl

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression e; @@ - if (e) WARN_ON(1); + WARN_ON(e); // /smpl

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression e; @@ - if (e) WARN_ON(1); + WARN_ON(e); // /smpl

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression e; @@ - if (e) WARN_ON(1); + WARN_ON(e); // /smpl

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

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @@ expression e; @@ - if (e) WARN_ON(1); + WARN_ON(e); // /smpl

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 julia.law...@lip6.fr 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

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 julia.law...@lip6.fr wrote: On Sun, 4 Nov 2012, Sasha Levin wrote: Hi Julia, On Sat, Nov 3, 2012 at 4:30 PM, Julia Lawall julia.law...@lip6.fr wrote: These patches convert a conditional with a simple test

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

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

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

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 KERN_WARNING level, followed by the format that got passed

[PATCH 0/5] eliminate possible double free

2012-10-21 Thread Julia Lawall
These patches fix cases where a called function frees some data and the calling context frees the same data. The complete semantic match is as follows: (http://coccinelle.lip6.fr/) // smpl @r exists@ parameter list[n] ps; type T; identifier a; expression e; expression ret != 0; identifier

[PATCH 5/5] drivers/iio/industrialio-event.c: eliminate possible double free

2012-10-21 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The function __iio_add_event_config_attrs is only called once, by the function iio_device_register_eventset. If the call fails, iio_device_register_eventset calls __iio_remove_event_config_attrs. There is thus no need for __iio_add_event_config_attrs

[PATCH 1/5] sound/isa/opti9xx/miro.c: eliminate possible double free

2012-10-21 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr snd_miro_probe is a static function that is only called twice in the file that defines it. At each call site, its argument is freed using snd_card_free. Thus, there is no need for snd_miro_probe to call snd_card_free on its argument on any of its error

[PATCH 2/5] drivers/net/wireless/ti/wlcore/main.c: eliminate possible double power off

2012-10-21 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The function wl12xx_set_power_on is only called twice, once in wl12xx_chip_wakeup and once in wl12xx_get_hw_info. On the failure of the call in wl12xx_chip_wakeup, the containing function just returns, but on the failure of the call in wl12xx_get_hw_info

[PATCH 3/5] arch/powerpc/kernel/rtas_flash.c: eliminate possible double free

2012-10-21 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The function initialize_flash_pde_data is only called four times. All four calls are in the function rtas_flash_init, and on the failure of any of the calls, remove_flash_pde is called on the third argument of each of the calls. There is thus no need

[PATCH 4/5] ath6kl/wmi.c: eliminate possible double free

2012-10-21 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr This makes two changes. In ath6kl_wmi_cmd_send, a call to dev_kfree_skb on the skb argument is added to the initial sanity check to more completely establish the invariant that ath6kl_wmi_cmd_send owns its skb argument. Then, in ath6kl_wmi_sync_point

Re: [PATCH 0/11] introduce macros for i2c_msg initialization

2012-10-22 Thread Julia Lawall
I have been looking at this again, with the macros #define I2C_MSG_OP(_addr, _buf, _len, _flags) \ { .addr = _addr, .buf = _buf, .len = _len, .flags = _flags } #define I2C_MSG_WRITE(addr, buf, len) \ I2C_MSG_OP(addr, buf, len, 0) #define I2C_MSG_READ(addr, buf, len) \

Re: [PATCH 2/13] drivers/media/tuners/mxl5007t.c: use macros for i2c_msg initialization

2012-10-09 Thread Julia Lawall
On Tue, 9 Oct 2012, Jean Delvare wrote: Hi Julia, On Sun, 7 Oct 2012 17:38:33 +0200, Julia Lawall wrote: From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. Next time you send this patch set, please Cc me on every post so that I don't have

Re: [PATCH 3/13] drivers/media/tuners/qt1010.c: use macros for i2c_msg initialization

2012-10-09 Thread Julia Lawall
On Tue, 9 Oct 2012, Jean Delvare wrote: Hi Julia, On Mon, 8 Oct 2012 07:24:11 +0200 (CEST), Julia Lawall wrote: Sorry, I mean either: I2C_MSG_WRITE(priv-cfg-i2c_address, reg, sizeof(reg)), I2C_MSG_READ(priv-cfg-i2c_address, val, sizeof(*val)), Of course. Sorry

Re: [PATCH 0/11] introduce macros for i2c_msg initialization

2012-10-09 Thread Julia Lawall
On Tue, 9 Oct 2012, Jean Delvare wrote: Hi Julia, On Sun, 7 Oct 2012 17:38:30 +0200, Julia Lawall wrote: This patch set introduces some macros for describing how an i2c_msg is being initialized. There are three macros: I2C_MSG_READ, for a read message, I2C_MSG_WRITE, for a write

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-11 Thread Julia Lawall
I found 6 cases where there are more than 2 messages in the array. I didn't check how many cases where there are two messages but there is something other than one read and one write. Perhaps a reasonable option would be to use I2C_MSG_READ I2C_MSG_WRITE I2C_MSG_READ_OP I2C_MSG_WRITE_OP The

[PATCH 0/6] ensure a consistent return value in error case

2012-07-14 Thread Julia Lawall
Typically, the return value desired for the failure of a function with an integer return value is a negative integer. In these cases, the return value is sometimes a negative integer and sometimes 0, due to a subsequent initialization of the return variable within the loop. The semantic match

[PATCH 3/6] arch/arm/mach-netx/xc.c: ensure a consistent return value in error case

2012-07-14 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Typically, the return value desired for the failure of a function with an integer return value is a negative integer. In these cases, the return value is sometimes a negative integer and sometimes 0, due to a subsequent initialization of the return

[PATCH 6/6] arch/x86/kernel/kdebugfs.c: ensure a consistent return value in error case

2012-07-14 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Typically, the return value desired for the failure of a function with an integer return value is a negative integer. In these cases, the return value is sometimes a negative integer and sometimes 0, due to a subsequent initialization of the return

[PATCH 2/6] drivers/net/can/softing/softing_main.c: ensure a consistent return value in error case

2012-07-14 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Typically, the return value desired for the failure of a function with an integer return value is a negative integer. In these cases, the return value is sometimes a negative integer and sometimes 0, due to a subsequent initialization of the return

[PATCH 1/6] drivers/pci/hotplug/cpci_hotplug_core.c: ensure a consistent return value in error case

2012-07-14 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Typically, the return value desired for the failure of a function with an integer return value is a negative integer. In these cases, the return value is sometimes a negative integer and sometimes 0, due to a subsequent initialization of the return

[PATCH 4/6] drivers/cpuidle/sysfs.c: ensure a consistent return value in error case

2012-07-14 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Typically, the return value desired for the failure of a function with an integer return value is a negative integer. In these cases, the return value is sometimes a negative integer and sometimes 0, due to a subsequent initialization of the return

[PATCH 5/6] drivers/pci/hotplug: ensure a consistent return value in error case

2012-07-14 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Typically, the return value desired for the failure of a function with an integer return value is a negative integer. In these cases, the return value is sometimes a negative integer and sometimes 0, due to a subsequent initialization of the return

[PATCH] drivers/media/dvb/siano/smscoreapi.c: use list_for_each_entry

2012-07-15 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Use list_for_each_entry and perform some other induced simplifications. The semantic match that finds the opportunity for this reorganization is as follows: (http://coccinelle.lip6.fr/) // smpl @@ struct list_head *pos; struct list_head *head; statement S

Re: [PATCH] compat/compat-drivers/linux-next: fb skip_vt_switch

2013-03-28 Thread Julia Lawall
On Thu, 28 Mar 2013, Luis R. Rodriguez wrote: On Thu, Mar 28, 2013 at 9:19 AM, Julia Lawall julia.law...@lip6.fr wrote: On Thu, 28 Mar 2013, Jesse Barnes wrote: - info-skip_vt_switch = true; + fb_enable_skip_vt_switch(info); So we'd then have to just add

Re: [PATCH] compat/compat-drivers/linux-next: fb skip_vt_switch

2013-03-28 Thread Julia Lawall
On Thu, 28 Mar 2013, Luis R. Rodriguez wrote: On Thu, Mar 28, 2013 at 11:10 AM, Julia Lawall julia.law...@lip6.fr wrote: On Thu, 28 Mar 2013, Luis R. Rodriguez wrote: Thanks Julia! I'll be sure to try to add this to compat-drivers if the upstream fb patch is not accepted

<    1   2   3   4   5   6   7   8   9   10   >