staging: lustre: ptlrpc: Use macro DIV_ROUND_UP
PATCH v2 1/1 staging: lustre: ptlrpc: Use macro DIV_ROUND_UP
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)
+ DIV_ROUND_UP(e1,e2)
)
---
Changes in v2:
-Fixed typo "lusture" to "lustre" in the subject
drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c +1 -1
@@ -274,7 +274,7 @@ static unsigned long enc_pools_shrink_scan(struct shrinker *s,static inline int npages_to_npools (unsigned long npages) { -return (int ) ((npages +PAGES_PER_POOL -1 ) /PAGES_PER_POOL ); +return (int ) (DIV_ROUND_UP (npages,PAGES_PER_POOL )); }/*
--
2.1.4
Greg KH
maintainerQuoted 15 lines · Bhaktipriya Shridhar
The macro
DIV_ROUND_UPperforms 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)
+DIV_ROUND_UP(e1,e2)
)
Quoted 4 lines
Signed-off-by Bhaktipriya Shridhar <[email protected]>---
Changes in v2:
-Fixed typo "lusture" to "lustre" in the subject
Please pick better subjects, you use pretty much the same thing twice here :(
Greg KH
maintainerQuoted 15 lines · Bhaktipriya Shridhar
The macro
DIV_ROUND_UPperforms 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)
+DIV_ROUND_UP(e1,e2)
)
Quoted 4 lines
Signed-off-by Bhaktipriya Shridhar <[email protected]>---
Changes in v2:
-Fixed typo "lusture" to "lustre" in the subject
Please pick better subjects, you use pretty much the same thing twice here :(