[PATCH 25/42] drivers/gpu/drm/radeon: Adjust confusing if indentation

2010-08-05 Thread Julia Lawall
From: Julia Lawall ju...@diku.dk Outdent the code following the 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

[PATCH 3/4] drivers/gpu/drm/i915/i915_gem.c: Add missing error handling code

2010-10-02 Thread Julia Lawall
;} ... *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 these two functions. But I don't understand the code well enough to know why

[PATCH 3/3] drivers/gpu/drm/drm_bufs.c: Avoid leaving freed data in a list

2011-05-13 Thread Julia Lawall
; identifier l; @@ *list_add(E-l,E1); ... when != E1 when != list_del(E-l) when != list_del_init(E-l) when != E = E2 *kfree(E);// /smpl Signed-off-by: Julia Lawall ju...@diku.dk --- I have only verified that the list is not accessed by drm_map_handle by inspecting the code. If this analysis

[PATCH] drivers/gpu/drm/i915/i915_gem.c: Add missing error handling code

2011-05-16 Thread Julia Lawall
From: Julia Lawall ju...@diku.dk The cleanup code at the end of the function should also be carried out when the function only partly completes its work. A simplified version of the semantic match that finds this problem is: (http://coccinelle.lip6.fr/) // smpl @r exists@ local idexpression

Re: question about drivers/gpu/drm/drm_ioc32.c

2012-01-30 Thread Julia Lawall
On Mon, 30 Jan 2012, Dave Airlie wrote: On Sat, Jan 28, 2012 at 7:28 PM, Julia Lawall julia.law...@lip6.fr wrote: In the function compat_drm_getclient, I have the impression that the structure c32 is copied to user level with the field idx uninitialized? Looks like it alright, care to send

[PATCH] initialize all fields

2012-01-30 Thread Julia Lawall
This patch fixes a case where a structure field is not initialized before the structureis copied to user level. The semantic match that finds this problem is as follows (http://coccinelle.lip6.fr/). It uses other references to the same structure in the current file to find the set of fields that

[PATCH] drivers/gpu/drm/radeon/radeon_cs.c: eliminate possible double free

2012-03-18 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The function radeon_cs_parser_init is only called from two places, in drivers/gpu/drm/radeon/radeon_cs.c and drivers/gpu/drm/radeon/r600_cs.c. In each case, if the call fails another function is called that frees all of the kdata and dpage information

[PATCH] drivers/gpu/drm/savage/savage_state.c: add missing kfree

2012-03-18 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Most of the error handling code in this function frees the buffers kcmd_addr, kvb_addr, and kbox_addr allocated at the beginning of this function. These two branches are changed to do the same. Signed-off-by: Julia Lawall julia.law...@lip6.fr

[PATCH] drivers/gpu/drm/exynos: use devm_ functions

2012-03-25 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The various devm_ functions allocate memory that is released when a driver detaches. This patch uses devm_kzalloc, devm_request_irq, etc. for data that is allocated in the probe function of a platform device and is only freed in the remove function

question about drivers/gpu/drm/gma500/oaktrail_lvds.c

2012-07-08 Thread Julia Lawall
In the function oaktrail_lvds_mode_set, I don't think that the following code makes any sense: /* Find the connector we're trying to set up */ list_for_each_entry(connector, mode_config-connector_list, head) { if (!connector-encoder || connector-encoder-crtc !=

[PATCH 4/7] drivers/gpu/drm: remove invalid reference to list iterator variable

2012-07-08 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr If list_for_each_entry, etc complete a traversal of the list, the iterator variable ends up pointing to an address at an offset from the list head, and not a meaningful structure. Thus this value should not be used after the end of the iterator

Re: question about drivers/gpu/drm/gma500/oaktrail_lvds.c

2012-07-09 Thread Julia Lawall
On Sun, 8 Jul 2012, Alan Cox wrote: On Sun, 8 Jul 2012 10:39:43 +0200 (CEST) Julia Lawall julia.law...@lip6.fr wrote: In the function oaktrail_lvds_mode_set, I don't think that the following code makes any sense: /* Find the connector we're trying to set up

Re: [PATCH 4/7] drivers/gpu/drm: remove invalid reference to list iterator variable

2012-07-09 Thread Julia Lawall
On Sun, 8 Jul 2012, Paul Menzel wrote: Dear Julia, Am Sonntag, den 08.07.2012, 13:37 +0200 schrieb Julia Lawall: From: Julia Lawall julia.law...@lip6.fr If list_for_each_entry, etc complete a traversal of the list, the iterator variable ends up pointing to an address at an offset from

[PATCH 2/3] drivers/gpu/drm/gma500/oaktrail_crtc.c: remove invalid reference to list iterator variable

2012-07-09 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr If list_for_each_entry, etc complete a traversal of the list, the iterator variable ends up pointing to an address at an offset from the list head, and not a meaningful structure. Thus this value should not be used after the end of the iterator. A break

[PATCH 1/3] drivers/gpu/drm/gma500/mdfld_intel_display.c: remove invalid reference to list iterator variable

2012-07-09 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr If list_for_each_entry, etc complete a traversal of the list, the iterator variable ends up pointing to an address at an offset from the list head, and not a meaningful structure. Thus this value should not be used after the end of the iterator. A break

[PATCH 3/3] drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c: remove invalid reference to list iterator variable

2012-07-09 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr If list_for_each_entry, etc complete a traversal of the list, the iterator variable ends up pointing to an address at an offset from the list head, and not a meaningful structure. Thus this value should not be used after the end of the iterator. After

Re: question about drivers/gpu/drm/gma500/oaktrail_lvds.c

2012-07-09 Thread Julia Lawall
On Mon, 9 Jul 2012, Patrik Jakobsson wrote: On Sun, Jul 8, 2012 at 10:16 PM, Alan Cox a...@lxorguk.ukuu.org.uk wrote: On Sun, 8 Jul 2012 10:39:43 +0200 (CEST) Julia Lawall julia.law...@lip6.fr wrote: In the function oaktrail_lvds_mode_set, I don't think that the following code makes any

question about drivers/gpu/drm/i915/dvo_ch7xxx.c

2012-10-06 Thread Julia Lawall
Hello, I am looking at introducing some macros for i2c_msg initialization, and Ryan Mallon suggested that sometimes it could be useful to at the same time replace explicit lengths with the size of the associated buffer. But in some cases the sizes are not the same. An example is as follows,

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

2012-11-04 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

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

2013-02-25 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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/) // smpl @s exists@ local idexpression y; expression x,e; @@ *if ( \(x == NULL\|IS_ERR(x)\|y != 0

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

2013-03-28 Thread Julia Lawall
On Thu, 28 Mar 2013, Jesse Barnes wrote: On Thu, 28 Mar 2013 05:04:26 -0700 Luis R. Rodriguez mcg...@do-not-panic.com wrote: The new commit by Jesse that extended the fb_info with a skip_vt_switch element is the simplest example of a data structure expansion. We'd backport this by adding

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

2013-03-31 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-31 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

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

2013-03-31 Thread Julia Lawall
I looked in today's linux-next, and there seems to be only one initialization of this field, to true, and one test of this field. So perhaps the case for setting the field to false just isn't needed. Oh sorry now I get what you mean! I thought about this -- and yes I decided to not add

[PATCH 0/29] simplify use of devm_ioremap_resource

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

[PATCH 22/29] host1x/{dev.c, drm/hdmi.c}: simplify use of devm_ioremap_resource

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

[PATCH v2] drm/amd/dc: dm_types: fix semicolon.cocci warnings

2017-02-13 Thread Julia Lawall
Remove unneeded semicolons. Generated by: scripts/coccinelle/misc/semicolon.cocci CC: Harry Wentland <harry.wentl...@amd.com> Signed-off-by: Julia Lawall <julia.law...@lip6.fr> Signed-off-by: Fengguang Wu <fengguang...@intel.com> --- v2: make subject line u

[PATCH v2] drm/amd/dc: resource: fix semicolon.cocci warnings (fwd)

2017-02-13 Thread Julia Lawall
Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci CC: Harry Wentland <harry.wentl...@amd.com> Signed-off-by: Julia Lawall <julia.law...@lip6.fr> Signed-off-by: Fengguang Wu <fengguang...@intel.com> --- v2: make subject line u

[PATCH] drm/amd/dc: fix semicolon.cocci warnings

2017-02-13 Thread Julia Lawall
Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci CC: Harry Wentland <harry.wentl...@amd.com> Signed-off-by: Julia Lawall <julia.law...@lip6.fr> Signed-off-by: Fengguang Wu <fengguang...@intel.com> --- tree: git://people.freedesktop.org/~a

[PATCH] drm/amd/dc: hw_sequencer: fix semicolon.cocci warnings

2017-02-13 Thread Julia Lawall
Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci CC: Harry Wentland <harry.wentl...@amd.com> Signed-off-by: Julia Lawall <julia.law...@lip6.fr> Signed-off-by: Fengguang Wu <fengguang...@intel.com> --- tree: git://people.freedesktop.org/~a

[PATCH] drm/amd/dc: fix semicolon.cocci warnings

2017-02-13 Thread Julia Lawall
Remove unneeded semicolons. Generated by: scripts/coccinelle/misc/semicolon.cocci CC: Harry Wentland <harry.wentl...@amd.com> Signed-off-by: Julia Lawall <julia.law...@lip6.fr> Signed-off-by: Fengguang Wu <fengguang...@intel.com> --- tree: git://people.freedesktop.org/~a

[PATCH 15/15] drm/omap: improve function-level documentation

2016-10-01 Thread Julia Lawall
Use the names of the corresponding functions. Issue detected using Coccinelle (http://coccinelle.lip6.fr/) Signed-off-by: Julia Lawall --- drivers/gpu/drm/omapdrm/omap_drv.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b

[PATCH 00/15] improve function-level documentation

2016-10-01 Thread Julia Lawall
These patches fix cases where the documentation above a function definition is not consistent with the function header. Issues are detected using the semantic patch below (http://coccinelle.lip6.fr/). Basically, the semantic patch parses a file to find comments, then matches each function

[PATCH 05/15] dma-buf/sw_sync: improve function-level documentation

2016-10-01 Thread Julia Lawall
Adjust the documentation to use the names that appear in the function parameter list. Issue detected using Coccinelle (http://coccinelle.lip6.fr/) Signed-off-by: Julia Lawall --- drivers/dma-buf/sw_sync.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/dma

[PATCH 09/15] gma500: improve function-level documentation

2016-10-01 Thread Julia Lawall
Delete a reference to a variable that has never been used by the function in the first case, and rename a variable to that of the corresponding parameter name in the second case. Issue detected using Coccinelle (http://coccinelle.lip6.fr/) Signed-off-by: Julia Lawall --- drivers/gpu/drm

[PATCH 00/15] improve function-level documentation

2016-10-01 Thread Julia Lawall
On Sat, 1 Oct 2016, Joe Perches wrote: > On Sat, 2016-10-01 at 21:46 +0200, Julia Lawall wrote: > > These patches fix cases where the documentation above a function definition > > is not consistent with the function header. Issues are detected using the > > seman

[PATCH 00/15] improve function-level documentation

2016-10-05 Thread Julia Lawall
parameters etc. But the set of patches is not exhaustive with respect to the remaining interesting ones either. julia > > Jani, can you pls digg out these patches? Can't find them right now ... > -Daniel > > > On Sat, Oct 1, 2016 at 9:46 PM, Julia Lawall wrote: > > These pa

kernel-doc-rst-lint (was: Re: [PATCH 00/15] improve function-level documentation)

2016-10-05 Thread Julia Lawall
On Wed, 5 Oct 2016, Jani Nikula wrote: > On Wed, 05 Oct 2016, Daniel Vetter wrote: > > Jani Nikula has a patch with a scrip to make the one kernel-doc parser > > into a lint/checker pass over the entire kernel. I think that'd would > > be more robust instead of trying to approximate the real

[PATCH] drm/tegra: dpaux: Modify error handling

2016-08-13 Thread Julia Lawall
On Sat, 13 Aug 2016, Amitoj Kaur Chawla wrote: > devm_pinctrl_register returns an ERR_PTR in case of error and should > have an IS_ERR check instead of a null check. > > The Coccinelle semantic patch used to make this change is as follows: > @@ > expression e; > @@ > > e =

[radeon-alex:drm-next-4.10-wip 26/45] drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c:1613:24-48: duplicated argument to & or |

2016-11-09 Thread Julia Lawall
The constants on lines 1613 and 1615 are the same. julia On Wed, 9 Nov 2016, kbuild test robot wrote: > > tree: git://people.freedesktop.org/~agd5f/linux.git drm-next-4.10-wip > head: a5178d59d93d8b04fed1de3602cd448de9f1f995 > commit: 94f2d9bf6f3c0c192bc864ba1530d0f40afe9984 [26/45]

[PATCH] drm/rockchip: return ERR_PTR instead of NULL

2016-11-10 Thread Julia Lawall
-by: Julia Lawall --- drivers/gpu/drm/rockchip/rockchip_drm_fb.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c index 0f6eda0..01e11bf 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c

[PATCH] drm/sun4i: constify component_ops structures

2016-11-12 Thread Julia Lawall
5274228 855101586 sun4i_backend.o 6401228 8663719ed sun4i_tcon.o 3708360 84076 fec sun4i_tv.o 1676100 01776 6f0 sun6i_drc.o Signed-off-by: Julia Lawall --- drivers/gpu/drm/sun4i

[PATCH] drm/nouveau/gr/gk20a: delete unneeded second newline

2016-06-19 Thread Julia Lawall
Signed-off-by: Julia Lawall --- drivers/gpu/drm/nouveau/nvkm/engine/gr/gk20a.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gk20a.c index 4ca8ed1..de8b806 100644 --- a/drivers/gpu/drm/nouveau/nvkm

[PATCH] drm/i915: fix itnull.cocci warnings (fwd)

2016-01-18 Thread Julia Lawall
List_for_each entry binds its first argument to an offset from the list pointer, so this should not be NULL. Generated by: scripts/coccinelle/iterators/itnull.cocci Signed-off-by: Fengguang Wu --- Please take the patch only if it's a positive warning. Thanks! intel_display.c |2 +- 1

[Intel-gfx] [PATCH] drm/i915: fix itnull.cocci warnings (fwd)

2016-01-18 Thread Julia Lawall
On Mon, 18 Jan 2016, Daniel Vetter wrote: > On Mon, Jan 18, 2016 at 04:49:06PM +0100, Julia Lawall wrote: > > List_for_each entry binds its first argument to an offset from the list > > pointer, so this should not be NULL. > > > > Generated by: scripts/coccin

[PATCH] drm/amd/powerplay: fix compare_const_fl.cocci warnings

2016-01-05 Thread Julia Lawall
X != NULL, or even !X is more normmal in the kernel. Generated by: scripts/coccinelle/misc/compare_const_fl.cocci CC: Jammy Zhou Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- smumgr.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/gpu/drm/amd

[PATCH 11/16] drm/msm/dp: fix error return code

2015-04-05 Thread Julia Lawall
hen != *if(...) { ... when != ret = e2 when forall return ret; } // Signed-off-by: Julia Lawall --- drivers/gpu/drm/msm/edp/edp_ctrl.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/edp/edp_ctrl.c b/drivers/gpu/drm/msm/edp/edp_ctrl.c index 0ec5

[PATCH 0/16] fix error return code

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

[PATCH 0/5] fix error return code

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

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

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

[PATCH 4/5] drm/rcar-du: fix error return code

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

[PATCH 5/5] drivers/gpu/drm: fix error return code

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

[PATCH 0/8] fix error return code

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

[PATCH 4/8] drm: fix error return code

2014-12-29 Thread Julia Lawall
hen != *if(...) { ... when != ret = e2 when forall return ret; } // Signed-off-by: Julia Lawall --- drivers/gpu/drm/gma500/psb_drv.c |8 ++-- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c |1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/gma

[PATCH 0/9] use c99 initializers in structures

2014-08-23 Thread Julia Lawall
These patches add labels in the initializations of structure fields (c99 initializers). The complete semantic patch thta makes this change is shown below. This rule ignores cases where the initialization is just 0 or NULL, where some of the fields already use labels, and where there are nested

[PATCH 6/9] drm: use c99 initializers in structures

2014-08-23 Thread Julia Lawall
From: Julia Lawall <julia.law...@lip6.fr> Use c99 initializers for structures. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @decl@ identifier i1,fld; type T; field list[n] fs; @@ struct i1 { fs T fld; ...};

[PATCH 6/9 v2] drm: use c99 initializers in structures

2014-08-23 Thread Julia Lawall
From: Julia Lawall <julia.law...@lip6.fr> Use c99 initializers for structures. Drop 0 initializers in drivers/gpu/drm/sti/sti_vtac.c. A 0x0 initializer is left in vtac_mode_aux in drivers/gpu/drm/sti/sti_vtac.c to highlight the relation to vtac_mode_main. A simplified version of the se

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

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

[PATCH 7/20] drm/i915: fix misspelling of current function in string

2014-12-07 Thread Julia Lawall
Replace a misspelled function name by %s and then __func__. This was done using Coccinelle, including the use of Levenshtein distance, as proposed by Rasmus Villemoes. Signed-off-by: Julia Lawall --- The semantic patch is difficult to summarize, but is available in the cover letter

[PATCH 17/20] drm/i2c: tda998x: fix misspelling of current function in string

2014-12-07 Thread Julia Lawall
Replace a misspelled function name by %s and then __func__. This was done using Coccinelle, including the use of Levenshtein distance, as proposed by Rasmus Villemoes. Signed-off-by: Julia Lawall --- The semantic patch is difficult to summarize, but is available in the cover letter

[PATCH 20/20] drm/radeon: fix misspelling of current function in string

2014-12-07 Thread Julia Lawall
Replace a misspelled function name by %s and then __func__. This was done using Coccinelle, including the use of Levenshtein distance, as proposed by Rasmus Villemoes. Signed-off-by: Julia Lawall --- The semantic patch is difficult to summarize, but is available in the cover letter

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

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

[PATCH 20/20] drm/radeon: fix misspelling of current function in string

2014-12-08 Thread Julia Lawall
On Mon, 8 Dec 2014, Alex Deucher wrote: > On Sun, Dec 7, 2014 at 2:21 PM, Julia Lawall wrote: > > Replace a misspelled function name by %s and then __func__. > > > > This was done using Coccinelle, including the use of Levenshtein distance, > > as proposed by Rasmus Vi

[PATCH 00/11] fix error return code

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

[PATCH 07/11] drm: fix error return code

2015-08-23 Thread Julia Lawall
hen != *if(...) { ... when != ret = e2 when forall return ret; } // Signed-off-by: Julia Lawall --- drivers/gpu/drm/gma500/psb_drv.c |8 ++-- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c |1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/gma

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

2015-08-23 Thread Julia Lawall
hen != *if(...) { ... when != ret = e2 when forall return ret; } // Signed-off-by: Julia Lawall --- drivers/gpu/drm/exynos/exynos_drm_mic.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c index 8994eab..ddf0

[PATCH] drivers/gpu/drm/radeon/radeon_cs.c: eliminate possible double free

2012-03-17 Thread Julia Lawall
From: Julia Lawall <julia.law...@lip6.fr> The function radeon_cs_parser_init is only called from two places, in drivers/gpu/drm/radeon/radeon_cs.c and drivers/gpu/drm/radeon/r600_cs.c. In each case, if the call fails another function is called that frees all of the kdata and dpage infor

[PATCH] drivers/gpu/drm/savage/savage_state.c: add missing kfree

2012-03-17 Thread Julia Lawall
From: Julia Lawall <julia.law...@lip6.fr> Most of the error handling code in this function frees the buffers kcmd_addr, kvb_addr, and kbox_addr allocated at the beginning of this function. These two branches are changed to do the same. Signed-off-by: Julia Lawall --- drivers/gpu/drm/

[PATCH] drivers/gpu/drm/exynos: use devm_ functions

2012-03-25 Thread Julia Lawall
From: Julia Lawall <julia.law...@lip6.fr> The various devm_ functions allocate memory that is released when a driver detaches. This patch uses devm_kzalloc, devm_request_irq, etc. for data that is allocated in the probe function of a platform device and is only freed in the remove fu

[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/) // @@ expression list es; @@ -printk( +WARN_

question about drivers/gpu/drm/i915/dvo_ch7xxx.c

2012-10-06 Thread Julia Lawall
Hello, I am looking at introducing some macros for i2c_msg initialization, and Ryan Mallon suggested that sometimes it could be useful to at the same time replace explicit lengths with the size of the associated buffer. But in some cases the sizes are not the same. An example is as follows,

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

2013-03-28 Thread Julia Lawall
On Thu, 28 Mar 2013, Jesse Barnes wrote: > On Thu, 28 Mar 2013 05:04:26 -0700 > "Luis R. Rodriguez" wrote: > > > The new commit by Jesse that extended the fb_info with a skip_vt_switch > > element is the simplest example of a data structure expansion. We'd backport > > this by adding a static

[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 wrote: > > On Thu, 28 Mar 2013, Jesse Barnes wrote: > >> > - info->skip_vt_switch = true; > >> > + fb_enable_skip_vt_switch(info); > &g

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

2013-03-29 Thread Julia Lawall
On Thu, 28 Mar 2013, Luis R. Rodriguez wrote: > On Thu, Mar 28, 2013 at 11:10 AM, Julia Lawall > 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 patc

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

2013-03-29 Thread Julia Lawall
> > I looked in today's linux-next, and there seems to be only one > > initialization of this field, to true, and one test of this field. So > > perhaps the case for setting the field to false just isn't needed. > > Oh sorry now I get what you mean! I thought about this -- and yes I > decided to

[PATCH 22/29] host1x/{dev.c, drm/hdmi.c}: simplify use of devm_ioremap_resource

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

[PATCH 0/29] simplify use of devm_ioremap_resource

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

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

2013-02-24 Thread Julia Lawall
From: Julia Lawall <julia.law...@lip6.fr> 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)\|

[PATCH] drm/i915: constify intel_dvo_dev_ops structures

2015-12-08 Thread Julia Lawall
The intel_dvo_dev_ops structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall --- drivers/gpu/drm/i915/dvo.h| 12 ++-- drivers/gpu/drm/i915/dvo_ch7017.c |2 +- drivers/gpu/drm/i915/dvo_ch7xxx.c |2

[PATCH] ttm/drm: constify ttm_backend_func structures

2015-12-11 Thread Julia Lawall
The ttm_backend_func structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c |2 +- drivers/gpu/drm/ast/ast_ttm.c |2 +- drivers/gpu/drm/bochs/bochs_mm.c|2

[PATCH v2] coccinelle: api: check for propagation of error from platform_get_irq

2015-12-26 Thread Julia Lawall
The error return value of platform_get_irq seems to often get dropped. Signed-off-by: Julia Lawall --- v2: Check for the direct return case also. Added some mailing lists of common offenders. diff --git a/scripts/coccinelle/api/platform_get_irq_return.cocci b/scripts/coccinelle/api

[PATCH v2] coccinelle: api: check for propagation of error from platform_get_irq

2015-12-26 Thread Julia Lawall
On Sun, 27 Dec 2015, Sergei Shtylyov wrote: > On 12/26/2015 11:58 PM, Julia Lawall wrote: > > > The error return value of platform_get_irq seems to often get dropped. > > > > Signed-off-by: Julia Lawall > > > > --- > > > > v2: Check for the di

[PATCH v2] coccinelle: api: check for propagation of error from platform_get_irq

2015-12-27 Thread Julia Lawall
>Well, looking again, the patch should be good. I just thought its goal was > to fix the code as well... I could do that for the irq < 0 case, but I think that in that case, kbuild will only run the patch version, and the <= cases will not be reported on. I don't have a general fix for the <=

[Cocci] [PATCH v2] coccinelle: api: check for propagation of error from platform_get_irq

2015-12-27 Thread Julia Lawall
On Sun, 27 Dec 2015, SF Markus Elfring wrote: > > The error return value of platform_get_irq seems to often get dropped. > > How do you think about any more fine-tuning here? > > Commit message: > * … of the platform_get_irq() function seems to get dropped too often. > > * Why do you

[PATCH] drm/dp/mst: constify drm_dp_mst_topology_cbs structures

2015-12-30 Thread Julia Lawall
The drm_dp_mst_topology_cbs structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall --- drivers/gpu/drm/i915/intel_dp_mst.c|2 +- drivers/gpu/drm/radeon/radeon_dp_mst.c |2 +- include/drm/drm_dp_mst_helper.h

[PATCH] drm/nouveau/disp,pm: constify nvkm_object_func structures

2015-10-11 Thread Julia Lawall
These nvkm_object_func structures are never modified. All other nvkm_object_func structures are declared as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall --- drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv04.c |2 +- drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c

[PATCH 0/9] add missing of_node_put

2015-10-24 Thread Julia Lawall
The various for_each device_node iterators performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. The complete semantic patch that fixes this problem is (http://coccinelle.lip6.fr): // @r@ local idexpression n; expression e1,e2; iterator name

[PATCH 5/9] drm/tegra: dc: add missing of_node_put

2015-10-24 Thread Julia Lawall
; @@ for_each_matching_node(n,...) { ... ( of_node_put(n); | e = n | + of_node_put(n); ? break; ) ... } ... when != n // Signed-off-by: Julia Lawall --- drivers/gpu/drm/tegra/dc.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra

[PATCH 7/9] gpu: host1x: add missing of_node_put

2015-10-24 Thread Julia Lawall
; @@ for_each_child_of_node(root, child) { ... when != of_node_put(child) when != e = child ( return child; | + of_node_put(child); ? return ...; ) ... } // Signed-off-by: Julia Lawall --- drivers/gpu/host1x/bus.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH 32/39] drm: i915: drop null test before destroy functions

2015-09-13 Thread Julia Lawall
Remove unneeded NULL test. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; @@ -if (x != NULL) \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x); // Signed-off-by: Julia Lawall --- drivers/gpu/drm/i915/i915_dma.c | 19

[PATCH 00/39] drop null test before destroy functions

2015-09-13 Thread Julia Lawall
Recent commits to kernel/git/torvalds/linux.git have made the following functions able to tolerate NULL arguments: kmem_cache_destroy (commit 3942d29918522) mempool_destroy (commit 4e3ca3e033d1) dma_pool_destroy (commit 44d7175da6ea) These patches remove the associated NULL tests for the files

[Intel-gfx] [PATCH 2/3] drm/sysfs: Grab lock for edid/modes_show

2015-09-29 Thread Julia Lawall
Maybe line 294 should become an unlock and should be moved under 295? julia On Tue, 29 Sep 2015, kbuild test robot wrote: > CC: kbuild-all at 01.org > In-Reply-To: <1443513993-5228-2-git-send-email-daniel.vetter at ffwll.ch> > TO: Daniel Vetter > CC: DRI Development > CC: Daniel Vetter ,

[PATCH 07/10] drm/virtio: Drop dummy gamma table support

2016-04-12 Thread Julia Lawall
On Tue, 12 Apr 2016, Emil Velikov wrote: > On 30 March 2016 at 10:51, Daniel Vetter wrote: > > No need to confuse userspace like this. > > > > Cc: Gerd Hoffmann > > Cc: Dave Airlie > > Signed-off-by: Daniel Vetter > > --- > > drivers/gpu/drm/virtio/virtgpu_display.c | 9 - > > 1

[PATCH] drm/amdgpu: fix compare_const_fl.cocci warnings

2016-04-15 Thread Julia Lawall
Move constants to the right of binary operators. Generated by: scripts/coccinelle/misc/compare_const_fl.cocci Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- Could be nice to put the thing being tested first. amdgpu_grph_object_id_helpers.c |4 ++-- 1 file changed, 2

[PATCH] drm/amdgpu: fix compare_const_fl.cocci warnings

2016-04-15 Thread Julia Lawall
On Fri, 15 Apr 2016, Christian König wrote: > Am 15.04.2016 um 09:15 schrieb Julia Lawall: > > Move constants to the right of binary operators. > > > > Generated by: scripts/coccinelle/misc/compare_const_fl.cocci > > > > Signed-off-by: Fengguang Wu

[PATCH] drm/vmwgfx: constify fence_ops structure

2015-11-15 Thread Julia Lawall
The fence_ops structures are never modified, so declare this one as const, as is already done for the others. Done with the help of Coccinelle. Signed-off-by: Julia Lawall --- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH] drm/radeon: constify radeon_asic_ring structures

2015-11-29 Thread Julia Lawall
The radeon_asic_ring structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall --- drivers/gpu/drm/radeon/radeon.h |2 - drivers/gpu/drm/radeon/radeon_asic.c | 38 +-- 2 files changed, 20

[PATCH] drm/sysfs: Grab lock for edid/modes_show

2015-10-02 Thread Julia Lawall
On Fri, 2 Oct 2015, Daniel Vetter wrote: > We chase pointers/lists without taking the locks protecting them, > which isn't that good. > > Fix it. > > v2: Actually unlock properly, spotted by Julia. The unlock is still on top of the unlock label? julia > > Cc: Ju

question about drivers/gpu/drm/drm_ioc32.c

2012-01-28 Thread Julia Lawall
In the function compat_drm_getclient, I have the impression that the structure c32 is copied to user level with the field idx uninitialized? julia

question about drivers/gpu/drm/drm_ioc32.c

2012-01-30 Thread Julia Lawall
On Mon, 30 Jan 2012, Dave Airlie wrote: > On Sat, Jan 28, 2012 at 7:28 PM, Julia Lawall wrote: >> In the function compat_drm_getclient, I have the impression that the >> structure c32 is copied to user level with the field idx uninitialized? > > Looks like it alright, >

  1   2   3   4   >