[PATCH 6/7] sound: Use BUG_ON

2008-02-17 Thread Julia Lawall
From: Julia Lawall [EMAIL PROTECTED] if (...) BUG(); should be replaced with BUG_ON(...) when the test has no side-effects to allow a definition of BUG_ON that drops the code completely. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // smpl

[PATCH 7/7] net/9p/trans_virtio.c: Use BUG_ON

2008-02-17 Thread Julia Lawall
From: Julia Lawall [EMAIL PROTECTED] if (...) BUG(); should be replaced with BUG_ON(...) when the test has no side-effects to allow a definition of BUG_ON that drops the code completely. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // smpl

[PATCH 1/7] fs/affs/file.c: Use BUG_ON

2008-02-17 Thread Julia Lawall
From: Julia Lawall [EMAIL PROTECTED] if (...) BUG(); should be replaced with BUG_ON(...) when the test has no side-effects to allow a definition of BUG_ON that drops the code completely. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // smpl

[PATCH 3/7] fs/ocfs2: Use BUG_ON

2008-02-17 Thread Julia Lawall
From: Julia Lawall [EMAIL PROTECTED] if (...) BUG(); should be replaced with BUG_ON(...) when the test has no side-effects to allow a definition of BUG_ON that drops the code completely. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // smpl

[PATCH 2/7] fs/ext{2,3,4}: Use BUG_ON

2008-02-17 Thread Julia Lawall
From: Julia Lawall [EMAIL PROTECTED] if (...) BUG(); should be replaced with BUG_ON(...) when the test has no side-effects to allow a definition of BUG_ON that drops the code completely. fs/ext2/balloc.c |3 +-- fs/ext2/dir.c|3 +-- fs/ext3/balloc.c |3 +-- fs/ext4/balloc.c

[PATCH 4/7] fs/udf/truncate.c: Use BUG_ON

2008-02-17 Thread Julia Lawall
From: Julia Lawall [EMAIL PROTECTED] if (...) BUG(); should be replaced with BUG_ON(...) when the test has no side-effects to allow a definition of BUG_ON that drops the code completely. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // smpl

[PATCH 0/7] remove invalid reference to list iterator variable

2012-07-08 Thread 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. The complete semantic match that finds this

[PATCH 3/7] mm/slub.c: 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. The patch

[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

[PATCH 5/7] drivers/iommu/tegra-smmu.c: 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. Replace c

[PATCH 6/7] drivers/net/ethernet/broadcom/cnic.c: 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

[PATCH 7/7] drivers/s390/scsi/zfcp_cfdc.c: 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. Replace

[PATCH 2/7] net/rxrpc/ar-peer.c: 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

[PATCH 1/7] drivers/isdn/mISDN/stack.c: 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

[PATCH] fs/ubifs/orphan.c: 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. Replace

[PATCH] remove invalid reference to list iterator variable

2012-07-08 Thread 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. The complete semantic match that finds this

[PATCH] Use list_for_each_entry instead of list_for_each in sound/oss drivers.

2007-11-02 Thread Julia Lawall
From: Julia Lawall [EMAIL PROTECTED] Combine list_for_each and list_entry into list_for_each_entry. An excerpt of the semantic patch implementing these changes is as follows: @ra@ type T,T1; identifier I, x; expression E, E1, E2; iterator list_for_each_entry; @@ ... when != _Y(I

[PATCH] arch/ppc: Remove an unnecessary pci_dev_put.

2007-11-03 Thread Julia Lawall
From: Julia Lawall [EMAIL PROTECTED] Remove an unnecessary pci_dev_put. pci_dev_put is called implicitly by the subsequent call to pci_get_device. The problem was detected using the following semantic patch, and corrected by hand. @@ expression dev; expression E; @@ - pci_dev_put(dev

[PATCH] drivers/misc: Move misplaced pci_dev_put's.

2007-11-03 Thread Julia Lawall
From: Julia Lawall [EMAIL PROTECTED] Move pci_dev_put outside the loops in which it occurs. Within the loop, pci_dev_put is done implicitly by pci_get_device. The problem was detected using the following semantic patch, and corrected by hand. @@ expression dev; expression E; @@ - pci_dev_put

Re: [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 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-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. A break

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

[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 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] fs/ubifs/orphan.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. Replace

[PATCH] scripts/coccinelle/iterators/use_after_iter.cocci: list iterator variable semantic patch

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

[PATCH] drivers/mtd/devices/spear_smi.c: failure test for null rather than negative integer

2012-07-11 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr dev_get_platdata returns a pointer, so the failure value would be NULL rather than a negative integer. The semantic match that finds this problem is: (http://coccinelle.lip6.fr/) // smpl @@ expression x,e; statement S1,S2; @@ *x = dev_get_platdata

[PATCH] drivers/iommu/intel-iommu.c: add missing free_domain_mem

2012-07-24 Thread Julia Lawall
From: Julia Lawall ju...@diku.dk Add missing free_domain_mem on failure path after alloc_domain. 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; identifier f

[PATCH v2] drivers/iommu/intel-iommu.c: add missing free_domain_mem

2012-07-24 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Add missing free_domain_mem on failure path after alloc_domain. 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

[PATCH 1/2] drivers/staging/media/easycap/easycap_main.c: add missing usb_free_urb

2012-07-24 Thread Julia Lawall
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

[PATCH 2/2] drivers/mmc/host/vub300.c: add missing usb_free_urb

2012-07-24 Thread Julia Lawall
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

Re: coccinelle hung on mini_lock.cocci

2012-07-25 Thread Julia Lawall
with the lock held, or where there is some preceding /// function call that releases the lock. /// // Confidence: Moderate // Copyright: (C) 2010-2012 Nicolas Palix. GPLv2. // Copyright: (C) 2010-2012 Julia Lawall, INRIA/LIP6. GPLv2. // Copyright: (C) 2010-2012 Gilles Muller, INRIA/LiP6. GPLv2

Re: [Cocci] coccinelle hung on mini_lock.cocci

2012-07-25 Thread Julia Lawall
/// function call that releases the lock. /// // Confidence: Moderate // Copyright: (C) 2010-2012 Nicolas Palix. GPLv2. // Copyright: (C) 2010-2012 Julia Lawall, INRIA/LIP6. GPLv2. // Copyright: (C) 2010-2012 Gilles Muller, INRIA/LiP6. GPLv2. // URL: http://coccinelle.lip6.fr/ // Comments

Re: [Cocci] coccinelle hung on mini_lock.cocci

2012-07-25 Thread Julia Lawall
On Wed, 25 Jul 2012, Fengguang Wu wrote: Hi Julia, On Wed, Jul 25, 2012 at 04:15:19PM +0200, Julia Lawall wrote: Do you use a timeout when you run Coccinelle You could put the argument --timeout 120. Good to know that! I'll definitely try it. Are you using the existing framework within

Re: [Cocci] coccinelle hung on mini_lock.cocci

2012-07-25 Thread Julia Lawall
I looked at it a bit more, and I think the timeout is the best solution. The big jump backwards is under an if, and the pattern tries to match an if up to a return, which tries to go across gotos. So I think it is just a pathologically bad case. julia -- To unsubscribe from this list: send the

[PATCH] drivers/nfc/nfcwilink.c: use devm_kzalloc

2012-12-06 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr devm_kzalloc allocates memory that is released when a driver detaches. This patch uses devm_kzalloc 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 Lawall julia.law

[PATCH 1/2] drivers/w1/masters/mxc_w1.c: use devm_ functions

2012-12-06 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 these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. At the same time

[PATCH 2/2] drivers/w1/masters/ds1wm.c: use devm_ functions

2012-12-06 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 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

[PATCH] drivers/pps/clients/pps-gpio.c: use devm_kzalloc

2012-12-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr devm_kzalloc allocates memory that is released when a driver detaches. This patch uses devm_kzalloc 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 Lawall julia.law

[PATCH] drivers/thermal/spear_thermal.c: use devm_clk_get

2012-12-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr devm_clk_get allocates a resource that is released when a driver detaches. This patch uses devm_clk_get for data that is allocated in the probe function of a platform device and is only released in the remove function. Signed-off-by: Julia Lawall julia.law

[PATCH] drivers/video/wm8505fb.c: use devm_ functions

2012-12-08 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 these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. The patch makes some other

question about drivers/pinctrl/pinctrl-at91.c

2012-12-08 Thread Julia Lawall
The function at91_dt_node_to_map in drivers/pinctrl/pinctrl-at91.c contains the following code: new_map = devm_kzalloc(pctldev-dev, sizeof(*new_map) * map_num, GFP_KERNEL); if (!new_map) return -ENOMEM; *map = new_map; *num_maps = map_num;

[PATCH] drivers/power/88pm860x_battery.c: use devm_request_threaded_irq

2012-12-08 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr devm_request_threaded_irq requests and irq that is freed when a driver detaches. This patch uses devm_request_threaded_irq for irqs that are requested in the probe function of a platform device and are only freed in the remove function. Additionally

question about drivers/power/88pm860x_charger.c

2012-12-08 Thread Julia Lawall
The function pm860x_charger_probe in the file drivers/power/88pm860x_charger.c contains the following code: count = pdev-num_resources; for (i = 0, j = 0; i count; i++) { info-irq[j] = platform_get_irq(pdev, i); if (info-irq[j] 0)

[PATCH 3/3] sound/soc/soc-core.c: drop kfree of devm_kzalloc's data

2012-12-08 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Using kfree to free data allocated with devm_kzalloc causes double frees. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // smpl @@ expression x; @@ x = devm_kzalloc(...) ... ?-kfree(x); // /smpl Signed-off

Re: [PATCH] drivers/video/wm8505fb.c: use devm_ functions

2012-12-08 Thread Julia Lawall
Rather than the goto, add the fail path code in directly, and return. ret = register_framebuffer(fbi-fb); if (ret 0) { dev_err(pdev-dev, Failed to register framebuffer device: %d\n, ret); if (fbi-fb.cmap.len) fb_dealloc_cmap(fbi-fb.cmap); return ret; } So there is no need for the

[PATCH] drivers/video/wm8505fb.c: use devm_ functions

2012-12-09 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 these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. The patch makes some other

[PATCH] drivers/video/vt8500lcdfb.c: use devm_ functions

2012-12-09 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 these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. The patch makes some other

Re: [PATCH 3/3] sound/soc/soc-core.c: drop kfree of devm_kzalloc's data

2012-12-09 Thread Julia Lawall
On Mon, 10 Dec 2012, Mark Brown wrote: On Sat, Dec 08, 2012 at 07:01:20PM +0100, Julia Lawall wrote: The kfrees were introduced in b761c0ca. I sent this a few months ago, and I still think it should be applied... I'm missing patches 1 and 2? Sorry, I just resent the patch as is. 1 and 2

Re: question about drivers/pinctrl/pinctrl-at91.c

2012-12-11 Thread Julia Lawall
On Tue, 11 Dec 2012, Linus Walleij wrote: On Sat, Dec 8, 2012 at 4:52 PM, Julia Lawall julia.law...@lip6.fr wrote: The function at91_dt_node_to_map in drivers/pinctrl/pinctrl-at91.c contains the following code: new_map = devm_kzalloc(pctldev-dev, sizeof(*new_map) * map_num

[PATCH] drivers/pinctrl/pinctrl-at91.c: convert kfree to devm_kfree

2012-12-11 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The function at91_dt_node_to_map is ultimately called by the function pinctrl_get, which is an exported function. Since it is possible that this function is not called from within a probe function, for safety, the kfree is converted to a devm_kfree

Re: question about drivers/pinctrl/pinctrl-at91.c

2012-12-11 Thread Julia Lawall
On Tue, 11 Dec 2012, Linus Walleij wrote: On Tue, Dec 11, 2012 at 10:04 AM, Julia Lawall julia.law...@lip6.fr wrote: On Tue, 11 Dec 2012, Linus Walleij wrote: I was under the impression that if you exit the probe function with a negative value anything allocated with devm_* was freed

Re: [PATCH] drivers/pinctrl/pinctrl-at91.c: convert kfree to devm_kfree

2012-12-11 Thread Julia Lawall
On Tue, 11 Dec 2012, Sergei Shtylyov wrote: Hello. On 11-12-2012 14:58, Julia Lawall wrote: From: Julia Lawall julia.law...@lip6.fr The function at91_dt_node_to_map is ultimately called by the function pinctrl_get, which is an exported function. Since it is possible

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-12-18 Thread Julia Lawall
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

Re: [PATCH RESEND 6/6] clk: s5p-g2d: Fix incorrect usage of IS_ERR_OR_NULL

2013-01-01 Thread Julia Lawall
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

Re: [PATCH RESEND 6/6] clk: s5p-g2d: Fix incorrect usage of IS_ERR_OR_NULL

2013-01-02 Thread Julia Lawall
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,

Re: [PATCH RESEND 6/6] clk: s5p-g2d: Fix incorrect usage of IS_ERR_OR_NULL

2013-01-03 Thread Julia Lawall
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

[PATCH 1/2] drivers/i2c/busses/i2c-sh7760.c: use clk API instead of direct dereferences

2013-01-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr A struct clk value is intended to be an abstract pointer, so it should be manipulated using the various API functions. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // smpl @@ expression e,e1; identifier i; @@ *e

[PATCH 2/2] arch/mips/kernel/cpufreq/loongson2_cpufreq.c: use clk API instead of direct dereferences

2013-01-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr A struct clk value is intended to be an abstract pointer, so it should be manipulated using the various API functions. clk_put is additionally added on the failure paths. The semantic match that finds the first problem is as follows: (http

clk dereference in arch/sh/kernel/cpufreq.c

2013-01-03 Thread Julia Lawall
There has been a discussion recently about how the result of get_clk should be an opaque handle, not a value that can be dereferenced: https://lkml.org/lkml/2012/12/20/105 There is such a dereference in arch/sh/kernel/cpufreq.c, in the function sh_cpufreq_cpu_init: freq_table = cpuclk-nr_freqs

clk dereference in drivers/net/ethernet/ti/cpts.c

2013-01-03 Thread Julia Lawall
There has been a discussion recently about how the result of get_clk should be an opaque handle, not a value that can be dereferenced: https://lkml.org/lkml/2012/12/20/105 There is such a dereference in drivers/net/ethernet/ti/cpts.c, in the function cpts_clk_init: cpts-freq =

Re: [PATCH] drivers/pinctrl/pinctrl-at91.c: convert kfree to devm_kfree

2012-12-12 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The function at91_dt_node_to_map is ultimately called by the function pinctrl_get, which is an exported function. Since it is possible that this function is not called from within a probe function, for safety, the kfree is converted to a devm_kfree

Re: [PATCH 1/2] drivers/w1/masters/mxc_w1.c: use devm_ functions

2012-12-13 Thread Julia Lawall
On Thu, 13 Dec 2012, Dan Carpenter wrote: On Wed, Dec 12, 2012 at 01:25:56AM +0400, Evgeniy Polyakov wrote: I suppose mdev will be automatically freed, but who will release mdev-clk and other private members of mdev structure? + mdev-clk = devm_clk_get(pdev-dev, NULL); -clk is now a

Re: [PATCH 1/2] drivers/w1/masters/mxc_w1.c: use devm_ functions

2012-12-13 Thread Julia Lawall
On Thu, 13 Dec 2012, Dan Carpenter wrote: On Thu, Dec 13, 2012 at 11:18:53AM +0100, Julia Lawall wrote: On Thu, 13 Dec 2012, Dan Carpenter wrote: On Wed, Dec 12, 2012 at 01:25:56AM +0400, Evgeniy Polyakov wrote: I suppose mdev will be automatically freed, but who will release mdev

Re: [PATCH] drivers/power/88pm860x_battery.c: use devm_request_threaded_irq

2013-01-06 Thread Julia Lawall
On Sat, 5 Jan 2013, Anton Vorontsov wrote: On Sat, Dec 08, 2012 at 06:16:35PM +0100, Julia Lawall wrote: From: Julia Lawall julia.law...@lip6.fr devm_request_threaded_irq requests and irq that is freed when a driver detaches. This patch uses devm_request_threaded_irq for irqs

[PATCH] drivers/power/88pm860x_battery.c: eliminate possible references to released resources

2013-01-06 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr devm_kzalloc should not be followed by kfree, as this results in a double free. The problem was found using the following semantic match (http://coccinelle.lip6.fr/): // smpl @@ expression x,e; @@ x = devm_kzalloc(...) ... when != x = e ?-kfree(x

question about drivers/i2c/busses/i2c-davinci.c

2013-01-06 Thread Julia Lawall
The function davinci_i2c_remove in drivers/i2c/busses/i2c-davinci.c contains the following code: put_device(pdev-dev); clk_disable_unprepare(dev-clk); clk_put(dev-clk); dev-clk = NULL; davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, 0);

Re: [PATCH] drivers/power/88pm860x_battery.c: eliminate possible references to released resources

2013-01-06 Thread Julia Lawall
On Mon, 7 Jan 2013, Dan Carpenter wrote: On Sun, Jan 06, 2013 at 01:16:50PM -0800, Anton Vorontsov wrote: The patch is whitespace-damaged (for some reason there are two spaces in the beginning of each non-change line). I repeated changes manually, but you might want to fix your mail/patch

Re: [PATCH] drivers/power/88pm860x_battery.c: eliminate possible references to released resources

2013-01-07 Thread Julia Lawall
On Sun, 6 Jan 2013, Anton Vorontsov wrote: On Mon, Jan 07, 2013 at 09:42:23AM +0300, Dan Carpenter wrote: On Sun, Jan 06, 2013 at 01:16:50PM -0800, Anton Vorontsov wrote: The patch is whitespace-damaged (for some reason there are two spaces in the beginning of each non-change line). I

[PATCH 2/2] drivers/crypto/bfin_crc.c: reposition free_irq to avoid access to invalid data

2013-01-07 Thread Julia Lawall
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 bfin_crypto_crc_handler. It may refer to crc-regs, which is released by the iounmap. Furthermore, the second argument to all calls to free_irq

[PATCH 0/2] reposition free_irq to avoid access to invalid data

2013-01-07 Thread Julia Lawall
The data referenced by an interrupt handler should not be freed before the interrupt is ended. The semantic match that finds this problem is as follows (http://coccinelle.lip6.fr/). The basic idea behind this semantic match is to find cases where the order of the call to free_irq is different

[PATCH 1/2] drivers/media/platform/soc_camera/pxa_camera.c: reposition free_irq to avoid access to invalid data

2013-01-07 Thread Julia Lawall
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

Re: [PATCH 1/2] drivers/media/platform/soc_camera/pxa_camera.c: reposition free_irq to avoid access to invalid data

2013-01-07 Thread Julia Lawall
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

[PATCH] drivers/media/platform/soc_camera/pxa_camera.c: use devm_ functions

2013-01-07 Thread Julia Lawall
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

Re: [PATCH 1/2] drivers/media/platform/soc_camera/pxa_camera.c: reposition free_irq to avoid access to invalid data

2013-01-07 Thread Julia Lawall
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()

Re: [PATCH 1/3] spi: Add helper functions for setting up transfers

2013-01-10 Thread Julia Lawall
+@r1@ +identifier fn; +identifier xfers; +@@ +fn(...) +{ + ... +( + struct spi_transfer xfers[...]; +| + struct spi_transfer xfers[]; +) + ... +} Can it happen that there would be more than one spi_transfer or spi_message variable per function? This semantic patch

Re: clk dereference in arch/sh/kernel/cpufreq.c

2013-01-10 Thread Julia Lawall
On Thu, 10 Jan 2013, Paul Mundt wrote: On Thu, Jan 03, 2013 at 10:40:20AM +0100, Julia Lawall wrote: There has been a discussion recently about how the result of get_clk should be an opaque handle, not a value that can be dereferenced: https://lkml.org/lkml/2012/12/20/105

Re: [PATCH 1/3] spi: Add helper functions for setting up transfers

2013-01-10 Thread Julia Lawall
On Thu, 10 Jan 2013, Lars-Peter Clausen wrote: On 01/10/2013 09:53 AM, Julia Lawall wrote: +@r1@ +identifier fn; +identifier xfers; +@@ +fn(...) +{ + ... +( + struct spi_transfer xfers[...]; +| + struct spi_transfer xfers[]; +) + ... +} Can it happen

[PATCH] adjust code alignment

2013-08-05 Thread Julia Lawall
These patches result from the following semantic patch (http://coccinelle.lip6.fr/), which checks for successive statements that are not aligned. @bad@ statement S; expression e; position p1,p; @@ S@p1 e@p; @script:ocaml@ p1 bad.p1; p bad.p; @@ if not ((List.hd p1).line = (List.hd p).line)

[PATCH] fs/nfs/inode.c: adjust code alignment

2013-08-05 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Signed-off-by: Julia Lawall julia.law...@lip6.fr --- This patch adjusts the code so that the alignment matches the current semantics. I have no idea if it is the intended semantics, though. Should the call to nfs_setsecurity also be under the else? fs

[PATCH] net/vmw_vsock/af_vsock.c: drop unneeded semicolon

2013-08-05 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Drop the semicolon at the end of the list_for_each_entry loop header. Signed-off-by: Julia Lawall julia.law...@lip6.fr --- Not tested, but I can't imagine how the current code could work, since vsk should end up pointing to a dummy value. net/vmw_vsock

[PATCH] drivers/scsi/lpfc/lpfc_init.c: adjust code alignment

2013-08-05 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Adjust code alignment so that each statement is lined up with its neighbor. In the second case, it could be desirable to put the call to lpfc_destroy_vport_work_array under the if. The call, is, however, safe in case vports is NULL, so the patch just

Re: [PATCH] trivial: adjust code alignment

2013-08-05 Thread Julia Lawall
On Mon, 5 Aug 2013, Dan Carpenter wrote: On Mon, Aug 05, 2013 at 04:47:39PM +0200, Julia Lawall wrote: diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c index e8a1ce2..4a5a5dc 100644 --- a/drivers/media/i2c/ov7670.c +++ b/drivers/media/i2c/ov7670.c @@ -1369,8 +1369,8

Re: [PATCH] trivial: adjust code alignment

2013-08-05 Thread Julia Lawall
On Mon, 5 Aug 2013, walter harms wrote: Hello Julia, IMHO keep the patch as it is. It does not change any code that is good. Suspicious code that comes up here can be addressed in a separate patch. OK, thanks! julia -- To unsubscribe from this list: send the line unsubscribe linux-kernel in

[PATCH 1/2] spi: simplify devm_request_mem_region/devm_ioremap

2013-08-24 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Convert the composition of devm_request_mem_region and devm_ioremap to a single call to devm_ioremap_resource. The associated call to platform_get_resource is also simplified and moved next to the new call to devm_ioremap_resource. This was done using

[PATCH 0/2] simplify devm_request_mem_region/devm_ioremap

2013-08-24 Thread Julia Lawall
Convert the composition of devm_request_mem_region and devm_ioremap to a single call to devm_ioremap_resource. The associated call to platform_get_resource is also simplified and moved next to the new call to devm_ioremap_resource. The semantic patch used to perform this transformation is as

[PATCH 2/2] rtc: simplify devm_request_mem_region/devm_ioremap

2013-08-24 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Convert the composition of devm_request_mem_region and devm_ioremap to a single call to devm_ioremap_resource. The associated call to platform_get_resource is also simplified and moved next to the new call to devm_ioremap_resource. This was done using

[PATCH 0/6] simplify platform_get_resource_byname/devm_ioremap_resource

2013-08-19 Thread Julia Lawall
devm_ioremap_resource often uses the result of a call to platform_get_resource_byname as its last argument. devm_ioremap_resource does appropriate error handling on this argument, so error handling can be removed from the call to platform_get_resource_byname. The semantic patch that makes this

[PATCH 4/6] usb: musb: dsps: simplify platform_get_resource_byname/devm_ioremap_resource

2013-08-19 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Remove unneeded error handling on the result of a call to platform_get_resource_byname when the value is passed to devm_ioremap_resource. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl

[PATCH 3/6] mtd: fsmc_nand: simplify platform_get_resource_byname/devm_ioremap_resource

2013-08-19 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Remove unneeded error handling on the result of a call to platform_get_resource_byname when the value is passed to devm_ioremap_resource. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl

[PATCH 5/6] regulator: ti-abb: simplify platform_get_resource_byname/devm_ioremap_resource

2013-08-19 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Remove unneeded error handling on the result of a call to platform_get_resource_byname when the value is passed to devm_ioremap_resource. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl

[PATCH 6/6] MIPS: ath79: simplify platform_get_resource_byname/devm_ioremap_resource

2013-08-19 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Remove unneeded error handling on the result of a call to platform_get_resource_byname when the value is passed to devm_ioremap_resource. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl

[PATCH 2/6] watchdog: simplify platform_get_resource_byname/devm_ioremap_resource

2013-08-19 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Remove unneeded error handling on the result of a call to platform_get_resource_byname when the value is passed to devm_ioremap_resource. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl

[PATCH 1/6] ASoC: omap: simplify platform_get_resource_byname/devm_ioremap_resource

2013-08-19 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Remove unneeded error handling on the result of a call to platform_get_resource_byname when the value is passed to devm_ioremap_resource. In the case of omap-dmic.c, the error-handling code of devm_ioremap_resource is also corrected to include releasing

Re: [PATCH 5/6] regulator: ti-abb: simplify platform_get_resource_byname/devm_ioremap_resource

2013-08-19 Thread Julia Lawall
On Mon, 19 Aug 2013, walter harms wrote: Am 19.08.2013 10:51, schrieb Julia Lawall: From: Julia Lawall julia.law...@lip6.fr Remove unneeded error handling on the result of a call to platform_get_resource_byname when the value is passed to devm_ioremap_resource. A simplified

Re: [PATCH 5/6] regulator: ti-abb: simplify platform_get_resource_byname/devm_ioremap_resource

2013-08-19 Thread Julia Lawall
On Mon, 19 Aug 2013, walter harms wrote: Am 19.08.2013 10:51, schrieb Julia Lawall: From: Julia Lawall julia.law...@lip6.fr Remove unneeded error handling on the result of a call to platform_get_resource_byname when the value is passed to devm_ioremap_resource. A simplified

Re: [PATCH 5/6] regulator: ti-abb: simplify platform_get_resource_byname/devm_ioremap_resource

2013-08-19 Thread Julia Lawall
The function affected by this patch also calls devm_ioremap_nocache twice, with no form of request_mem_region. I wonder if these calls should also use devm_ioremap_resource? julia On Mon, 19 Aug 2013, walter harms wrote: Am 19.08.2013 10:51, schrieb Julia Lawall: From: Julia Lawall

Re: [PATCH 5/6] regulator: ti-abb: simplify platform_get_resource_byname/devm_ioremap_resource

2013-08-19 Thread Julia Lawall
On Mon, 19 Aug 2013, walter harms wrote: Am 19.08.2013 12:12, schrieb Julia Lawall: On Mon, 19 Aug 2013, walter harms wrote: Am 19.08.2013 10:51, schrieb Julia Lawall: From: Julia Lawall julia.law...@lip6.fr Remove unneeded error handling on the result of a call

[PATCH 5/7] bcm63xx_enet: replace devm_request_and_ioremap by devm_ioremap_resource

2013-08-19 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Use devm_ioremap_resource instead of devm_request_and_ioremap. This was done using the semantic patch scripts/coccinelle/api/devm_ioremap_resource.cocci The relevant call to platform_get_resource was manually moved down to the call

[PATCH 0/7] replace devm_request_and_ioremap by devm_ioremap_resource

2013-08-19 Thread Julia Lawall
devm_request_and_ioremap has been replaced by devm_ioremap_resource, which gives more informative error return code information. This patch series removes the remaining uses of devm_request_and_ioremap. This patch series was generated using the semantic patch

[PATCH 6/7] video: xilinxfb: replace devm_request_and_ioremap by devm_ioremap_resource

2013-08-19 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Use devm_ioremap_resource instead of devm_request_and_ioremap. This was done using the semantic patch scripts/coccinelle/api/devm_ioremap_resource.cocci The initialization of drvdata-regs_phys was manually moved lower, to take advantage of the NULL test

<    1   2   3   4   5   6   7   8   9   10   >