Catégorie : Linux

staging: rdma: hfi1: Use offset_in_page macro

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> Use offset_in_page macro instead of (var & ~PAGE_MASK) The Coccinelle semantic patch used to make this change is as follows: // @@ unsigned long p; @@ – p & ~PAGE_MASK + offset_in_page(p) // Signed-off-by: Amitoj Kaur Chawla Signed-off-by: Greg Kroah-Hartman — drivers/staging/rdma/hfi1/user_sdma.c | 4 ++– 1 file changed, 2 insertions(+), …

Lire la suite

staging: rdma: hfi1: Use DIV_ROUND_UP

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) – 1) /(d)) but is perhaps more readable. The Coccinelle script used is as follows: // @@ expression n,d; @@ ( – (n + d – 1) / d + DIV_ROUND_UP(n,d) | – (n + (d – 1)) / d …

Lire la suite

staging: comedi: drivers: Use DIV_ROUND_CLOSEST

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> The kernel.h macro DIV_ROUND_CLOSEST performs the computation `(x +d/2)/d` but is perhaps more readable. The Coccinelle script used is as follows: // @@ expression x,__divisor; @@ – (((x) + ((__divisor) / 2)) / (__divisor)) + DIV_ROUND_CLOSEST(x,__divisor) // Signed-off-by: Amitoj Kaur Chawla Signed-off-by: Greg Kroah-Hartman — drivers/staging/comedi/drivers/addi_apci_3xxx.c | 2 +- drivers/staging/comedi/drivers/amplc_pci230.c …

Lire la suite

staging: rtl8723au: Remove unnecessary else following return

Author: Janani Ravichandran <janani.rvchndrn@gmail.com> Remove unnecessary else when there is a return statement in the corresponding if block. Coccinelle patch used: @rule1@ expression e1; @@ if (e1) { … return …; } – else{ … – } @rule2@ expression e2; statement s1; @@ if(e2) { … return …; } – else s1 Signed-off-by: Janani Ravichandran …

Lire la suite

staging: rtl8188eu: core: Remove unnecessary braces

Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> This patch removes braces for single statement blocks. The warning was detected using checkpatch.pl. Coccinelle was used to make the change. @@ expression e,e1; @@ – if (e) { + if (e) e1; – } Signed-off-by: Bhaktipriya Shridhar Signed-off-by: Greg Kroah-Hartman — drivers/staging/rtl8188eu/core/rtw_recv.c | 12 ++++——– 1 file changed, 4 insertions(+), …

Lire la suite

staging: comedi: drivers: Remove unnecessary else following return

Author: Janani Ravichandran <janani.rvchndrn@gmail.com> Else is unnecessary when there is a return statement in the corresponding if block. Coccinelle patch: @rule1@ expression e1; @@ if (e1) { … return …; } – else{ … – } @rule2@ expression e2; statement s1; @@ if(e2) { … return …; } – else s1 Signed-off-by: Janani Ravichandran Signed-off-by: …

Lire la suite

staging: android: Remove unneeded else following a return

Author: Janani Ravichandran <janani.rvchndrn@gmail.com> Remove unnecessary else when there is a return statement in the corresponding if block. Coccinelle patch used: @rule1@ expression e1; @@ if (e1) { … return …; } – else{ … – } @rule2@ expression e2; statement s1; @@ if(e2) { … return …; } – else s1 Signed-off-by: Janani Ravichandran …

Lire la suite

staging: mt29f_spinand: Remove unneeded else following return

Author: Janani Ravichandran <janani.rvchndrn@gmail.com> Remove unnecessary else when there is a return statement in the corresponding if block. Coccinelle patch used: @rule1@ expression e1; @@ if (e1) { … return …; } – else{ … – } @rule2@ expression e2; statement s1; @@ if(e2) { … return …; } – else s1 Signed-off-by: Janani Ravichandran …

Lire la suite

staging: fsl-mc: Remove unneeded else following a return

Author: Janani Ravichandran <janani.rvchndrn@gmail.com> Remove unnecessary else when there is a return statement in the corresponding if block. Coccinelle patch used: @rule1@ expression e1; @@ if (e1) { … return …; } – else{ … – } @rule2@ expression e2; statement s1; @@ if(e2) { … return …; } – else s1 Signed-off-by: Janani Ravichandran …

Lire la suite

staging: lustre: lustre: Remove unnecessary else after return

Author: Janani Ravichandran <janani.rvchndrn@gmail.com> Else is unnecessary when there is a return statement in the corresponding if block. Coccinelle patch used: @rule1@ expression e1; @@ if (e1) { … return …; } – else{ … – } @rule2@ expression e2; statement s1; @@ if(e2) { … return …; } – else s1 Signed-off-by: Janani Ravichandran …

Lire la suite