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
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
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:
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
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
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
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
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
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);
+
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
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
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
//
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
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
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
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;
...
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
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
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
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
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
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
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
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
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
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
.
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
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
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
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
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
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
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
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
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
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
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))
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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;
@@
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
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
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
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
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
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
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:
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
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
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
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
---
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
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
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
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
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
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
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 *
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
.
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
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
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 - 100 of 631 matches
Mail list logo