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

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

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

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

[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 inl

[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); > >>

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

[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 for_each_node

[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 a

[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 th

[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 concen

[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 11/16] drm/msm/dp: fix error return code

2015-04-05 Thread Julia Lawall
amp;ret *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.

[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 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\)) { ... return ret; } | ret = 0 ) ... w

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

2014-11-23 Thread Julia Lawall
From: Julia Lawall 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; } | ret = 0 ) ... when != ret =

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

2014-11-23 Thread Julia Lawall
From: Julia Lawall 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; } | ret = 0 ) ... when !=

Re: [PATCH] drm/panthor: Fix access to uninitialized variable in tick_ctx_cleanup()

2024-09-30 Thread Julia Lawall
ing to some random place above the list_head at the start of the list in the last element of the array? julia > > Fixes: d72f049087d4 ("drm/panthor: Allow driver compilation") > Reported-by: kernel test robot > Reported-by: Julia Lawall > Closes: https://lore.kernel.or

[PATCH 20/35] drivers/gpu/drm: Reorganize kerneldoc parameter names

2024-09-30 Thread Julia Lawall
Reorganize kerneldoc parameter names to match the parameter order in the function header. Problems identified using Coccinelle. Signed-off-by: Julia Lawall --- drivers/gpu/drm/drm_gem_framebuffer_helper.c |3 +-- drivers/gpu/drm/drm_gpuvm.c |2 +- 2 files changed, 2

[PATCH 25/35] drm/amd/display: Reorganize kerneldoc parameter names

2024-09-30 Thread Julia Lawall
Reorganize kerneldoc parameter names to match the parameter order in the function header. Problems identified using Coccinelle. Signed-off-by: Julia Lawall --- drivers/gpu/drm/amd/display/dc/core/dc.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd

[PATCH 00/35] Reorganize kerneldoc parameter names

2024-09-30 Thread Julia Lawall
Reorganize kerneldoc parameter names to match the parameter order in the function header. The misordered cases were identified using the following Coccinelle semantic patch: // @initialize:ocaml@ @@ let parse_doc l = let pieces = List.map String.trim (String.split_on_char '*' l) in let l =

[PATCH 29/35] drivers/gpu/drm: Reorganize kerneldoc parameter names

2024-09-30 Thread Julia Lawall
Reorganize kerneldoc parameter names to match the parameter order in the function header. Problems identified using Coccinelle. Signed-off-by: Julia Lawall --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c |2 +- drivers/gpu/drm/radeon/radeon_ib.c |2 +- 2 files changed, 2 insertions

Re: [PATCH 29/35] drivers/gpu/drm: Reorganize kerneldoc parameter names

2024-09-30 Thread Julia Lawall
On Mon, 30 Sep 2024, Christian König wrote: > Am 30.09.24 um 13:21 schrieb Julia Lawall: > > Reorganize kerneldoc parameter names to match the parameter > > order in the function header. > > Please split that up by driver, apart from that looks good to me. Thanks for the f

Re: [PATCH v2 05/21] powerpc/papr_scm: Convert timeouts to secs_to_jiffies()

2024-11-16 Thread Julia Lawall
Sent from my iPhone > On 16 Nov 2024, at 05:40, Dan Carpenter wrote: > > On Sat, Nov 16, 2024 at 11:06:55AM +0100, Christophe Leroy wrote: >>> diff --git a/arch/powerpc/platforms/pseries/papr_scm.c >>> b/arch/powerpc/platforms/pseries/papr_scm.c >>> index >>> 9e297f88adc5d97d4dc7b267b0bfebd

Re: [PATCH v3 02/19] coccinelle: misc: Add secs_to_jiffies script

2024-12-17 Thread Julia Lawall
On Tue, 17 Dec 2024, Alexander Gordeev wrote: > On Tue, Dec 10, 2024 at 10:02:33PM +, Easwar Hariharan wrote: > > Hi Easwar, > > > This script finds and suggests conversions of timeout patterns that > > result in seconds-denominated timeouts to use the new secs_to_jiffies() > > API in inclu

<    1   2   3   4