Author: Tapasweni Pathak <tapaswenipathak@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: // @haskernel@ @@ @depends on haskernel@ expression x,__divisor; @@ – (((x) + ((__divisor) / 2)) / (__divisor)) + DIV_ROUND_CLOSEST(x,__divisor) // Signed-off-by: Tapasweni Pathak Signed-off-by: Greg Kroah-Hartman — drivers/staging/comedi/drivers/s626.c | 2 +- 1 …
Category: Linux
Oct 08 2014
staging: octeon-usb: use DIV_ROUND_UP
Author: Tapasweni Pathak <tapaswenipathak@gmail.com> The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) – 1) / (d)) but is perhaps more readable. Coccinelle script used : // @haskernel@ @@ @depends on haskernel@ expression n,d; @@ ( – (n + d – 1) / d + DIV_ROUND_UP(n,d) | – (n + (d – 1)) / …
Oct 08 2014
staging: lustre: lustre: llite: use DIV_ROUND_UP
Author: Tapasweni Pathak <tapaswenipathak@gmail.com> The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) – 1) / (d)) but is perhaps more readable. Coccinelle script used : // @haskernel@ @@ @depends on haskernel@ expression n,d; @@ ( – (n + d – 1) / d + DIV_ROUND_UP(n,d) | – (n + (d – 1)) / …
Oct 08 2014
staging: iio: adc: use DIV_ROUND_UP
Author: Tapasweni Pathak <tapaswenipathak@gmail.com> The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) – 1) / (d)) but is perhaps more readable. Coccinelle script used : // @haskernel@ @@ @depends on haskernel@ expression n,d; @@ ( – (n + d – 1) / d + DIV_ROUND_UP(n,d) | – (n + (d – 1)) / …
Oct 08 2014
staging: comedi: drivers: use DIV_ROUND_UP
Author: Tapasweni Pathak <tapaswenipathak@gmail.com> The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) – 1) / (d)) but is perhaps more readable. Coccinelle script used : // @haskernel@ @@ @depends on haskernel@ expression n,d; @@ ( – (n + d – 1) / d + DIV_ROUND_UP(n,d) | – (n + (d – 1)) / …
Oct 08 2014
staging: comedi: use DIV_ROUND_UP
Author: Tapasweni Pathak <tapaswenipathak@gmail.com> The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) – 1) / (d)) but is perhaps more readable. Coccinelle script used : // @haskernel@ @@ @depends on haskernel@ expression n,d; @@ ( – (n + d – 1) / d + DIV_ROUND_UP(n,d) | – (n + (d – 1)) / …
Oct 07 2014
3c59x: fix bad split of cpu_to_le32(pci_map_single())
Author: Sylvain “ythier” Hitier <sylvain.hitier@gmail.com> In commit 6f2b6a3005b2c34c39f207a87667564f64f2f91a, # 3c59x: Add dma error checking and recovery the intent is to split out the mapping from the byte-swapping in order to insert a dma_mapping_error() check. Kinda this semantic patch: // See http://coccinelle.lip6.fr/ // // Beware, grouik-and-dirty! @@ expression DEV, X, Y, Z; @@ – cpu_to_le32(pci_map_single(DEV, X, …
Oct 07 2014
Staging: lustre: lustre: osc: Remove variable that is not very useful.
Author: Heena Sirwani <heenasirwani@gmail.com> The following patch removes a variable that is not very useful using coccinelle. The semantic patch used was: @@ identifier ret; @@ -int ret = 0; … when != ret when strict -return ret; +return 0; Signed-off-by: Heena Sirwani Signed-off-by: Greg Kroah-Hartman — drivers/staging/lustre/lustre/osc/osc_request.c | 4 +— 1 file changed, 1 …
Oct 07 2014
Staging: lustre: lustre: osc: Remove variable that is not very useful.
Author: Heena Sirwani <heenasirwani@gmail.com> The following patch removes a variable that is not very useful using coccinelle. The semantic patch used was: @@ identifier ret; @@ -int ret = 0; … when != ret when strict -return ret; +return 0; Signed-off-by: Heena Sirwani Signed-off-by: Greg Kroah-Hartman — drivers/staging/lustre/lustre/osc/osc_cache.c | 3 +– 1 file changed, 1 …
Oct 07 2014
Staging: lustre: lustre: lov: Remove variable that is not very useful.
Author: Heena Sirwani <heenasirwani@gmail.com> The following patch removes a variable that is not very useful using coccinelle. The semantic patch used was: @@ identifier ret; @@ -int ret = 0; … when != ret when strict -return ret; +return 0; Signed-off-by: Heena Sirwani Signed-off-by: Greg Kroah-Hartman — drivers/staging/lustre/lustre/lov/lov_obd.c | 3 +– 1 file changed, 1 …