public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Ben Dooks <ben-linux@fluff.org>
To: linux-mtd@lists.infradead.org
Cc: Ben Dooks <ben-linux@fluff.org>
Subject: [MTD] [NAND] S3C2410: Use DIV_ROUND_UP
Date: Sat, 30 May 2009 18:41:38 +0100	[thread overview]
Message-ID: <1243705298-21814-12-git-send-email-ben-linux@fluff.org> (raw)
In-Reply-To: <1243705298-21814-11-git-send-email-ben-linux@fluff.org>

Change to using DIV_ROUND_UP() in the timing calculation
instead of blindly doing result++

Signed-off-by: Ben Dooks <ben-linux@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);
 
-- 
1.5.6.5

  reply	other threads:[~2009-05-30 17:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-30 17:41 S3C2410 NAND controller updates Ben Dooks
2009-05-30 17:41 ` [MTD] [NAND] S3C2410: Move to using platform device table Ben Dooks
2009-05-30 17:41   ` [MTD] [NAND] S3C2410: Basic kerneldoc comment updates Ben Dooks
2009-05-30 17:41     ` [MTD] [NAND] S3C2410: NAND ECC by chip rather than global Ben Dooks
2009-05-30 17:41       ` [MTD] [NAND] S3C2410: Small colon cleanup Ben Dooks
2009-05-30 17:41         ` [MTD] [NAND] S3C2410: Uninitialised variable cleanup Ben Dooks
2009-05-30 17:41           ` [MTD] [NAND] S3C2410: Fix CFG debug order Ben Dooks
2009-05-30 17:41             ` [MTD] [NAND] S3C2410: Allow commandline partition processing Ben Dooks
2009-05-30 17:41               ` [MTD] [NAND] S3C2410: Added a kerneldoc for s3c2410_nand_set Ben Dooks
2009-05-30 17:41                 ` [MTD] [NAND] S3C2410: Allow the machine code to get the BBT table from NAND Ben Dooks
2009-05-30 17:41                   ` [MTD] [NAND] S3C2410: Deal with unaligned lengths in S3C2440 buffer read/write Ben Dooks
2009-05-30 17:41                     ` Ben Dooks [this message]
2009-06-02 19:36                 ` [MTD] [NAND] S3C2410: Added a kerneldoc for s3c2410_nand_set Peter Korsgaard
2009-06-02 22:55                   ` Ben Dooks
2009-06-01  5:47   ` [MTD] [NAND] S3C2410: Move to using platform device table Eric Miao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1243705298-21814-12-git-send-email-ben-linux@fluff.org \
    --to=ben-linux@fluff.org \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox