Re: [patch] staging: rtl8723au: incorrect use of ether_addr_copy()

2014-10-08 Thread Julia Lawall
On Wed, 8 Oct 2014, Dan Carpenter wrote: On Wed, Oct 08, 2014 at 05:26:11AM -0700, Joe Perches wrote: On Wed, 2014-10-08 at 13:40 +0300, Dan Carpenter wrote: The return from myid() isn't aligned correctly for ether_addr_copy(). Hey Dan. Actual evidence showing ether_addr_copy

Re: [PATCH resent] staging: rtl8188eu: Deletion of unnecessary checks before three function calls

2014-10-31 Thread Julia Lawall
On Fri, 31 Oct 2014, SF Markus Elfring wrote: The functions kfree(), rtw_free_netdev() and vfree() test whether their argument is NULL and then return immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus

Re: [PATCH resent] staging: rtl8188eu: Deletion of unnecessary checks before three function calls

2014-10-31 Thread Julia Lawall
On Fri, 31 Oct 2014, SF Markus Elfring wrote: The functions kfree(), rtw_free_netdev() and vfree() test whether their argument is NULL and then return immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by:

[PATCH 0/3] remove final uses of the GOTO macro

2014-11-09 Thread Julia Lawall
Remove final uses of the GOTO macro, and remove the associated macro and underlying function. drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h | 12 drivers/staging/lustre/lustre/libcfs/debug.c |8 drivers/staging/lustre/lustre/osc/osc_cache.c | 168

[PATCH 3/3] staging: lustre: libcfs: remove final uses of the GOTO macro

2014-11-09 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Remove the goto logging function, as it is no longer used. Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/staging/lustre/lustre/libcfs/debug.c |8 1 file changed, 8 deletions(-) diff --git a/drivers/staging/lustre/lustre

[PATCH 2/3] staging: lustre: libcfs_debug.h: remove final uses of the GOTO macro

2014-11-09 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Remove the GOTO macro, as it is no longer used. Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h | 12 1 file changed, 12 deletions(-) diff --git a/drivers/staging/lustre

[PATCH 1/3] staging: lustre: osc: remove final uses of the GOTO macro

2014-11-09 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ identifier lbl; identifier rc; constant c; @@ - GOTO(lbl,\(rc\|c\)); + goto lbl; @@ identifier lbl; expression rc; @@ - GOTO(lbl,rc); + rc; + goto lbl

Re: [PATCH v2 1/2] staging: rtl8188eu: Deletion of unnecessary checks before three function calls

2014-11-12 Thread Julia Lawall
This is especially true if you have trained yourself to know that free_netdev() can't accept NULL pointers. Do you need to adjust your concerns a bit over time when function variants provide a corresponding safety check in their implementations? There would not seem to be any _need_ to do

Re: [PATCH v2 2/2] staging: rtl8188eu: Better memory clean-up in efuse_phymap_to_logical()

2014-11-13 Thread Julia Lawall
diff --git a/drivers/staging/rtl8188eu/core/rtw_efuse.c b/drivers/staging/rtl8188eu/core/rtw_efuse.c index 697876b..359f169 100644 --- a/drivers/staging/rtl8188eu/core/rtw_efuse.c +++ b/drivers/staging/rtl8188eu/core/rtw_efuse.c [...] -exit: +cleanup2: + kfree(eFuseWord); +

Re: [PATCH v2 1/2] staging: rtl8188eu: Deletion of unnecessary checks before three function calls

2014-11-13 Thread Julia Lawall
On Wed, 12 Nov 2014, SF Markus Elfring wrote: From: Markus Elfring elfr...@users.sourceforge.net Date: Wed, 12 Nov 2014 20:25:49 +0100 The functions kfree(), rtw_free_netdev() and vfree() test whether their argument is NULL and then return immediately. Thus the test around the call is not

[PATCH 3/4] staging: unisys: remove unneeded structure

2014-11-30 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Delete a local structure that is only used to be initialized by memset. A semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ identifier x,i; @@ { ... when any -struct i x; +... when != x - memset(x

[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. // smpl // sudo apt-get install python-pip // sudo pip install python-Levenshtein //

[PATCH 11/20] vme: fix misspelling of current function in string

2014-12-07 Thread Julia Lawall
Replace a misspelled function name by %s and then __func__. This is the get function, not the set function, as was indicated by the string. This was done using Coccinelle, including the use of Levenshtein distance, as proposed by Rasmus Villemoes. Signed-off-by: Julia Lawall julia.law...@lip6

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

2014-12-07 Thread Julia Lawall
On Mon, 8 Dec 2014, Julian Calaby wrote: Hi Julia, On Mon, Dec 8, 2014 at 6:20 AM, Julia Lawall julia.law...@lip6.fr 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 function itself

[PATCH] staging:iio: correct error check

2014-01-01 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr iio_kfifo_allocate returns NULL in case of error. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // smpl @@ expression *x; identifier f; statement S1,S2; @@ *x = f(...); if (x) { +... when != if (...) S1 else S2

[PATCH 0/4] delete useless variable

2014-01-13 Thread Julia Lawall
These patches delete declarations and initializations of variables that are only assigned to constants but never used otherwise. The complete semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @r exists@ type T; identifier i,i2; position p; @@ T i@p; ...

[PATCH 4/4] staging: tidspbridge: delete useless variable

2014-01-13 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The variable status is initialized to either 0 or an error code. Return status to propagate the error value. A simplified version of the semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // smpl @@ type T; identifier i

[PATCH 4/4] staging: tidspbridge: adjust error return code (bugfix)

2014-01-13 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The variable status is initialized to either 0 or an error code. Return status to propagate the error value. A simplified version of the semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // smpl @@ type T; identifier i

[PATCH 2/3] staging: r8188eu: delete unnecessary field initialization

2014-02-14 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr On success, the function netdev_alloc_skb initializes the dev field of its result to its first argument, so this doesn't have to be done in the calling context. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // smpl

[PATCH 1/3] staging: r8712u: delete unnecessary field initialization

2014-02-14 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr On success, the function netdev_alloc_skb initializes the dev field of its result to its first argument, so this doesn't have to be done in the calling context. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // smpl

Re: [PATCH] Staging: bcm: PHSModule.c: Matching the function definition with function declaration

2013-09-17 Thread Julia Lawall
On Tue, 17 Sep 2013, Shalin Mehta wrote: From: Shalin Mehta shalinmeht...@gmail.com NOTE: Sending it again. I got mail delivery failure due to typo in emai ID gre...@linuxfoundation.org I think that such a comment should go below the ---, since it doesn't have to be preserved in git. julia

[PATCH 0/10] use safer test on the result of find_first_zero_bit

2014-06-04 Thread Julia Lawall
Find_first_zero_bit considers BITS_PER_LONG bits at a time, and thus may return a larger number than the maximum position argument if that position is not a multiple of BITS_PER_LONG. ___ devel mailing list de...@linuxdriverproject.org

[PATCH 4/10] staging: tidspbridge: use safer test on the result of find_first_zero_bit

2014-06-04 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Find_first_zero_bit considers BITS_PER_LONG bits at a time, and thus may return a larger number than the maximum position argument if that position is not a multiple of BITS_PER_LONG. The semantic match that finds this problem is as follows: (http

Re: [PATCH 0/10] use safer test on the result of find_first_zero_bit

2014-06-04 Thread Julia Lawall
On Wed, 4 Jun 2014, Geert Uytterhoeven wrote: Hi Julia, On Wed, Jun 4, 2014 at 11:07 AM, Julia Lawall julia.law...@lip6.fr wrote: Find_first_zero_bit considers BITS_PER_LONG bits at a time, and thus may return a larger number than the maximum position argument if that position

RE: [PATCH 0/10] use safer test on the result of find_first_zero_bit

2014-06-04 Thread Julia Lawall
On Wed, 4 Jun 2014, David Laight wrote: From: Julia Lawall On Wed, 4 Jun 2014, Geert Uytterhoeven wrote: Hi Julia, On Wed, Jun 4, 2014 at 11:07 AM, Julia Lawall julia.law...@lip6.fr wrote: Find_first_zero_bit considers BITS_PER_LONG bits at a time, and thus may return

Re: [PATCH 0/10] use safer test on the result of find_first_zero_bit

2014-06-04 Thread Julia Lawall
On Wed, 4 Jun 2014, Geert Uytterhoeven wrote: Hi Julia, On Wed, Jun 4, 2014 at 11:52 AM, Julia Lawall julia.law...@lip6.fr wrote: Maybe the documented return code should be changed to allow for the existing behaviour. Sorry, I'm not sure to understand what you suggest here. include

Re: [PATCH] staging: iio: adis16203: Use devm_iio_device_register

2014-07-17 Thread Julia Lawall
. Signed-off-by: Himangi Saraogi himangi...@gmail.com Acked-by: Julia Lawall julia.law...@lip6.fr No, you changed the relative order in which iio_device_unregister() and adis_cleanup_buffer_and_trigger() are called, this opens up the way for race conditions. Rule of thumb: Don't convert drivers

Re: [PATCH] staging:iio:ad7280a: Use managed interfaces

2014-07-19 Thread Julia Lawall
On Sat, 19 Jul 2014, Jonathan Cameron wrote: On 19/07/14 11:33, Himangi Saraogi wrote: This patch moves data allocated using unmanaged interfaces to managed interfaces like devm_kzalloc, devm_iio_device_register, devm_kasprintf, devm_request_threaded_irq and does away with the calls to

[PATCH 0/7] replace del_timer by del_timer_sync

2014-03-26 Thread Julia Lawall
These patches replace del_timer by del_timer_sync in module_exit functions. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[PATCH 3/7] staging: panel: replace del_timer by del_timer_sync

2014-03-26 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Use del_timer_sync to ensure that the timer is stopped on all CPUs before the driver exists. This change was suggested by Thomas Gleixner. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @r@ declarer name

[PATCH 10/13] staging: rtl8192e: make return of 0 explicit

2014-05-18 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Delete unnecessary use of a local variable to immediately return 0. A simplified version of the semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // smpl @r exists@ local idexpression ret; expression e; position p

[PATCH 7/13] staging: wlags49_h2: make return of 0 explicit

2014-05-18 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Delete unnecessary local variable whose value is always 0 and that hides the fact that the result is always 0. A simplified version of the semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // smpl @r exists@ local

[PATCH 0/13] make return of 0 explicit

2014-05-18 Thread Julia Lawall
Sometimes a local variable is used as a return value in a case where the return value is always 0. The result is more apparent if this variable is just replaced by 0. This is done by the following semantic patch, although some cleanups may be needed. (http://coccinelle.lip6.fr/) // smpl @r

[PATCH 0/9] use correct structure type name in sizeof

2014-07-29 Thread Julia Lawall
These patches fix typos in the name of a type referenced in a sizeof command. These problems are not caught by the compiler, because they have no impact on execution - the size of a pointer is independent of the size of the pointed value. The semantic patch that finds these problems is shown

[PATCH 1/9] drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c: use correct structure type name in sizeof

2014-07-29 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Correct typo in the name of the type given to sizeof. Because it is the size of a pointer that is wanted, the typo has no impact on compilation or execution. This problem was found using Coccinelle (http://coccinelle.lip6.fr/). The semantic patch used

Re: [PATCH] staging: iio: ad9832: Use devm_iio_device_register

2014-08-03 Thread Julia Lawall
Signed-off-by: Himangi Saraogi himangi...@gmail.com Acked-by: Julia Lawall julia.law...@lip6.fr --- drivers/staging/iio/frequency/ad9832.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/iio/frequency/ad9832.c b/drivers/staging/iio/frequency/ad9832.c

staging/rtl8192[eu]

2014-08-06 Thread Julia Lawall
Hello, Is anyone actually interested in the files: drivers/staging/rtl8192e/rtllib_softmac.c drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c Both contain the following code: if (param-u.wpa_ie.len MAX_WPA_IE_LEN || (param-u.wpa_ie.len param-u.wpa_ie.data == NULL))

[PATCH 9/14] imx-drm: imx-drm-core: delete unneeded test before of_node_put

2014-08-08 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Of_node_put supports NULL as its argument, so the initial test is not necessary. Suggested by Uwe Kleine-König. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // smpl @@ expression e; @@ -if (e) of_node_put(e

Re: [PATCH 10/12] staging: lustre: Fix misplaced opening brace warnings

2014-08-11 Thread Julia Lawall
to the overall goal of code style uniformity. Julia Lawall and Himangi Saraogi from coccinelle fame have created a detypedef script that is useful for structs, perhaps you could extend it for unions and run it over this lustre code. For instance: https://lkml.org/lkml/2014/8/9/104

[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 5/9] lustre: obdclass: 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/) // smpl @decl@ identifier i1,fld; type T; field list[n] fs; @@ struct i1 { fs T fld; ...}; @bad

[PATCH] staging: lustre: remove parentheses from return arguments

2014-08-26 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ identifier i; constant c; @@ return - ( \(i\|-i\|i(...)\|c\) - ) ; // /smpl Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/staging

[PATCH] staging: lustre: lmv: expand the GOTO macro

2014-08-27 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ identifier lbl; identifier rc; constant c; @@ - GOTO(lbl,\(rc\|c\)); + goto lbl; @@ identifier lbl; expression rc; @@ - GOTO(lbl,rc); + rc; + goto lbl

[PATCH] staging: lustre: mdc: expand the GOTO macro

2014-08-28 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ identifier lbl; identifier rc; constant c; @@ - GOTO(lbl,\(rc\|c\)); + goto lbl; @@ identifier lbl; expression rc; @@ - GOTO(lbl,rc); + rc; + goto lbl

Re: [PATCH] staging: lustre: mdc: expand the GOTO macro

2014-08-28 Thread Julia Lawall
On Thu, 28 Aug 2014, Dan Carpenter wrote: Thanks. These are nice. We need to get rid of the GOTO() macro entirely. I will. The whole patch is 11,000 lines (including the context code, @@s etc), and I didn't have the patience to check all of that at once... julia

[PATCH] staging: lustre: obdech: remove unused file

2014-08-28 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr This file contains unresolved references and is not mentioned in the Makefile. Signed-off-by: Julia Lawall julia.law...@lip6.fr --- This should be applied after the return-parenthesis patch. diff --git a/drivers/staging/lustre/lustre/obdecho/echo.c b

[PATCH] staging: lustre: mgc: remove unused file

2014-08-28 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr This file contains unresolved references and is not mentioned in the Makefile. Signed-off-by: Julia Lawall julia.law...@lip6.fr --- This should be applied after the return-parenthesis patch. diff --git a/drivers/staging/lustre/lustre/mgc/libmgc.c b

[PATCH] staging: lustre: llite: expand the GOTO macro

2014-08-30 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ identifier lbl; @@ if (...) GOTO(lbl,...); +else GOTO(lbl,...); @@ identifier lbl,rc; constant c; expression e,e1; @@ if ( - e + !e ) - GOTO(lbl

[PATCH] staging: lustre: fid,fld: expand the GOTO macro

2014-08-30 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ identifier lbl; identifier rc; constant c; @@ - GOTO(lbl,\(rc\|c\)); + goto lbl; @@ identifier lbl; expression rc; @@ - GOTO(lbl,rc); + rc; + goto lbl

[PATCH] staging: lustre: adjust spacing within pointer casts

2014-08-30 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ type T; expression e; @@ ( - T * + T * ) e // /smpl This semantic patch just removes the cast and adds it back, but when it does so, it follows the spacing

[PATCH 1/2] staging: lustre: ldlm: expand the GOTO macro

2014-09-01 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ identifier lbl; identifier rc; constant c; @@ - GOTO(lbl,\(rc\|c\)); + goto lbl; @@ identifier lbl; expression rc; @@ - GOTO(lbl,rc); + rc; + goto lbl

[PATCH 2/7] staging: lustre: libcfs: expand the GOTO macro

2014-09-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ identifier lbl; identifier rc; constant c; @@ - GOTO(lbl,\(rc\|c\)); + goto lbl; @@ identifier lbl; expression rc; @@ - GOTO(lbl,rc); + rc; + goto lbl

[PATCH 5/7] staging: lustre: obdclass: expand double GOTO macros

2014-09-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ identifier lbl; @@ if (...) GOTO(lbl,...); +else GOTO(lbl,...); @@ identifier lbl; expression e,e1,e2; @@ if (e) - GOTO(lbl,e1); -else GOTO(lbl,e2

[PATCH 4/7] staging: lustre: lvfs: expand the GOTO macro

2014-09-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ identifier lbl; identifier rc; constant c; @@ - GOTO(lbl,\(rc\|c\)); + goto lbl; @@ identifier lbl; expression rc; @@ - GOTO(lbl,rc); + rc; + goto lbl

[PATCH 6/7] staging: lustre: obdclass: expand the GOTO macro + break

2014-09-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ identifier lbl,rc,f; constant c; @@ - GOTO(lbl,\(rc\|rc-f\|c\)); - break; + goto lbl; @@ identifier lbl; expression rc; @@ - GOTO(lbl,rc); - break; + rc

[PATCH 7/7] staging: lustre: obdclass: expand the GOTO macro

2014-09-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ identifier lbl; identifier rc; constant c; @@ - GOTO(lbl,\(rc\|c\)); + goto lbl; @@ identifier lbl; expression rc; @@ - GOTO(lbl,rc); + rc; + goto lbl

[PATCH 3/7] staging: lustre: lov: expand the GOTO macro

2014-09-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ identifier lbl; identifier rc; constant c; @@ - GOTO(lbl,\(rc\|c\)); + goto lbl; @@ identifier lbl; expression rc; @@ - GOTO(lbl,rc); + rc; + goto lbl

Re: [PATCH 6/7] staging: lustre: obdclass: expand the GOTO macro + break

2014-09-09 Thread Julia Lawall
On Tue, 9 Sep 2014, Dan Carpenter wrote: On Sun, Sep 07, 2014 at 06:18:34PM +0200, Julia Lawall wrote: diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index f41695d..8a9752f 100644 --- a/drivers/staging/lustre

Re: [PATCH 3/7] staging: lustre: lov: expand the GOTO macro

2014-09-09 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ identifier lbl; identifier rc; constant c; @@ - GOTO(lbl,\(rc\|c\)); + goto lbl; @@ identifier lbl; expression rc; @@ - GOTO(lbl,rc); + rc; + goto lbl

Re: [PATCH] checkpatch: Warn on macros with flow control statements

2014-09-10 Thread Julia Lawall
On Wed, 10 Sep 2014, Joe Perches wrote: On Wed, 2014-09-10 at 11:43 +0300, Dan Carpenter wrote: On Tue, Sep 09, 2014 at 01:38:13PM -0700, Joe Perches wrote: Macros with flow control statements (goto and return) are not very nice to read as any flow movement is unexpected. break and

[PATCH] staging: lustre: llite: Use kzalloc and rewrite null tests

2014-09-18 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr This patch removes some kzalloc-related macros and rewrites the associated null tests to use !x rather than x == NULL. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ expression ptr

[PATCH] Use kzalloc and rewrite null tests

2014-09-18 Thread Julia Lawall
The following patch removes some kzalloc-related macros and rewrites the associated null tests to use !x rather than x == NULL. The complete semantic patch used for this transformation is as follows: // smpl @disable unlikely@ expression ptr; statement S,S1; @@

Re: [HPDD-discuss] [PATCH] staging: lustre: llite: Use kzalloc and rewrite null tests

2014-09-18 Thread Julia Lawall
With respect to the upper case lower case issue, does the thing need to be a macro? I think that the lowercase is more or less fine, but only if what is behind it is a function. I say more or less fine, because normally in the kernel the special allocators have special purposes, eg allocating

Re: [HPDD-discuss] [PATCH] staging: lustre: llite: Use kzalloc and rewrite null tests

2014-09-19 Thread Julia Lawall
On Fri, 19 Sep 2014, Drokin, Oleg wrote: Hello! First, thanks for your patches and efforts spent on these cleanups. On Sep 19, 2014, at 12:45 AM, Julia Lawall wrote: With respect to the upper case lower case issue, does the thing need to be a macro? I think that the lowercase

Re: [PATCH] staging: rtl8188eu: core: rtw_wlan_util.c: Fix for NULL dereference

2015-01-26 Thread Julia Lawall
On Mon, 26 Jan 2015, Kumar Amit Mehta wrote: In rtw_check_bcn_info(), check the return value of kzalloc() before dereferencing it, to avoid NULL pointer dereference. Signed-off-by: Kumar Amit Mehta gmate.a...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 2 ++ 1 file

Re: [PATCH] staging: rtl8188eu: core: rtw_wlan_util.c: Fix for NULL dereference

2015-01-26 Thread Julia Lawall
On Mon, 26 Jan 2015, Julia Lawall wrote: On Mon, 26 Jan 2015, Kumar Amit Mehta wrote: In rtw_check_bcn_info(), check the return value of kzalloc() before dereferencing it, to avoid NULL pointer dereference. Signed-off-by: Kumar Amit Mehta gmate.a...@gmail.com --- drivers/staging

Re: [PATCH] staging: comedi: drivers: mite: Removed variables that is never used

2015-01-28 Thread Julia Lawall
On Wed, 28 Jan 2015, Rickard Strandqvist wrote: Variable ar assigned a value that is never used. The variable is lkar. julia I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard

Re: [HPDD-discuss] [PATCH] Staging: lustre: file.c: fix coding style

2015-03-18 Thread Julia Lawall
On Wed, 18 Mar 2015, Patrick Farrell wrote: Uck, my reply made the formatting even worse. I'm trying to say it should look like this: +rc = ll_intent_file_open(file-f_path.dentry, +NULL, 0, it); Not like this: +rc

Re: [PATCH 1/1] staging: rtl8723au: Remove unnecessary OOM message

2015-03-06 Thread Julia Lawall
On Fri, 6 Mar 2015, Jes Sorensen wrote: Quentin Lambert lambert.quen...@gmail.com writes: This patch reduces the kernel size by removing error messages that duplicate the normal OOM message. A simplified version of the semantic patch that finds this problem is as follows:

[PATCH 1/4] staging: rtl8712: Drop unneeded cast on netdev_priv

2015-03-29 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The result of netdev_priv is already implicitly cast to the type of the left side of the assignment. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // smpl @@ type T; T *x; @@ x = - (T *) netdev_priv

[PATCH 3/4] staging: ft1000: Drop unneeded cast on netdev_priv

2015-03-29 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The result of netdev_priv is already implicitly cast to the type of the left side of the assignment. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // smpl @@ type T; T *x; @@ x = - (T *) netdev_priv

Re: [PATCH 1/1] staging: io: Remove unnecessary OOM message

2015-03-05 Thread Julia Lawall
On Thu, 5 Mar 2015, Quentin Lambert wrote: On 05/03/2015 11:28, Julia Lawall wrote: It's i2o, not io, and it is on the way out of the kernel. sorry about that, since it is on its way out I guess there is no need for me to submit a correct version of this patch? Are there resources

Re: [PATCH 1/1] staging: io: Remove unnecessary OOM message

2015-03-05 Thread Julia Lawall
It's i2o, not io, and it is on the way out of the kernel. julia On Thu, 5 Mar 2015, Quentin Lambert wrote: This patch reduces the kernel size by removing error messages that duplicate the normal OOM message. Signed-off-by: Quentin Lambert lambert.quen...@gmail.com ---

Re: [PATCH] staging: lustre: replace kzalloc with copy_from_user with memdup_user

2015-04-02 Thread Julia Lawall
On Tue, 31 Mar 2015, Drokin, Oleg wrote: On Mar 31, 2015, at 11:57 AM, gre...@linuxfoundation.org wrote: On Tue, Mar 31, 2015 at 05:15:23PM +0200, Julia Lawall wrote: On Tue, 31 Mar 2015, Dhere, Chaitanya (C.) wrote: This patch replaces kzalloc and copy_from_user with memdup_user

Re: [PATCH] staging: rtl8712: Fix freeing ERR_PTR

2015-04-29 Thread Julia Lawall
On Wed, 29 Apr 2015, Gujulan Elango, Hari Prasath (H.) wrote: The return value of memdup_user is a pointer to errno.Freeing it will cause error.Hence set it to NULL before branching to free the pointer.smatch also raises the same warning. Perhaps there is no point to jumping to the label if

Re: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-02 Thread Julia Lawall
On Sat, 2 May 2015, Dan Carpenter wrote: On Fri, May 01, 2015 at 09:13:11PM +, Drokin, Oleg wrote: The patch was submitted. But it depends on a symbol that's not exported. I was not able to change that. http://www.spinics.net/lists/linux-mm/msg83997.html But you were

Re: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-02 Thread Julia Lawall
Yes, I imagine Julia will include that as the new lustre_kvzalloc() define to be used in all OBD_ALLOC_LARGE instances. I can provide the desired code if necessary (it's actually a bit less than trivial because in some cases we also have that numa-aware node thing). Oleg, If you could send

[PATCH 3/11] staging: lustre: lclient: Use kzalloc and kfree

2015-05-01 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. A simplified version of the semantic patch that makes these changes is as follows: (http://coccinelle.lip6.fr/) // smpl

[PATCH 11/11] staging: lustre: ptlrpc: Use kzalloc and kfree

2015-05-01 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. A simplified version of the semantic patch that makes these changes is as follows: (http://coccinelle.lip6.fr/) // smpl

[PATCH 0/11] Use kzalloc and kfree

2015-05-01 Thread Julia Lawall
Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. The complete semantic patch that makes these changes is as follows: (http://coccinelle.lip6.fr/) // smpl @@ expression ptr,e1,e2; @@ - OBD_ALLOC(ptr,sizeof e1 *

[PATCH 8/11] staging: lustre: obdclass: Use kzalloc and kfree

2015-05-01 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. A simplified version of the semantic patch that makes these changes is as follows: (http://coccinelle.lip6.fr/) // smpl

[PATCH 4/11] staging: lustre: ldlm: Use kzalloc and kfree

2015-05-01 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. A simplified version of the semantic patch that makes these changes is as follows: (http://coccinelle.lip6.fr/) // smpl

[PATCH 5/11] staging: lustre: lmv: Use kzalloc and kfree

2015-05-01 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. A simplified version of the semantic patch that makes these changes is as follows: (http://coccinelle.lip6.fr/) // smpl

[PATCH 10/11] staging: lustre: osc: Use kzalloc and kfree

2015-05-01 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. A simplified version of the semantic patch that makes these changes is as follows: (http://coccinelle.lip6.fr/) // smpl

[PATCH 1/11] staging: lustre: fid: Use kzalloc and kfree

2015-05-01 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. A simplified version of the semantic patch that makes these changes is as follows: (http://coccinelle.lip6.fr/) // smpl

[PATCH 7/11] staging: lustre: mgc: Use kzalloc and kfree

2015-05-01 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. A simplified version of the semantic patch that makes these changes is as follows: (http://coccinelle.lip6.fr/) // smpl

[PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-01 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. A simplified version of the semantic patch that makes these changes is as follows: (http://coccinelle.lip6.fr/) // smpl

[PATCH] staging: lustre: obd_support: Add obd_cpt_alloc function

2015-05-02 Thread Julia Lawall
Summarize OBD_CPT_ALLOC_GFP, OBD_CPT_ALLOC, and OBD_CPT_ALLOC_PTR as a function, obd_cpt_alloc. Signed-off-by: Julia Lawall julia.law...@lip6.fr --- Some questions: Is the name OK? Is the NULL test needed? If not, should the call to kzalloc_node with the call to cfs_cpt_spread_node just

[PATCH 9/11] staging: lustre: obdecho: Use kzalloc and kfree

2015-05-01 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. A simplified version of the semantic patch that makes these changes is as follows: (http://coccinelle.lip6.fr/) // smpl

RE: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-01 Thread Julia Lawall
On Fri, 1 May 2015, Simmons, James A. wrote: From: Julia Lawall julia.law...@lip6.fr Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. Nak: James Simmons jsimm...@infradead.org A simple replace

[PATCH 12/20] staging: lustre: obdclass: genops: remove unneeded null test before free

2015-05-01 Thread Julia Lawall
Kfree can cope with a null argument, so drop null tests. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ expression ptr; @@ - if (ptr != NULL) kfree(ptr); // /smpl Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/staging/lustre

[PATCH 11/20] staging: lustre: mdc: remove unneeded null test before free

2015-05-01 Thread Julia Lawall
Kfree can cope with a null argument, so drop null tests. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ expression ptr; @@ - if (ptr != NULL) kfree(ptr); // /smpl Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/staging/lustre

[PATCH 15/20] staging: lustre: obdclass: obd_mount: remove unneeded null test before free

2015-05-01 Thread Julia Lawall
Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 45 +++-- 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass

[PATCH 14/20] staging: lustre: obdclass: obd_config: remove unneeded null test before free

2015-05-01 Thread Julia Lawall
calls to kfree. In addition, lprof-lp_md is always null in the cleanup code at the end of the function, so that kfree is just dropped. Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/staging/lustre/lustre/obdclass/obd_config.c | 24 1 file changed, 10 insertions

[PATCH 3/20] staging: lustre: ldlm: ldlm_resource: remove unneeded null test before free

2015-05-01 Thread Julia Lawall
Kfree can cope with a null argument, so drop null tests. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ expression ptr; @@ - if (ptr != NULL) { kfree(ptr); ptr = NULL; - } // /smpl Signed-off-by: Julia Lawall julia.law...@lip6.fr

[PATCH 5/20] Staging: lustre: llite: dir: remove unneeded null test before free

2015-05-01 Thread Julia Lawall
to the end of the function, is not needed. Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/staging/lustre/lustre/llite/dir.c |9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite

[PATCH 20/20] staging: lustre: ptlrpc: service: remove unneeded null test before free

2015-05-01 Thread Julia Lawall
In the first case, specific labels are introduced to free only what is needed. Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/staging/lustre/lustre/ptlrpc/service.c | 39 - 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/drivers/staging/lustre

[PATCH 6/20] Staging: lustre: llite: file: remove unneeded null test before free

2015-05-01 Thread Julia Lawall
. Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/staging/lustre/lustre/llite/file.c | 23 --- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 6e50b35..702f62d

[PATCH 1/20] staging: lustre: ldlm: ldlm_lib: remove unneeded null test before free

2015-05-01 Thread Julia Lawall
Kfree can cope with a null argument, so drop null tests. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ expression ptr; @@ - if (ptr != NULL) kfree(ptr); // /smpl Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/staging/lustre

[PATCH 16/20] staging: lustre: obdecho: remove unneeded null test before free

2015-05-01 Thread Julia Lawall
Kfree can cope with a null argument, so drop null tests. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ expression ptr; @@ - if (ptr != NULL) kfree(ptr); // /smpl Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/staging/lustre

  1   2   3   4   5   6   7   >