[PATCH 3/5] drivers/gpu: Correct NULL test

2009-12-27 Thread Julia Lawall
From: Julia Lawall ju...@diku.dk Test the just-allocated value for NULL rather than some other value. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ expression x,y; statement S; @@ x = \(kmalloc\|kcalloc\|kzalloc\)(...); ( if ((x) == NULL) S

[PATCH 2/7] drivers/gpu: Use kzalloc for allocating only one thing

2009-12-19 Thread Julia Lawall
From: Julia Lawall ju...@diku.dk Use kzalloc rather than kcalloc(1,...) The use of the allocated memory that looks like an array is p-relocs[0], but this should be the same as p-relocs. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl

[PATCH 1/2] drivers/gpu/drm: introduce missing kfree

2009-12-13 Thread Julia Lawall
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

[PATCH 2/10] drivers/gpu/drm: Move a dereference below a NULL test

2009-07-19 Thread Julia Lawall
From: Julia Lawall ju...@diku.dk If the NULL test is necessary, then the dereference should be moved below the NULL test. In the case of drivers/gpu/drm/i915/i915_drv.c, the variable dev_priv whose initialization causes the problem is never used in the function, so it is dropped. Dropped some

[PATCH 2/5] drivers/gpu: Move a dereference below a NULL test

2009-07-11 Thread Julia Lawall
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

[PATCH 2/13] drivers/gpu/drm/i915: Remove redundant test

2008-12-21 Thread Julia Lawall
From: Julia Lawall ju...@diku.dk object_list is checked to be not NULL near the beginning of the function and is not updated subsequently. A simplified version of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // smpl @r exists@ local

Re: [PATCH 1/3] drivers/gpu/drm: Move a dereference below a NULL test

2008-12-20 Thread Julia Lawall
OK julia On Fri, 19 Dec 2008, Eric Anholt wrote: On Sat, 2008-12-20 at 08:35 +1000, Dave Airlie wrote: On Sat, Dec 20, 2008 at 3:10 AM, Julia Lawall ju...@diku.dk wrote: From: Julia Lawall ju...@diku.dk If the NULL test is necessary, then the dereference should be moved below

[PATCH 1/3] drivers/gpu/drm: Move a dereference below a NULL test

2008-12-19 Thread Julia Lawall
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/). The result has been modified to move the initialization of driver down