[MTD] [NAND] S3C2410: Use DIV_ROUND_UP

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Jun 8 07:59:02 EDT 2009


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=947391cfbaa3b08558844c0b187bcd0223c3f660
Commit:     947391cfbaa3b08558844c0b187bcd0223c3f660
Parent:     dea2aa6fd7d46c43c840ad77905f3c161d5bc59d
Author:     Ben Dooks <ben-linux at fluff.org>
AuthorDate: Sat May 30 18:34:16 2009 +0100
Committer:  Ben Dooks <ben-linux at fluff.org>
CommitDate: Mon Jun 8 12:10:37 2009 +0100

    [MTD] [NAND] S3C2410: Use DIV_ROUND_UP
    
    Change to using DIV_ROUND_UP() in the timing calculation
    instead of blindly doing result++
    
    Signed-off-by: Ben Dooks <ben-linux at fluff.org>
---
 drivers/mtd/nand/s3c2410.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
index 8a7f960..89b7905 100644
--- a/drivers/mtd/nand/s3c2410.c
+++ b/drivers/mtd/nand/s3c2410.c
@@ -180,8 +180,7 @@ static int s3c_nand_calc_rate(int wanted, unsigned long clk, int max)
 {
 	int result;
 
-	result = (wanted * clk) / NS_IN_KHZ;
-	result++;
+	result = DIV_ROUND_UP((wanted * clk), NS_IN_KHZ);
 
 	pr_debug("result %d from %ld, %d\n", result, clk, wanted);
 



More information about the linux-mtd-cvs mailing list