Category: Linux

leds: wm831x-status: Use devm_led_classdev_register

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> Switch to resource-managed function devm_led_classdev_register instead of led_classdev_register and remove unneeded led_classdev_unregister. Also, remove platform_set_drvdata from probe function and the remove function, wm831x_status_remove as it is now has nothing to do. The Coccinelle semantic patch used to make this change is as follows: // @platform@ identifier p, probefn, removefn; @@ …

Continue reading

leds: lp8788: Use devm_led_classdev_register

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> Switch to resource-managed function devm_led_classdev_register instead of led_classdev_register and remove unneeded led_classdev_unregister. Also, remove platform_set_drvdata in probe function and the remove function, lp8788_led_remove as it is now has nothing to do. The Coccinelle semantic patch used to make this change is as follows: // @platform@ identifier p, probefn, removefn; @@ …

Continue reading

leds: 88pm860x: Use devm_led_classdev_register

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> Switch to resource-managed function devm_led_classdev_register instead of led_classdev_register and remove unneeded led_classdev_unregister. Also, remove platform_set_drvdata in probe function and the remove function, pm860x_led_remove as it is now has nothing to do. The Coccinelle semantic patch used to make this change is as follows: // @platform@ identifier p, probefn, removefn; @@ …

Continue reading

staging: rtl8192e: Prefer using macro DIV_ROUND_UP

Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> The macro DIV_ROUND_UP performs the computation (((n) + (d) – 1) /(d)). It clarifies the divisor calculations. This was done using the coccinelle script: @@ expression e1; expression e2; @@ ( – ((e1) + e2 – 1) / (e2) + DIV_ROUND_UP(e1,e2) | – ((e1) + (e2 – 1)) / (e2) + …

Continue reading

staging: rtl8723au: hal: Use macro DIV_ROUND_UP

Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> The macro DIV_ROUND_UP performs the computation (((n) + (d) – 1) /(d)). It clarifies the divisor calculations. This was done using the coccinelle script: @@ expression e1; expression e2; @@ ( – ((e1) + e2 – 1) / (e2) + DIV_ROUND_UP(e1,e2) | – ((e1) + (e2 – 1)) / (e2) + …

Continue reading

staging: netlogic: Replace pr_* with netdev_*

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> Replace generic pr_info and pr_err with netdev_info and netdev_err respectively for net devices. Found using Coccinelle. The semantic patch used to find this is as follows: // @@ expression e; identifier f,i; position p; @@ f(…,struct net_device *i,…) { … ( – pr_debug@p (e) + netdev_dbg(i, e) | – pr_err@p …

Continue reading

leds: lm3533: Use devm_led_classdev_register

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> Switch to resource-managed function devm_led_classdev_register instead of led_classdev_register and remove unneeded led_classdev_unregister. To be compatible with this change, remove an unnecessary label by replacing it with direct return statement. The Coccinelle semantic patch used to make this change is as follows: // @platform@ identifier p, probefn, removefn; @@ struct platform_driver …

Continue reading

Staging: most: Use list_first_entry instead of list_entry

Author: Bhumika Goyal <bhumirks@gmail.com> This patch replaces list_entry with list_first_entry as it makes the code more clear. Done using coccinelle: @@ expression e; @@ ( – list_entry(e->next, + list_first_entry(e, …) | – list_entry(e->prev, + list_last_entry(e, …) ) Signed-off-by: Bhumika Goyal Signed-off-by: Greg Kroah-Hartman — drivers/staging/most/hdm-dim2/dim2_hdm.c | 6 +++— 1 file changed, 3 insertions(+), 3 deletions(-) …

Continue reading

Staging: lustre: Use list_{next/prev}_entry instead of list_entry

Author: Bhumika Goyal <bhumirks@gmail.com> This patch replace list_entry with list_{next/prev}_entry as it makes the code more clear to read. Done using coccinelle: @@ expression e1; identifier e3; type t; @@ ( – list_entry(e1->e3.next,t,e3) + list_next_entry(e1,e3) | – list_entry(e1->e3.prev,t,e3) + list_prev_entry(e1,e3) ) Signed-off-by: Bhumika Goyal Signed-off-by: Greg Kroah-Hartman — drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c | 3 +– drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 7 …

Continue reading

Staging: lustre: lnet: Use list_first_entry_or_null

Author: Bhumika Goyal <bhumirks@gmail.com> This patch replaces list_empty and list_entry with list_first_entry_or_null. Done using coccinelle: @@ expression e1,e2; statement S; @@ – if(!list_empty(…)){ e2= – list_entry(e1.next, + list_first_entry_or_null(&e1, …); + if(e2){ … } Signed-off-by: Bhumika Goyal Signed-off-by: Greg Kroah-Hartman — drivers/staging/lustre/lnet/selftest/conrpc.c | 7 +++—- drivers/staging/lustre/lnet/selftest/framework.c | 7 +++—- 2 files changed, 6 insertions(+), 8 deletions(-) …

Continue reading

BtrLinux
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.