linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/11] Use kzalloc and kfree
@ 2015-05-01 15:51 Julia Lawall
  2015-05-01 15:51 ` [PATCH 11/11] staging: lustre: ptlrpc: " Julia Lawall
                   ` (11 more replies)
  0 siblings, 12 replies; 36+ messages in thread
From: Julia Lawall @ 2015-05-01 15:51 UTC (permalink / raw)
  To: linux-kernel
  Cc: kernel-janitors, devel, HPDD-discuss, Greg Kroah-Hartman,
	Andreas Dilger, Oleg Drokin

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 * e2)
+ ptr = kcalloc(e2, sizeof e1, GFP_NOFS)

@@
expression ptr,e1,e2;
@@

- OBD_ALLOC_WAIT(ptr,sizeof e1 * e2)
+ ptr = kcalloc(sizeof e1, e2, GFP_KERNEL)

@@
expression ptr,e1,e2;
@@

- OBD_ALLOC(ptr,e2 * sizeof e1)
+ ptr = kcalloc(e2, sizeof e1, GFP_NOFS)

@@
expression ptr,e1,e2;
@@

- OBD_ALLOC_WAIT(ptr,e2 * sizeof e1)
+ ptr = kcalloc(e2, sizeof e1, GFP_KERNEL)

@@
expression ptr,e2;
type t;
@@

- OBD_ALLOC(ptr,sizeof (t) * e2)
+ ptr = kcalloc(e2, sizeof (t), GFP_NOFS)

@@
expression ptr,e2;
type t;
@@

- OBD_ALLOC_WAIT(ptr,sizeof (t) * e2)
+ ptr = kcalloc(e2, sizeof (t), GFP_KERNEL)

@@
expression ptr,e2;
type t;
@@

- OBD_ALLOC(ptr,e2 * sizeof (t))
+ ptr = kcalloc(e2, sizeof (t), GFP_NOFS)

@@
expression ptr,e2;
type t;
@@

- OBD_ALLOC_WAIT(ptr,e2 * sizeof (t))
+ ptr = kcalloc(e2, sizeof (t), GFP_KERNEL)

@@
expression ptr,e1,e2;
@@

- OBD_ALLOC(ptr,e1 * e2)
+ ptr = kcalloc(e1, e2, GFP_NOFS)

@@
expression ptr,e1,e2;
@@

- OBD_ALLOC_WAIT(ptr,e1 * e2)
+ ptr = kcalloc(e1, e2, GFP_KERNEL)

// -----------------------------------------------------------------------

@@
expression ptr,size;
@@

- OBD_ALLOC(ptr,size)
+ ptr = kzalloc(size, GFP_NOFS)

@@
expression ptr,size;
@@

- OBD_ALLOC_WAIT(ptr,size)
+ ptr = kzalloc(size, GFP_KERNEL)

@@
expression ptr;
@@

- OBD_ALLOC_PTR(ptr)
+ ptr = kzalloc(sizeof(*ptr), GFP_NOFS)

@@
expression ptr;
@@

- OBD_ALLOC_PTR_WAIT(ptr)
+ ptr = kzalloc(sizeof(*ptr), GFP_KERNEL)

// ----------------------------------------------------------------------

@@
expression ptr, size;
@@

- OBD_FREE(ptr, size);
+ kfree(ptr);

@@
expression ptr;
@@

- OBD_FREE_PTR(ptr);
+ kfree(ptr);
// </smpl>


^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2015-05-03 18:39 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-01 15:51 [PATCH 0/11] Use kzalloc and kfree Julia Lawall
2015-05-01 15:51 ` [PATCH 11/11] staging: lustre: ptlrpc: " Julia Lawall
2015-05-01 15:51 ` [PATCH 10/11] staging: lustre: osc: " Julia Lawall
2015-05-01 15:51 ` [PATCH 9/11] staging: lustre: obdecho: " Julia Lawall
2015-05-01 15:51 ` [PATCH 8/11] staging: lustre: obdclass: " Julia Lawall
2015-05-01 18:30   ` walter harms
2015-05-01 18:42     ` Julia Lawall
2015-05-01 15:51 ` [PATCH 7/11] staging: lustre: mgc: " Julia Lawall
2015-05-01 15:51 ` [PATCH 6/11] staging: lustre: mdc: " Julia Lawall
2015-05-01 15:51 ` [PATCH 5/11] staging: lustre: lmv: " Julia Lawall
2015-05-01 15:51 ` [PATCH 4/11] staging: lustre: ldlm: " Julia Lawall
2015-05-01 15:51 ` [PATCH 3/11] staging: lustre: lclient: " Julia Lawall
2015-05-01 15:51 ` [PATCH 2/11] Staging: lustre: fld: " Julia Lawall
2015-05-01 17:38   ` [HPDD-discuss] " Simmons, James A.
2015-05-01 17:48     ` Julia Lawall
2015-05-01 18:49       ` Drokin, Oleg
2015-05-01 20:18       ` Simmons, James A.
2015-05-01 20:47         ` Greg Kroah-Hartman
2015-05-01 22:57           ` Simmons, James A.
2015-05-01 20:49         ` Drokin, Oleg
2015-05-01 22:59           ` Simmons, James A.
2015-05-01 18:05     ` Greg Kroah-Hartman
2015-05-01 20:02     ` Dan Carpenter
2015-05-01 20:12       ` Drokin, Oleg
2015-05-01 20:36       ` Simmons, James A.
2015-05-01 20:49         ` Greg Kroah-Hartman
2015-05-01 20:52           ` Drokin, Oleg
2015-05-01 20:58             ` Greg Kroah-Hartman
2015-05-01 21:13               ` Drokin, Oleg
2015-05-02  6:02                 ` Julia Lawall
2015-05-02  8:14                 ` Dan Carpenter
2015-05-02  9:05                   ` Julia Lawall
2015-05-03  3:12                   ` Drokin, Oleg
2015-05-01 15:51 ` [PATCH 1/11] staging: lustre: fid: " Julia Lawall
2015-05-03 18:17 ` [PATCH 0/11] " Greg Kroah-Hartman
2015-05-03 18:39   ` Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).