Category: Linux

staging: lustre: ptlrpc: service: remove unneeded null test before free

Author: Julia Lawall <Julia.Lawall@lip6.fr> 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/) // @@ expression ptr; @@ – if (ptr != NULL) kfree(ptr); @@ expression ptr; @@ – if (ptr != NULL) { kfree(ptr); ptr = NULL; – } // In …

Continue reading

staging: lustre: fid: Use kzalloc and kfree

Author: Julia Lawall <Julia.Lawall@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/) // @@ expression ptr,size; @@ – OBD_ALLOC(ptr,size) + ptr = kzalloc(size, GFP_NOFS) @@ expression ptr, size; @@ – OBD_FREE(ptr, size); + kfree(ptr); …

Continue reading

Staging: lustre: fld: Use kzalloc and kfree

Author: Julia Lawall <Julia.Lawall@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/) // @@ expression ptr,size; @@ – OBD_ALLOC(ptr,size) + ptr = kzalloc(size, GFP_NOFS) @@ expression ptr, size; @@ – OBD_FREE(ptr, size); + kfree(ptr); …

Continue reading

staging: lustre: lclient: Use kzalloc and kfree

Author: Julia Lawall <Julia.Lawall@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/) // @@ expression ptr,size; @@ – OBD_ALLOC(ptr,size) + ptr = kzalloc(size, GFP_NOFS) @@ expression ptr, size; @@ – OBD_FREE(ptr, size); + kfree(ptr); …

Continue reading

staging: lustre: ldlm: Use kzalloc and kfree

Author: Julia Lawall <Julia.Lawall@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/) // @@ expression ptr,size; @@ – OBD_ALLOC(ptr,size) + ptr = kzalloc(size, GFP_NOFS) @@ expression ptr, size; @@ – OBD_FREE(ptr, size); + kfree(ptr); …

Continue reading

staging: lustre: lmv: Use kzalloc and kfree

Author: Julia Lawall <Julia.Lawall@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/) // @@ expression ptr,size; @@ – OBD_ALLOC(ptr,size) + ptr = kzalloc(size, GFP_NOFS) @@ expression ptr, size; @@ – OBD_FREE(ptr, size); + kfree(ptr); …

Continue reading

staging: lustre: mdc: Use kzalloc and kfree

Author: Julia Lawall <Julia.Lawall@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/) // @@ expression ptr,size; @@ – OBD_ALLOC(ptr,size) + ptr = kzalloc(size, GFP_NOFS) @@ expression ptr, size; @@ – OBD_FREE(ptr, size); + kfree(ptr); …

Continue reading

staging: lustre: mgc: Use kzalloc and kfree

Author: Julia Lawall <Julia.Lawall@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/) // @@ expression ptr,size; @@ – OBD_ALLOC(ptr,size) + ptr = kzalloc(size, GFP_NOFS) @@ expression ptr, size; @@ – OBD_FREE(ptr, size); + kfree(ptr); …

Continue reading

staging: lustre: obdclass: Use kzalloc and kfree

Author: Julia Lawall <Julia.Lawall@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/) // @@ expression ptr,size; @@ – OBD_ALLOC(ptr,size) + ptr = kzalloc(size, GFP_NOFS) @@ expression ptr, size; @@ – OBD_FREE(ptr, size); + kfree(ptr); …

Continue reading

staging: lustre: obdecho: Use kzalloc and kfree

Author: Julia Lawall <Julia.Lawall@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/) // @@ expression ptr,size; @@ – OBD_ALLOC(ptr,size) + ptr = kzalloc(size, GFP_NOFS) @@ expression ptr, size; @@ – OBD_FREE(ptr, size); + kfree(ptr); …

Continue reading