summaryrefslogtreecommitdiffstats
path: root/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
diff options
context:
space:
mode:
authorsimran singhal <singhalsimran0@gmail.com>2017-02-22 00:21:03 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-06 09:17:02 +0100
commit0169acaea518098001bcdc239436cea821b28e1f (patch)
tree0f7198e333090912ace9f417c280a597639a0bca /drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
parent6e475350a4068580bfcec63ba5d9836d31965784 (diff)
staging: vc04_services: Using macro DIV_ROUND_UP
The macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /(d)). It clarifies the divisor calculations. This occurence was detected 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) ) Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c')
-rw-r--r--drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
index 2040fe5127f4..71779535655c 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
@@ -408,7 +408,7 @@ create_pagelist(char __user *buf, size_t count, unsigned short type,
dma_addr_t dma_addr;
offset = ((unsigned int)(unsigned long)buf & (PAGE_SIZE - 1));
- num_pages = (count + offset + PAGE_SIZE - 1) / PAGE_SIZE;
+ num_pages = DIV_ROUND_UP(count + offset, PAGE_SIZE);
pagelist_size = sizeof(PAGELIST_T) +
(num_pages * sizeof(u32)) +