Author: Benoit Taine <benoit.taine@lip6.fr> We should prefer `const struct pci_device_id` over `DEFINE_PCI_DEVICE_TABLE` to meet kernel coding style guidelines. This issue was reported by checkpatch. A simplified version of the semantic patch that makes this change is as follows (http://coccinelle.lip6.fr/): // @@ identifier i; declarer name DEFINE_PCI_DEVICE_TABLE; initializer z; @@ – DEFINE_PCI_DEVICE_TABLE(i) + const struct pci_device_id …
Catégorie : Linux
May 22 2014
nfsd: Remove assignments inside conditions
Author: Benoit Taine <benoit.taine@lip6.fr> Assignments should not happen inside an if conditional, but in the line before. This issue was reported by checkpatch. The semantic patch that makes this change is as follows (http://coccinelle.lip6.fr/): // @@ identifier i1; expression e1; statement S; @@ -if(!(i1 = e1)) S +i1 = e1; +if(!i1) +S // It has …
May 22 2014
drm/i915: Split the ringbuffers from the rings (3/3)
Author: Oscar Mateo <oscar.mateo@intel.com> Manual cleanup after the previous Coccinelle script. Yes, I could write another Coccinelle script to do this but I don’t want labor-replacing robots making an honest programmer’s work obsolete (also, I’m lazy). Signed-off-by: Oscar Mateo Signed-off-by: Daniel Vetter — drivers/gpu/drm/i915/i915_dma.c | 13 ++– drivers/gpu/drm/i915/i915_irq.c | 2 +- drivers/gpu/drm/i915/intel_ringbuffer.c | 109 +++++++++++++++++————— …
May 22 2014
drm/i915: Split the ringbuffers from the rings (2/3)
Author: Oscar Mateo <oscar.mateo@intel.com> This refactoring has been performed using the following Coccinelle semantic script: @@ struct intel_engine_cs r; @@ ( – (r).obj + r.buffer->obj | – (r).virtual_start + r.buffer->virtual_start | – (r).head + r.buffer->head | – (r).tail + r.buffer->tail | – (r).space + r.buffer->space | – (r).size + r.buffer->size | – (r).effective_size + r.buffer->effective_size …
May 22 2014
staging: rtl8723au: Use kmemdup() instead of memcpy() to duplicate memory
Author: Benoit Taine <benoit.taine@lip6.fr> This issue was reported by coccicheck using the semantic patch at scripts/coccinelle/api/memdup.cocci, and tested by compilation. Signed-off-by: Benoit Taine Signed-off-by: Greg Kroah-Hartman — drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 3 +– drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 17 +++++++———- 2 files changed, 8 insertions(+), 12 deletions(-) diff –git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c index a29fa76..20c93e4 100644 — a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c @@ …
May 20 2014
hwmon: (ultra45_env) Introduce managed version of kzalloc
Author: Himangi Saraogi <himangi774@gmail.com> This patch moves data allocated using kzalloc to managed data allocated using devm_kzalloc and cleans now unnecessary kfrees in probe and remove functions. Also, the unnecessary label out_free is removed. The following Coccinelle semantic patch was used for making the change: @platform@ identifier p, probefn, removefn; @@ struct platform_driver p = …
May 20 2014
MIPS: SEAD3: Introduce the use of the managed version of kzalloc
Author: Himangi Saraogi <himangi774@gmail.com> This patch moves data allocated using kzalloc to managed data allocated using devm_kzalloc and cleans now unnecessary kfrees in probe and remove functions. Also, the now unnecessary labels out_mem and out are done away with. The error handling code is moved under if and return 0 is now at the end …
May 20 2014
staging: vt6655: Remove useless return variables
Author: Peter Senna Tschudin <peter.senna@gmail.com> This patch remove variables that are initialized with a constant, are never updated, and are only used as parameter of return. Return the constant instead of using a variable. Verified by compilation only. The coccinelle script that find and fixes this issue is: // @@ type T; constant C; identifier …
May 20 2014
staging: ozwpan: Remove useless return variables
Author: Peter Senna Tschudin <peter.senna@gmail.com> This patch remove variables that are initialized with a constant, are never updated, and are only used as parameter of return. Return the constant instead of using a variable. Verified by compilation only. The coccinelle script that find and fixes this issue is: // @@ type T; constant C; identifier …
May 20 2014
[media] USB: as102_usb_drv.c: Remove useless return variables
Author: Peter Senna Tschudin <peter.senna@gmail.com> This patch remove variables that are initialized with a constant, are never updated, and are only used as parameter of return. Return the constant instead of using a variable. Verified by compilation only. The coccinelle script that find and fixes this issue is: // @@ type T; constant C; identifier …