Re: [Outreachy kernel] [RESEND PATCH] drm: Remove obsolete "This is gross" comment

2017-09-21 Thread Julia Lawall
On Thu, 21 Sep 2017, Haneen Mohammed wrote: > Remove obsolete comment which was initially added in 2008 to annotate > that idr_find() was used before idr_remove() since idr_remove() didn't > use to return feedback. The comment now is irrelevant with > commit f6cd7daecff5 ("drm: Release driver re

Re: [Outreachy kernel] [RESEND PATCH] drm: Remove obsolete "This is gross" comment

2017-09-21 Thread Julia Lawall
On Thu, 21 Sep 2017, Haneen Mohammed wrote: > On Thu, Sep 21, 2017 at 11:16:44PM +0200, Julia Lawall wrote: > > > > > > On Thu, 21 Sep 2017, Haneen Mohammed wrote: > > > > > Remove obsolete comment which was initially added in 2008 to annotate > > &g

Re: [Outreachy kernel] [PATCH] drm/tegra: Replace dev_* with DRM_DEV_*

2017-09-23 Thread Julia Lawall
On Sun, 24 Sep 2017, Harsha Sharma wrote: > Replace all occurences of dev_info/err/dbg with DRM_DEV_INFO/ > ERROR/DEBUG as we have DRM_DEV_* variants of drm print macros > Done using following coccinelle semantic patch Some calls after under comments. They could be dropped. Some calls appear

Re: [Outreachy kernel] [PATCH v2] drm/tegra: Replace dev_* with DRM_DEV_*

2017-09-24 Thread Julia Lawall
On Sun, 24 Sep 2017, Harsha Sharma wrote: > Replace all occurences of dev_info/err/dbg with DRM_DEV_INFO/ > ERROR/DEBUG as we have DRM_DEV_* variants of drm print macros > Done using following coccinelle semantic patch > > @r@ > @@ > > ( > -dev_info > +DRM_DEV_INFO > | > -dev_err > +DRM_DEV_ERRO

Re: [Outreachy kernel] [PATCH] drm/gem: use new idr deletion interface to cleanup drm_gem_handle_delete()

2017-09-26 Thread Julia Lawall
On Tue, 26 Sep 2017, Daniel Vetter wrote: > On Tue, Sep 26, 2017 at 12:17:28AM +0530, Aishwarya Pant wrote: > > The IDR deletion interface now returns the deleted entry or NULL if it was > > not > > present. So we don't have to do the extra work of checking if we have a > > reference on the drm

Re: [Outreachy kernel] [PATCH] drm/gem: use new idr deletion interface to cleanup drm_gem_handle_delete()

2017-09-26 Thread Julia Lawall
On Tue, 26 Sep 2017, Daniel Vetter wrote: > On Tue, Sep 26, 2017 at 10:47 AM, Daniel Vetter wrote: > > On Tue, Sep 26, 2017 at 10:38 AM, Julia Lawall wrote: > >> > >> > >> On Tue, 26 Sep 2017, Daniel Vetter wrote: > >> > >>> On Tu

[radeon-alex:drm-next-4.15-dc 148/1063] drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/rv_hwmgr.c:845:49-50: asic_setup: first occurrence line 848, second occurrence line 875

2017-09-26 Thread Julia Lawall
There are two initializations of .asic_setup in this structure. julia -- Forwarded message -- Date: Wed, 27 Sep 2017 10:16:08 +0800 From: kbuild test robot To: kbu...@01.org Cc: Julia Lawall Subject: [radeon-alex:drm-next-4.15-dc 148/1063] drivers/gpu/drm/amd/amdgpu

Re: [PATCH] drm/gem: use new idr deletion interface to cleanup drm_gem_handle_delete() (fwd)

2017-09-27 Thread Julia Lawall
Unlock missing on failure of the new call to idr_remove. julia -- Forwarded message -- Date: Wed, 27 Sep 2017 15:14:54 +0800 From: kbuild test robot To: kbu...@01.org Cc: Julia Lawall Subject: Re: [PATCH] drm/gem: use new idr deletion interface to cleanup

[PATCH] fix drm-get-put.cocci warnings

2018-01-15 Thread Julia Lawall
From: Fengguang Wu Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference() and drm_*_unreference() helpers. Generated by: scripts/coccinelle/api/drm-get-put.cocci Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- tree: https://github.com/thierryreding/linux for-4.16

Re: [Nouveau] [PATCH] fix drm-get-put.cocci warnings

2018-01-15 Thread Julia Lawall
On Mon, 15 Jan 2018, Thierry Reding wrote: > On Mon, Jan 15, 2018 at 01:47:07PM +0100, Julia Lawall wrote: > > From: Fengguang Wu > > > > Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference() and > > drm_*_unreference() helpers. > > > > G

[PATCH] drm: vc4: fix semicolon.cocci warnings

2018-01-20 Thread Julia Lawall
From: Fengguang Wu Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci CC: Laurent Pinchart Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- hdmi_connector.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/msm/hdmi

[PATCH] drm: vc4: fix device_node_continue.cocci warnings

2018-01-20 Thread Julia Lawall
moval") Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- url: https://github.com/0day-ci/linux/commits/Laurent-Pinchart/Cargo-cult-cleanup-in-atomic-drivers/20180120-183018 base: git://people.freedesktop.org/~airlied/linux.git drm-next :: branch date: 3 hours ago :: comm

[PATCH] drm: vc4: fix semicolon.cocci warnings

2018-01-20 Thread Julia Lawall
From: Fengguang Wu Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci CC: Laurent Pinchart Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- url: https://github.com/0day-ci/linux/commits/Laurent-Pinchart/Cargo-cult-cleanup-in-atomic-drivers/20180120

[PATCH] drm: vc4: fix another semicolon.cocci warning

2018-01-20 Thread Julia Lawall
From: Fengguang Wu Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci CC: Laurent Pinchart Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- url: https://github.com/0day-ci/linux/commits/Laurent-Pinchart/Cargo-cult-cleanup-in-atomic-drivers/20180120

[PATCH v2] drm: zte: fix device_node_continue.cocci warnings

2018-01-21 Thread Julia Lawall
moval") Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- v2: correct driver name in subject line url: https://github.com/0day-ci/linux/commits/Laurent-Pinchart/Cargo-cult-cleanup-in-atomic-drivers/20180120-183018 base: git://people.freedesktop.org/~airlied/linux.git drm-next :::

[PATCH v2] drm/msm/hdmi: fix semicolon.cocci warnings

2018-01-21 Thread Julia Lawall
From: Fengguang Wu Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci CC: Laurent Pinchart Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- v2: Fix driver name in subject line url: https://github.com/0day-ci/linux/commits/Laurent-Pinchart/Cargo

[PATCH] drm/msm/mdp5: fix semicolon.cocci warning

2018-01-21 Thread Julia Lawall
From: Fengguang Wu Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- v2: Fix driver name in subject line url: https://github.com/0day-ci/linux/commits/Laurent-Pinchart/Cargo-cult-cleanup-in-atomic

[PATCH] drm/radeon: adjust tested variable

2018-01-27 Thread Julia Lawall
,...); | y = g(...); *if (e) S3 else S4 ) // Signed-off-by: Julia Lawall --- drivers/gpu/drm/radeon/radeon_uvd.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c b/drivers/gpu/drm/radeon/radeon_uvd.c index d34d1cf..95f4db7 100644 --- a/d

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Julia Lawall
On Tue, 6 Feb 2018, Dan Carpenter wrote: > On Mon, Feb 05, 2018 at 09:09:57PM +0100, Wolfram Sang wrote: > > In one Renesas driver, I found a typo which turned an intended bit shift > > ('<<') > > into a comparison ('<'). Because this is a subtle issue, I looked tree wide > > for > > similar p

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Julia Lawall
On Tue, 6 Feb 2018, Dan Carpenter wrote: > On Tue, Feb 06, 2018 at 02:15:51PM +0100, Julia Lawall wrote: > > > > > > On Tue, 6 Feb 2018, Dan Carpenter wrote: > > > > > On Mon, Feb 05, 2018 at 09:09:57PM +0100, Wolfram Sang wrote: > > > > In on

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Julia Lawall
On Tue, 6 Feb 2018, Wolfram Sang wrote: > Hi Julia, > > > and got the results below. I can make a version for the kernel shortly. > > It should probably take care of right-shifting, too? I did that too but got no results. Perhaps right shifting constants is pretty uncommon. I can put that in

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Julia Lawall
On Tue, 6 Feb 2018, Dan Carpenter wrote: > That found 4 that I think Wolfram's grep missed. > > arch/um/drivers/vector_user.h |2 -- > drivers/gpu/drm/mxsfb/mxsfb_regs.h|2 -- > drivers/video/fbdev/mxsfb.c |2 -- > include/drm/drm_scdc_helper.h

[PATCH] drm/omap: omap_display_timings: constify videomode structures

2017-08-03 Thread Julia Lawall
The videomode structures are only copied into the vm field of a panel_drv_data structure, so they can be const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall --- drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c |2 +- drivers/gpu/drm/omapdrm/displays/panel-tpo

Re: omapfb/dss: Delete an error message for a failed memory allocation in three functions

2017-11-28 Thread Julia Lawall
On Tue, 28 Nov 2017, SF Markus Elfring wrote: > >> It seems that I got no responses so far for clarification requests > >> according to the documentation in a direction I hoped for. > > > > That's because you are pretty unresponsive to direction. > > From which places did you get this impression

Re: omapfb/dss: Delete an error message for a failed memory allocation in three functions

2017-11-28 Thread Julia Lawall
On Tue, 28 Nov 2017, SF Markus Elfring wrote: > It seems that I got no responses so far for clarification requests > according to the documentation in a direction I hoped for. > >>> > >>> That's because you are pretty unresponsive to direction. > >> > >> From which places did you get t

Re: omapfb/dss: Delete an error message for a failed memory allocation in three functions

2017-11-28 Thread Julia Lawall
On Tue, 28 Nov 2017, SF Markus Elfring wrote: > > How many times have I told you to include the reason for > > your patches in your proposed commit message? > > It might be useful to look again. > > > > Too often. > > I answered this feedback to some degree. > > > > Many people do not know that

[PATCH] drm/nouveau/mmu: fix odd_ptr_err.cocci warnings (fwd)

2017-11-28 Thread Julia Lawall
This is a false positive, but I wonder if it is really necessary to put the assignment in the conditional test expression. julia -- Forwarded message -- Date: Tue, 28 Nov 2017 13:23:36 +0800 From: kbuild test robot To: kbu...@01.org Cc: Julia Lawall Subject: [PATCH] drm/nouveau

Re: [Nouveau] [PATCH] drm/nouveau/mmu: fix odd_ptr_err.cocci warnings (fwd)

2017-11-28 Thread Julia Lawall
no, it isn't necessary. Will someone take care of it? I'm just the 0-day proxy :) julia > On Tue, Nov 28, 2017 at 1:56 PM, Julia Lawall wrote: > > This is a false positive, but I wonder if it is really necessary to put > > the assignment in the conditional test

Re: [-next PATCH 2/4] treewide: Use DEVICE_ATTR_RW

2017-12-20 Thread Julia Lawall
On Wed, 20 Dec 2017, Joe Perches wrote: > On Wed, 2017-12-20 at 10:59 +0100, Greg Kroah-Hartman wrote: > > > > Why you didn't send that patch to the sysfs maintainer is a bit odd... > > > > :) > > > > > > So here's an opportunity for you: > > > > > > The sysfs maintainer hasn't added include/l

[PATCH 00/12] drop unneeded newline

2017-12-27 Thread Julia Lawall
Drop newline at the end of a message string when the printing function adds a newline. The complete semantic patch that detects this issue is as shown below (http://coccinelle.lip6.fr/). It works in two phases - the first phase counts how many uses of a function involve a newline and how many don

[PATCH 11/12] drm/amd/powerplay: drop unneeded newline

2017-12-27 Thread Julia Lawall
PP_ASSERT_WITH_CODE prints a newline at the end of the message string, so the message string does not need to include a newline explicitly. Done using Coccinelle. Signed-off-by: Julia Lawall --- I couldn't figure out how to configure the kernel to get any of this code to compile. driver

Re: [PATCH 11/12] drm/amd/powerplay: drop unneeded newline

2017-12-27 Thread Julia Lawall
On Wed, 27 Dec 2017, Michel Dänzer wrote: > On 2017-12-27 03:51 PM, Julia Lawall wrote: > > PP_ASSERT_WITH_CODE prints a newline at the end of the message string, > > so the message string does not need to include a newline explicitly. > > Done using Coccinelle. > &g

Re: [Cluster-devel] [PATCH 00/12] drop unneeded newline

2018-01-02 Thread Julia Lawall
On Tue, 2 Jan 2018, Bob Peterson wrote: > - Original Message - > | Drop newline at the end of a message string when the printing function adds > | a newline. > > Hi Julia, > > NACK. > > As much as it's a pain when searching the source code for output strings, > this patch set goes agains

Re: [Cluster-devel] [PATCH 00/12] drop unneeded newline

2018-01-02 Thread Julia Lawall
On Tue, 2 Jan 2018, Bob Peterson wrote: > - Original Message - > | - Original Message - > | | Drop newline at the end of a message string when the printing function > adds > | | a newline. > | > | Hi Julia, > | > | NACK. > | > | As much as it's a pain when searching the source c

Re: [Cluster-devel] [PATCH 00/12] drop unneeded newline

2018-01-02 Thread Julia Lawall
On Tue, 2 Jan 2018, Bart Van Assche wrote: > On Tue, 2018-01-02 at 15:00 +0100, Julia Lawall wrote: > > On Tue, 2 Jan 2018, Bob Peterson wrote: > > > - Original Message - > > > > - Original Message - > > > > > > > Still, the G

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, i

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

question about drivers/gpu/drm/drm_ioc32.c

2012-01-29 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 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/

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 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 a patch? What

[PATCH] drivers/gpu/drm/drm_ioc32.c: initialize all fields

2012-01-30 Thread Julia Lawall
From: Julia Lawall The c32 structure is allocated on the stack and its idx field is not initialized before copying it to user level. This patch takes the value from the result of the ioctl, as done for the other fields. Signed-off-by: Julia Lawall --- An alternative would be to change the

[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 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 in the chunks array. So

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

2012-03-18 Thread Julia Lawall
From: Julia Lawall 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/savage/savage_state.c |5

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

2012-03-25 Thread Julia Lawall
From: Julia Lawall 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. This patch changes the

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 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. In the first two cases, a a

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 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 */ list_for_each_entry

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

[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 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 is added after the

[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 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 is added after the

[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 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 the iteractor, entry

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 wrote: On Sun, 8 Jul 2012 10:39:43 +0200 (CEST) Julia Lawall wrote: In the function oaktrail_lvds_mode_set, I don't think that the following code makes any sense: /* Find the connector

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

2013-02-25 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

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" 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

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

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 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 pa

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

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

2011-05-13 Thread Julia Lawall
ession E,E1,E2; 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);// Signed-off-by: Julia Lawall --- I have only verified that the list is not accessed by drm_map_handle by inspecting the cod

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

2011-05-16 Thread Julia Lawall
From: Julia Lawall 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/) // @r exists@ local idexpression struct page ** x

[PATCH 2/20] drivers/gpu/drm: Use kzalloc

2010-05-13 Thread Julia Lawall
From: Julia Lawall Use kzalloc rather than the combination of kmalloc and memset. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression x,size,flags; statement S; @@ -x = kmalloc(size,flags); +x = kzalloc(size,flags); if (x == NULL) S -memset

[PATCH 15/37] drivers/gpu/drm: Use kmemdup

2010-05-15 Thread Julia Lawall
From: Julia Lawall 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/) // @@ expression from,to,size,flag; statement S; @@ - to = \(kmalloc\|kzalloc

[PATCH 2/3] drivers/gpu/drm/i915: remove duplicate structure field initialization

2010-06-20 Thread Julia Lawall
From: Julia Lawall In each case, is_mobile is defined twice to 1. Drop one initialization. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r@ identifier I, s, fld; position p0,p; expression E; @@ struct I s =...@p0 { ... @p = E, ...}; @s

[PATCH 3/9] drivers/gpu/drm/i915: Drop unnecessary null test

2010-08-03 Thread Julia Lawall
From: Julia Lawall list_for_each_entry binds its first argument to a non-null value, and thus any null test on the value of that argument is superfluous. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ iterator I; expression x,E; @@ I(x

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

2010-08-05 Thread Julia Lawall
From: Julia Lawall Outdent the code following the if. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r disable braces4@ position p1,p2; statement S1,S2; @@ ( if (...) { ... } | if (...) s...@p1 s...@p2 ) @script:python@ p1 << r.p1; p2 &

[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;} // Signed-off-by: Julia Lawall --- 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, or whether there

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, >

[PATCH] drivers/gpu/drm/drm_ioc32.c: initialize all fields

2012-01-30 Thread Julia Lawall
From: Julia Lawall The c32 structure is allocated on the stack and its idx field is not initialized before copying it to user level. This patch takes the value from the result of the ioctl, as done for the other fields. Signed-off-by: Julia Lawall --- An alternative would be to change the

[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

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->crt

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

2012-07-08 Thread Julia Lawall
From: Julia Lawall 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. In the first two cases, a a

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

2012-07-08 Thread Julia Lawall
From: Julia Lawall 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 is added after the

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

2012-07-08 Thread Julia Lawall
On Sun, 8 Jul 2012, Alan Cox wrote: > On Sun, 8 Jul 2012 10:39:43 +0200 (CEST) > Julia Lawall wrote: > >> In the function oaktrail_lvds_mode_set, I don't think that the following >> code makes any sense: >> >> /* Fin

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

2012-07-08 Thread Julia Lawall
From: Julia Lawall 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 the iteractor, entry

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 wrote: >> On Sun, 8 Jul 2012 10:39:43 +0200 (CEST) >> Julia Lawall wrote: >> >>> In the function oaktrail_lvds_mode_set, I don't think that the following >>> co

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

2012-07-08 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 >> >> If list_for_each_entry, etc complete a traversal of the list, the iterator >> variable ends up pointing to a

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

2012-07-08 Thread Julia Lawall
From: Julia Lawall 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 is added after the

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

2011-05-13 Thread Julia Lawall
ession E,E1,E2; 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);// Signed-off-by: Julia Lawall --- I have only verified that the list is not accessed by drm_map_handle by inspecting the cod

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

2011-05-16 Thread Julia Lawall
From: Julia Lawall 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/) // @r exists@ local idexpression struct page ** x

[PATCH 2/3] drivers/gpu/drm/i915: remove duplicate structure field initialization

2010-06-20 Thread Julia Lawall
From: Julia Lawall In each case, is_mobile is defined twice to 1. Drop one initialization. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r@ identifier I, s, fld; position p0,p; expression E; @@ struct I s =@p0 { ... .fld at p = E, ...}; @s

[PATCH 2/20] drivers/gpu/drm: Use kzalloc

2010-05-13 Thread Julia Lawall
From: Julia Lawall Use kzalloc rather than the combination of kmalloc and memset. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression x,size,flags; statement S; @@ -x = kmalloc(size,flags); +x = kzalloc(size,flags); if (x == NULL) S -memset

[PATCH 15/37] drivers/gpu/drm: Use kmemdup

2010-05-15 Thread Julia Lawall
From: Julia Lawall 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/) // @@ expression from,to,size,flag; statement S; @@ - to = \(kmalloc\|kzalloc

[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;} // Signed-off-by: Julia Lawall --- 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, or whether there

[PATCH 3/9] drivers/gpu/drm/i915: Drop unnecessary null test

2010-08-03 Thread Julia Lawall
From: Julia Lawall list_for_each_entry binds its first argument to a non-null value, and thus any null test on the value of that argument is superfluous. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ iterator I; expression x,E; @@ I(x

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

2010-08-05 Thread Julia Lawall
From: Julia Lawall Outdent the code following the if. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r disable braces4@ position p1,p2; statement S1,S2; @@ ( if (...) { ... } | if (...) S1 at p1 S2 at p2 ) @script:python@ p1 << r.p1; p2 &

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

2012-03-17 Thread Julia Lawall
From: Julia Lawall 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 in the chunks array. So

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

2012-03-17 Thread Julia Lawall
From: Julia Lawall 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/savage/savage_state.c |5

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

2012-03-25 Thread Julia Lawall
From: Julia Lawall 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. This patch changes the

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

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

2014-08-23 Thread Julia Lawall
From: Julia Lawall 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; ...}; @bad@ identifier decl.i1,i2

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

2014-08-23 Thread Julia Lawall
From: Julia Lawall 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 semantic match that finds the

[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 of this

[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 of this

[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 of this

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

[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 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
amp;ret *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/

<    1   2   3   4   >