Quentin LAMBERT

Author's posts

staging: wilc1000: Remove useless return variables

Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> This patch removes unnecessary return variables and compresses the return logic. The coccinelle script that finds and fixes this issue is: @@ type T; identifier i,f; constant C; @@ – T i; …when != i when strict ( return -C; | – i = + return f(…); – return i; ) …

Continue reading

staging: fbtft: replace ternary operator with min macro

Author: Alison Schofield <amsfield22@gmail.com> Use macro min() to get the minimum of two values for brevity and readability. Found using Coccinelle: @@ type T; T x; T y; @@ ( – x < y ? x : y + min(x,y) | - x > y ? x : y + max(x,y) ) Signed-off-by: Alison Schofield …

Continue reading

staging: sm750fb: Remove parentheses from return arguments

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> Remove unnecessary parentheses from return arguments. The Coccinelle semantic patch that makes this change is as follows: // @@ identifier i; constant c; @@ return – ( \(i\|-i\|i(…)\|c\) – ) ; // Signed-off-by: Amitoj Kaur Chawla Signed-off-by: Greg Kroah-Hartman — drivers/staging/sm750fb/ddk750_hwi2c.c | 4 ++– drivers/staging/sm750fb/ddk750_sii164.c | 2 +- 2 files …

Continue reading

staging: wlan-ng: Remove unnecessary macro

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> Remove unnecessary macro SUBMIT_URB by replacing it with a direct call to usb_submit_urb() This change was made with the help of the following Coccinelle semantic patch: // @@ identifier f,g; @@ * #define f(…) g(…) // Signed-off-by: Amitoj Kaur Chawla Signed-off-by: Greg Kroah-Hartman — drivers/staging/wlan-ng/hfa384x_usb.c | 8 +++—– 1 file …

Continue reading

netxen: Use kobj_to_dev()

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> Introduce the use of kobj_to_dev() helper function instead of open coding it with container_of() The Coccinelle semantic patch used to make this change is as follows: // @@ expression a; symbol kobj; @@ – container_of(a, struct device, kobj) + kobj_to_dev(a) // Signed-off-by: Amitoj Kaur Chawla Signed-off-by: David S. Miller — …

Continue reading

3c59x: Use setup_timer()

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> Convert a call to init_timer and accompanying intializations of the timer’s data and function fields to a call to setup_timer. The Coccinelle semantic patch that fixes this problem is as follows: // @@ expression t,f,d; @@ -init_timer(&t); +setup_timer(&t,f,d); … -t.data = d; -t.function = f; // Signed-off-by: Amitoj Kaur Chawla …

Continue reading

forcedeth: Use setup_timer()

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> Convert a call to init_timer and accompanying intializations of the timer’s data and function fields to a call to setup_timer. The Coccinelle semantic patch that fixes this problem is as follows: // @@ expression t,f,d; @@ -init_timer(&t); +setup_timer(&t,f,d); -t.data = d; -t.function = f; // Signed-off-by: Amitoj Kaur Chawla Signed-off-by: …

Continue reading

net: tulip: Use setup_timer()

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> Convert a call to init_timer and accompanying intializations of the timer’s data and function fields to a call to setup_timer. The Coccinelle semantic patch that fixes this problem is as follows: // @@ expression t,f,d; @@ -init_timer(&t); +setup_timer(&t,f,d); -t.data = d; -t.function = f; // Signed-off-by: Amitoj Kaur Chawla Signed-off-by: …

Continue reading

staging: comedi: drivers: Remove use of deprecated pci API

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> Replace pci_[alloc|free]_consistent occurences with dma_[alloc|free]_coherent. The Coccinelle semantic patch that was used to make some of these changes is as follows: @deprecated@ idexpression id; position p; @@ ( pci_dma_supported@p ( id, …) | pci_alloc_consistent@p ( id, …) ) @bad1@ idexpression id; position deprecated.p; @@ …when != &id->dev when != pci_get_drvdata …

Continue reading

Staging: rtl8712: Clean up tests if NULL returned on failure

Author: Bhumika Goyal <bhumirks@gmail.com> Some functions like kmalloc/usb_alloc_urb/kmalloc_array returns NULL as their return value on failure. !x is generally preferred over x==NULL or NULL==x so make use of !x if the value returned on failure by these functions is NULL. Done using coccinelle: @@ expression e; statement S; @@ e = \(kmalloc\|devm_kzalloc\|kmalloc_array \|devm_ioremap\|usb_alloc_urb\|alloc_netdev\)(…); – if(e==NULL) …

Continue reading