Catégorie : Linux

Staging: solo6x10: Replace expressions that don’t use ALIGN macro

Author: Andreea-Cristina Bernat <bernat.ada@gmail.com> There are some expressions that compute the roundup of a number, but don’t use the existing macro defined in /include/kernel.h. This patch uses the following Coccinelle semantic patch: @ haskernel @ @@ @ depends on haskernel @ expression E1, E2; @@ – (E1 + (E2 – 1)) & ~(E2 – 1) …

Lire la suite

staging: r8188eu: fix coccinelle warnings

Author: Fengguang Wu <fengguang.wu@intel.com> drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:8030:3-9: Replace memcpy with struct assignment Generated by: coccinelle/misc/memcpy-assign.cocci Signed-off-by: Fengguang Wu Signed-off-by: Larry Finger Signed-off-by: Greg Kroah-Hartman — drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   diff –git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index 21f2f87..3ed5941 100644 — a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -8030,7 +8030,7 @@ static int rtw_scan_ch_decision(struct adapter *padapter, …

Lire la suite

staging:keucr: Remove typedefs

Author: Himangi Saraogi <himangi774@gmail.com> As suggested by Pablo, this patch uses a coccinelle script to remove the typedefs: typedef u8 BOOLEAN;

Staging: unisys: Replace kmalloc/memset with kzalloc

Author: Andreea-Cristina Bernat <bernat.ada@gmail.com> This patch solves the Coccinelle warning: « kzalloc should be used instead of kmalloc/memset ». Signed-off-by: Andreea-Cristina Bernat Signed-off-by: Peter P Waskiewicz Jr — drivers/staging/unisys/virthba/virthba.c | 4 ++– drivers/staging/unisys/virtpci/virtpci.c | 4 +— drivers/staging/unisys/visorchipset/parser.c | 4 ++– drivers/staging/unisys/visorchipset/visorchipset_main.c | 9 ++++—– drivers/staging/unisys/visorutil/memregion_direct.c | 4 ++– 5 files changed, 11 insertions(+), 14 deletions(-)   diff …

Lire la suite

rcu: Protect uses of ->jiffies_stall with ACCESS_ONCE()

Author: Himangi Saraogi <himangi774@gmail.com> Some of the accesses to the rcu_state structure’s ->jiffies_stall field are unprotected. This patch protects them with ACCESS_ONCE(). The following coccinelle script was used to acheive this: /* coccinelle script to protect uses of ->jiffies_stall with ACCESS_ONCE() */ @@ identifier a; @@ ( ACCESS_ONCE(a->jiffies_stall) | – a->jiffies_stall + ACCESS_ONCE(a->jiffies_stall) ) Signed-off-by: …

Lire la suite

staging: cxt1e1: Removed assignments from if statements.

Author: Chi Pham <fempsci@gmail.com> Assignments removed from if statements. Fixed checkpatch warning such as indentation and negative error returns in adjacent code. Coccinelle was used for this patch. The following script found the match: @simple@ expression E1, E2; statement S1, S2; @@ + E1 = E2; if ( – (E1 = E2) + E1 ) …

Lire la suite

staging: unisys: visorutil: Use kzalloc instead of kmalloc with memset

Author: Iulia Manda <iulia.manda21@gmail.com> Fix coccinelle warnings of better allocation by using kzalloc. In these cases, kzalloc is preferred, as kmalloc may fail if it does not find contiguous memory. Signed-off-by: Iulia Manda Acked-by: Luis R. Rodriguez Signed-off-by: Peter P Waskiewicz Jr — drivers/staging/unisys/visorutil/procobjecttree.c | 24 ++++++++————— 1 file changed, 8 insertions(+), 16 deletions(-)   …

Lire la suite

staging: android: ion: Use ERR_CAST instead of ERR_PTR

Author: Iulia Manda <iulia.manda21@gmail.com> Fix the following coccinelle warnings in ion.c: drivers/staging/android/ion/ion.c:511:9-16: WARNING: ERR_CAST can be used with buffer drivers/staging/android/ion/ion.c:218:9-16: WARNING: ERR_CAST can be used with table drivers/staging/android/ion/ion.c:1150:9-16: WARNING: ERR_CAST can be used with dmabuf Signed-off-by: Iulia Manda Acked-by: Paul E. McKenney Signed-off-by: Peter P Waskiewicz Jr — drivers/staging/android/ion/ion.c | 6 +++— 1 file changed, …

Lire la suite

IB/qib: fixup indentation in qib_ib_rcv()

Author: Yann Droneaud <ydroneaud@opteya.com> Commit af061a644a0e4d4778 add some code in qib_ib_rcv() which trigger a warning from coccicheck (coccinelle/spatch): $ make C=2 CHECK=scripts/coccicheck drivers/infiniband/hw/qib/ CHECK drivers/infiniband/hw/qib/qib_verbs.c drivers/infiniband/hw/qib/qib_verbs.c:679:5-32: code aligned with following code on line 681 CC [M] drivers/infiniband/hw/qib/qib_verbs.o In fact, according to similar code in qib_kreceive(), qib_ib_rcv() code is correct but improperly indented. This patch fix …

Lire la suite

IB/qib: add missing braces in do_qib_user_sdma_queue_create()

Author: Yann Droneaud <ydroneaud@opteya.com> Commit c804f07248895ff9c moved qib_assign_ctxt() to do_qib_user_sdma_queue_create() but dropped the braces around the statements. This was spotted by coccicheck (coccinelle/spatch): $ make C=2 CHECK=scripts/coccicheck drivers/infiniband/hw/qib/ CHECK drivers/infiniband/hw/qib/qib_file_ops.c drivers/infiniband/hw/qib/qib_file_ops.c:1583:2-23: code aligned with following code on line 1587 This patch adds braces back. Link: http://marc.info/?i=cover.1394485254.git.ydroneaud@opteya.com Cc: Mike Marciniszyn Cc: infinipath@intel.com Cc: Julia Lawall Cc: …

Lire la suite