From: Julia Lawall ju...@diku.dk
In cx23885/cx23885-video.c, cx88/cx88-video.c, davinci/vpif_capture.c, and
davinci/vpif_display.c, group the aligned code into a single if branch.
In saa7134/saa7134-video.c, outdent the code following the if.
The semantic match that finds this problem
From: Julia Lawall ju...@diku.dk
Indent the branch of an if.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@r disable braces4@
position p1,p2;
statement S1,S2;
@@
(
if (...) { ... }
|
if (...) s...@p1 s...@p2
)
@script:python@
p1 r.p1;
p2
From: Julia Lawall ju...@diku.dk
Error codes are stored in res, but the return value is always 0. Return
res instead.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@r@
local idexpression x;
constant C;
@@
if (...) { ...
x = -C
... when != x
From: Julia Lawall ju...@diku.dk
In each case, error codes are stored in rc, but the return value is always
0. Return rc instead.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@r@
local idexpression x;
constant C;
@@
if (...) { ...
x = -C
From: Julia Lawall ju...@diku.dk
Error codes are stored in rc, but the return value is always 0. Return rc
instead.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@r@
local idexpression x;
constant C;
@@
if (...) { ...
x = -C
... when != x
-fld;
+ T i;
... when != E
when != i
if (E == NULL) S
+ i = E-fld;
// /smpl
Signed-off-by: Julia Lawall ju...@diku.dk
---
drivers/media/video/em28xx/em28xx-video.c |3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/media/video/em28xx/em28xx-video.c
b/drivers
The same expression is tested twice and the result is the same each time.
The sematic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@expression@
expression E;
@@
(
* E
|| ... || E
|
* E
... E
)
// /smpl
Signed-off-by: Julia Lawall ju...@diku.dk
;}
...
*if (...)
{... when != S1
return -C2;}
...
*if (...)
{... S1 return -C3;}
// /smpl
Signed-off-by: Julia Lawall ju...@diku.dk
---
This is only a suggestion. All of the other ways out of this function call
wake_up(buf-queue);. But I don't understand the code well enough to know
why
From: Julia Lawall ju...@diku.dk
In the original code, probe_out could be reached when res was null and then
when the irq had not yet been requested. In those cases, the call to
free_irq is not needed, so move probe_out down and introduce a new label
for the case where calling free_irq is useful
On Tue, 25 Jan 2011, Peter Huewe wrote:
This patch fixes the warning Using plain integer as NULL pointer,
generated by sparse, by replacing the offending 0s with NULL.
I recall (a number of years ago) being told that for things like kmalloc,
the proper test was !x, not x == NULL.
julia
On Tue, 25 Jan 2011, Peter Hüwe wrote:
Am Dienstag 25 Januar 2011, 23:20:44 schrieb Julia Lawall:
On Tue, 25 Jan 2011, Peter Huewe wrote:
This patch fixes the warning Using plain integer as NULL pointer,
generated by sparse, by replacing the offending 0s with NULL.
I recall
From: Julia Lawall ju...@diku.dk
ictx-touch is intialied in imon_init_intf1, to the result of calling the
function that contains this code. Thus, in this code, input_free_device
should be called on touch itself.
A simplified version of the semantic match that finds this problem is:
(http
From: Julia Lawall ju...@diku.dk
Clear the cx231xx_devused variable and free dev in the error handling code,
as done in the error handling code nearby.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@r@
identifier x;
@@
kfree(x)
@@
identifier
From: Julia Lawall ju...@diku.dk
Free the recently allocated qcam in each case.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@r@
identifier x;
@@
kfree(x)
@@
identifier r.x;
expression E1!=0,E2,E3,E4;
statement S;
@@
(
if (+...x...+) S
From: Julia Lawall ju...@diku.dk
Convert array index from the loop bound to the loop index.
A simplified version of the semantic patch that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)
// smpl
@@
expression e1,e2,ar;
@@
for(e1 = 0; e1 e2; e1++) { ...
ar[
- e2
+ e1
From: Julia Lawall ju...@diku.dk
Delete nontrivial initialization that is immediately overwritten by the
result of an allocation function.
The semantic match that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@@
type T;
identifier i;
expression e;
@@
(
T i = \(0\|NULL
From: Julia Lawall ju...@diku.dk
It seems just as necessary to free cam-vdev and cam in this error case as
in the next one.
Signed-off-by: Julia Lawall ju...@diku.dk
---
There is yet another block of error handling code below the call to
zr364xx_board_init, but perhaps no cleanup code is needed
The file drivers/media/video/tvaudio.c contains the following code:
(starting at line 1257 in a recent linux-next)
if (mode V4L2_TUNER_MODE_MONO)
s1 |= TDA8425_S1_STEREO_MONO;
if (mode V4L2_TUNER_MODE_STEREO)
s1 |=
From: Julia Lawall ju...@diku.dk
In quickcam_messenger.c, if the NULL test on uvd is needed, then the
dereference should be after the NULL test.
In vpif_display.c, std_info is initialized to the address of a structure
field. This seems unlikely to be NULL. If it could somehow be NULL
From: Julia Lawall ju...@diku.dk
Error handling code following a kzalloc should free the allocated data.
Similarly for usb-alloc urb.
The semantic match that finds the first problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// smpl
@r exists@
local idexpression x;
statement S
From: Julia Lawall ju...@diku.dk
Memset should be given the size of the structure, not the size of the pointer.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@@
type T;
T *x;
expression E;
@@
memset(x, E, sizeof(
+ *
x))
// /smpl
Signed-off
From: Julia Lawall ju...@diku.dk
Memset should be given the size of the structure, not the size of the pointer.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@@
type T;
T *x;
expression E;
@@
memset(x, E, sizeof(
+ *
x))
// /smpl
Signed-off
From: Julia Lawall ju...@diku.dk
sizeof(print_buf) is just the size of the pointer. Change it to the size
used in the allocation of print_buf earlier in the same function.
A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// smpl
From: Julia Lawall ju...@diku.dk
If the NULL test is necessary, then the dereference should be moved below
the NULL test.
The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// smpl
@@
type T;
expression E;
identifier i,fld;
statement S;
@@
- T i = E
From: Julia Lawall ju...@diku.dk
Use kzalloc rather than the combination of kmalloc and memset.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@@
expression x,size,flags;
statement S;
@@
-x = kmalloc(size,flags);
+x = kzalloc(size,flags);
if (x
From: Julia Lawall ju...@diku.dk
The error value is saved in a new local variable err before freeing the
containing structure.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// smpl
@free@
expression E;
position p;
@@
kf...@p(E
From: Julia Lawall ju...@diku.dk
Use kmemdup when some other buffer is immediately copied into the
allocated region.
A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)
// smpl
@@
expression from,to,size,flag;
statement S
From: Julia Lawall ju...@diku.dk
Use kmemdup when some other buffer is immediately copied into the
allocated region.
A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)
// smpl
@@
expression from,to,size,flag;
statement S
From: Julia Lawall ju...@diku.dk
Use kmemdup when some other buffer is immediately copied into the
allocated region.
A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)
// smpl
@@
expression from,to,size,flag;
statement S
From: Julia Lawall ju...@diku.dk
Use kmemdup when some other buffer is immediately copied into the
allocated region.
A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)
// smpl
@@
expression from,to,size,flag;
statement S
From: Julia Lawall ju...@diku.dk
Use memdup_user when user data is immediately copied into the
allocated region.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@@
expression from,to,size,flag;
position p;
identifier l1,l2;
@@
- to = \(kmal...@p
From: Julia Lawall ju...@diku.dk
Add a mutex_unlock missing on the error path. In the other functions in
the same file the locks and unlocks of this mutex appear to be balanced,
so it would seem that the same should hold in this case.
The semantic match that finds this problem is as follows
From: Julia Lawall ju...@diku.dk
In each case, the print involves dereferencing a value that is NULL or is
near NULL.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// smpl
@r exists@
expression E,E1;
identifier f;
statement S1,S2
From: Julia Lawall julia.law...@lip6.fr
Rewrite a duplicated test to test the correct value
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@@
expression E;
@@
(
* E
|| ... || E
|
* E
... E
)
// /smpl
Signed-off-by: Julia Lawall julia.law
From: Julia Lawall julia.law...@lip6.fr
Rewrite a duplicated test to test the correct value
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@@
expression E;
@@
(
* E
|| ... || E
|
* E
... E
)
// /smpl
Signed-off-by: Julia Lawall julia.law
From: Julia Lawall julia.law...@lip6.fr
Rewrite a duplicated test to test the correct value
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@@
expression E;
@@
(
* E
|| ... || E
|
* E
... E
)
// /smpl
Signed-off-by: Julia Lawall julia.law
From: Julia Lawall julia.law...@lip6.fr
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
The semantic patch (http://coccinelle.lip6.fr/) used in generating this
patch is as follows. Some manual cleanup was required. This improves on
the previous version in that allocated values are allowed to be renamed
before they are freed.
virtual after_start
virtual returned
virtual arg
virtual
On Sat, 17 Mar 2012, David Miller wrote:
From: santosh prasad nayak santoshprasadna...@gmail.com
Date: Sat, 17 Mar 2012 21:26:14 +0530
Caller is interpreting 0 in opposite way of normal sequence.
Thats why I misunderstood it.
The simple fact is that you didn't even look at the code at the
On Tue, 9 Apr 2013, Dan Carpenter wrote:
We should unlock here and do some cleanup before returning.
We can't actually hit this return path with the current code, so this
patch is a basically a cleanup and doesn't change how the code works.
Why keep the return path then? If the code is
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
From: Julia Lawall julia.law...@lip6.fr
Add missing usb_free_urb on failure path after usb_alloc_urb.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// smpl
@km exists@
local idexpression e;
expression e1,e2,e3;
type T,T1
From: Julia Lawall julia.law...@lip6.fr
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
From: Julia Lawall julia.law...@lip6.fr
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
From: Julia Lawall julia.law...@lip6.fr
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
From: Julia Lawall julia.law...@lip6.fr
Using devm_kzalloc and devm_clk_get simplifies the code and ensures that
the use of devm_request_irq is safe. When kzalloc and kfree were used, the
interrupt could be triggered after the handler's data argument had been
freed.
The problem of a free after
Quoting Lars-Peter Clausen l...@metafoo.de:
On 08/06/2012 04:26 PM, Dan Carpenter wrote:
On Mon, Aug 06, 2012 at 05:23:23PM +0300, Dan Carpenter wrote:
On Sat, Aug 04, 2012 at 08:23:27PM +0200, Julia Lawall wrote:
@@ -922,12 +920,7 @@ static int emmaprp_probe(struct
platform_device *pdev
Quoting Lars-Peter Clausen l...@metafoo.de:
On 08/06/2012 04:26 PM, Dan Carpenter wrote:
On Mon, Aug 06, 2012 at 05:23:23PM +0300, Dan Carpenter wrote:
On Sat, Aug 04, 2012 at 08:23:27PM +0200, Julia Lawall wrote:
@@ -922,12 +920,7 @@ static int emmaprp_probe(struct
platform_device *pdev
From: Julia Lawall julia.law...@lip6.fr
Using devm_kzalloc and devm_clk_get simplifies the code and ensures that
the use of devm_request_irq is safe. When kzalloc and kfree were used, the
interrupt could be triggered after the handler's data argument had been
freed.
Add missing return code
On Mon, 13 Aug 2012, Mauro Carvalho Chehab wrote:
Em 10-08-2012 10:59, Julia Lawall escreveu:
From: Julia Lawall julia.law...@lip6.fr
Using devm_kzalloc and devm_clk_get simplifies the code and ensures that
the use of devm_request_irq is safe. When kzalloc and kfree were used, the
interrupt
From: Julia Lawall julia.law...@lip6.fr
Using devm_kzalloc simplifies the code and ensures that the use of
devm_request_irq is safe. When kzalloc and kfree were used, the interrupt
could be triggered after the handler's data argument had been freed.
This also introduces some missing
Well, I've massively applied hundreds of patches today, but not much
on this driver. Maybe it is better for you to wait for a couple of
days for these to be at -next, or use, instead, our tree as the basis for
it:
git://linuxtv.org/media_tree.git staging/for_v3.7
I cloned this, but it
From: Julia Lawall julia.law...@lip6.fr
Using devm_kzalloc simplifies the code and ensures that the use of
devm_request_irq is safe. When kzalloc and kfree were used, the interrupt
could be triggered after the handler's data argument had been freed.
This also introduces some missing
From: Julia Lawall julia.law...@lip6.fr
If the NULL test is necessary, the initialization involving a dereference of
the tested value should be moved after the NULL test.
The sematic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@@
type T;
expression E
From: Julia Lawall julia.law...@lip6.fr
The result of one call to a function is tested, and then at the second call
to the same function, the previous result, and not the current result, is
tested again.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr
From: Julia Lawall julia.law...@lip6.fr
The result of one call to a function is tested, and then at the second call
to the same function, the previous result, and not the current result, is
tested again.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr
From: Julia Lawall julia.law...@lip6.fr
The result of one call to a function is tested, and then at the second call
to the same function, the previous result, and not the current result, is
tested again.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr
From: Julia Lawall julia.law...@lip6.fr
At the point of the call to video_register_device, both dev-vbi_dev and
dev-vdev have been allocated, and so should be freed on failure. The
error-handling code is moved to the end of the function, to avoid code
duplication.
Signed-off-by: Julia Lawall
The files drivers/media/video/bt8xx/bttv-audio-hook.c and
drivers/media/video/tvaudio.c contain a number of occurrences of eg:
mode |= V4L2_TUNER_MODE_LANG1 | V4L2_TUNER_MODE_LANG2;
and
if (mode V4L2_TUNER_MODE_MONO)
(both from tvaudio.c)
V4L2_TUNER_MODE_LANG1 | V4L2_TUNER_MODE_LANG2 is
On Sat, 9 Jun 2012, Hans Verkuil wrote:
On Wed June 6 2012 09:06:23 Julia Lawall wrote:
The files drivers/media/video/bt8xx/bttv-audio-hook.c and
drivers/media/video/tvaudio.c contain a number of occurrences of eg:
mode |= V4L2_TUNER_MODE_LANG1 | V4L2_TUNER_MODE_LANG2;
and
if (mode
On Tue, 18 Dec 2012, Jean Delvare wrote:
Hi Julia,
On Thu, 11 Oct 2012 08:45:43 +0200 (CEST), Julia Lawall wrote:
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
On Wed, 2 Jan 2013, Tony Prisk wrote:
On Wed, 2013-01-02 at 08:10 +0300, Dan Carpenter wrote:
clk_get() returns NULL if CONFIG_HAVE_CLK is disabled.
I told Tony about this but everyone has been gone with end of year
holidays so it hasn't been addressed.
Tony, please fix it so people don't
On Wed, 2 Jan 2013, Russell King - ARM Linux wrote:
On Wed, Jan 02, 2013 at 08:10:36AM +0300, Dan Carpenter wrote:
clk_get() returns NULL if CONFIG_HAVE_CLK is disabled.
I told Tony about this but everyone has been gone with end of year
holidays so it hasn't been addressed.
Tony,
On Thu, 3 Jan 2013, Dan Carpenter wrote:
On Wed, Jan 02, 2013 at 06:31:53PM +1300, Tony Prisk wrote:
On Wed, 2013-01-02 at 08:10 +0300, Dan Carpenter wrote:
clk_get() returns NULL if CONFIG_HAVE_CLK is disabled.
I told Tony about this but everyone has been gone with end of year
From: Julia Lawall julia.law...@lip6.fr
The data referenced by an interrupt handler should not be freed before the
interrupt is ended. The handler is pxa_camera_irq. This handler may call
pxa_dma_start_channels, which references the channels that are freed on the
lines before the call
On Mon, 7 Jan 2013, Guennadi Liakhovetski wrote:
(adding Robert to CC)
Hi Julia
Thanks for the patch.
On Mon, 7 Jan 2013, Julia Lawall wrote:
From: Julia Lawall julia.law...@lip6.fr
The data referenced by an interrupt handler should not be freed before the
interrupt is ended
From: Julia Lawall julia.law...@lip6.fr
This patch uses various devm_ functions for data that is allocated in the
probe function of a platform driver and is only freed in the remove
function.
This also fixes a checkpatch warning, removing a space before a \n in a
string.
Signed-off-by: Julia
On Mon, 7 Jan 2013, Robert Jarzmik wrote:
Guennadi Liakhovetski g.liakhovet...@gmx.de writes:
(adding Robert to CC)
I don't think any data is freed by pxa_free_dma(), it only disables DMA on
a certain channel. Theoretically there could be a different problem:
pxa_free_dma()
Signed-off-by: Julia Lawall ju...@diku.dk
---
drivers/media/video/davinci/vpbe.c |4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/media/video/davinci/vpbe.c
b/drivers/media/video/davinci/vpbe.c
index d773d30..99658ba 100644
--- a/drivers/media/video/davinci
...
(
return \(0\|+...x...+\|ptr\);
|
return@p2 ...;
)
@script:python@
p1 r.p1;
p2 r.p2;
@@
print * file: %s kmalloc %s return %s % (p1[0].file,p1[0].line,p2[0].line)
// /smpl
Signed-off-by: Julia Lawall ju...@diku.dk
---
drivers/staging/media/as102/as102_usb_drv.c | 12 ++--
1 file changed
On Wed, 3 Feb 2010, Mauro Carvalho Chehab wrote:
Hi Julia,
From: Julia Lawall ju...@diku.dk
diff -puN
drivers/media/video/davinci/vpif_display.c~drivers-media-video-move-dereference-after-null-test
drivers/media/video/davinci/vpif_display.c
---
a/drivers/media/video/davinci
From: Julia Lawall ju...@diku.dk
In each case, the NULL test has been performed already.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// smpl
@r@
expression *x;
expression e;
identifier l;
@@
if (x == NULL || ...) {
... when
From: Julia Lawall ju...@diku.dk
The region set by the call to memset is immediately overwritten by the
subsequent call to memcpy.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@@
expression e1,e2,e3,e4;
@@
- memset(e1,e2,e3);
memcpy(e1,e4,e3
To: mche...@infradead.org
Cc: linux-media@vger.kernel.org; a...@linux-foundation.org; ju...@diku.dk
Subject: [patch 2/5] drivers/media/video: move dereference after NULL test
From: Julia Lawall ju...@diku.dk
In quickcam_messenger.c, if the NULL test on uvd is needed, then the
dereference should
From: Julia Lawall ju...@diku.dk
In quickcam_messenger.c, if the NULL test on uvd is needed, then the
dereference should be after the NULL test.
In vpif_display.c, std_info is initialized to the address of a structure
field. This seems unlikely to be NULL. Test std_info-stdid instead
From: Julia Lawall ju...@diku.dk
If ov is NULL, it will not be possible to take the lock in the first place,
so move the test up earlier.
The semantic match that finds the problem is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@r exists@
expression E, E1;
identifier f;
statement S1,S3
From: Julia Lawall ju...@diku.dk
It seems impossible for ov to be NULL at this point.
The semantic match that finds the problem is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@r exists@
expression E, E1;
identifier f;
statement S1,S3;
iterator iter;
@@
if ((E == NULL
I think we can pretty safely assume that we never get here with ov==NULL.
Oh well, I'll leave the test there for others to ponder.
OK. I didn't read far enough in this email and sent another patch, in
case it's useful.
julia
--
To unsubscribe from this list: send the line unsubscribe
From: Julia Lawall ju...@diku.dk
Check that the result of kmalloc is not NULL before passing it to other
functions.
The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// smpl
@@
expression *x;
identifier f;
constant char *C;
@@
x = \(kmalloc
From: Julia Lawall ju...@diku.dk
It seems from other code that it is the dst_type field rather than the
type_flags field that contains values of the form DST_TYPE_IS...
The type_flags field contains values of the form DST_TYPE_HAS...
The semantic match that finds this problem is as follows
From: Julia Lawall ju...@diku.dk
Error handling code following a kmalloc should free the allocated data.
The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// smpl
@r exists@
local idexpression x;
statement S;
expression E;
identifier f,f1,l
From: Julia Lawall ju...@diku.dk
Error handling code following kmalloc should free the allocated data.
The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// smpl
@r exists@
local idexpression x;
statement S;
expression E;
identifier f,f1,l;
position
From: Julia Lawall ju...@diku.dk
Error handling code following a kzalloc should free the allocated data.
The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// smpl
@r exists@
local idexpression x;
statement S;
expression E;
identifier f,f1,l
From: Julia Lawall ju...@diku.dk
Move the kzalloc and associated test after the stream/query test, to avoid
the need to free the allocated if the stream/query test fails.
The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// smpl
@r exists@
local
From: Julia Lawall ju...@diku.dk
Move the kzalloc and associated test after the stream/query test, to avoid
the need to free the allocated if the stream/query test fails.
The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// smpl
@r exists@
local
From: Julia Lawall julia.law...@lip6.fr
Change the call to IS_ERR to test the value that was just initialized and
is returned using PTR_ERR.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@@
expression e,e1;
@@
(
if (IS_ERR(e)) { ... PTR_ERR(e
The function rtl2830_init contains the code:
buf[0] = tmp 6;
buf[0] = (if_ctl 16) 0x3f;
buf[1] = (if_ctl 8) 0xff;
buf[2] = (if_ctl 0) 0xff;
Is there any purpose to initializing buf[0] twice?
julia
--
To unsubscribe from this list: send the line
From: Julia Lawall julia.law...@lip6.fr
The double assignment is meant to be a bit-or to combine two values.
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
On Sun, 26 Aug 2012, Antti Palosaari wrote:
On 08/26/2012 02:20 PM, Andy Walls wrote:
Julia Lawall julia.law...@lip6.fr wrote:
The function rtl2830_init contains the code:
buf[0] = tmp 6;
buf[0] = (if_ctl 16) 0x3f;
buf[1] = (if_ctl 8) 0xff;
buf[2
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
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
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
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
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
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
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
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
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
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
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
1 - 100 of 307 matches
Mail list logo