diff options
author | Julia Lawall <julia@diku.dk> | 2008-10-29 14:24:40 -0700 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-12-29 11:24:14 -0600 |
commit | 237abac6ff093aa5cb64faf6f632c479e00a67be (patch) | |
tree | 289d811a797a9e5e333361c58be9a6f80a172d35 | |
parent | 973b73605cc2ac1f51457809c5f1f1f8ab760c47 (diff) | |
download | linux-237abac6ff093aa5cb64faf6f632c479e00a67be.tar.gz linux-237abac6ff093aa5cb64faf6f632c479e00a67be.tar.bz2 linux-237abac6ff093aa5cb64faf6f632c479e00a67be.zip |
[SCSI] esp_scsi: Use DIV_ROUND_UP
Use the macro DIV_ROUND_UP and eliminate the variable rounded_up, as
suggested by Matthew Wilcox.
Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: David Miller <davem@davemloft.net>
Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r-- | drivers/scsi/esp_scsi.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c index 62a4618530d0..a680e18b5f3b 100644 --- a/drivers/scsi/esp_scsi.c +++ b/drivers/scsi/esp_scsi.c @@ -1453,7 +1453,7 @@ static void esp_msgin_sdtr(struct esp *esp, struct esp_target_data *tp) offset = 0; if (offset) { - int rounded_up, one_clock; + int one_clock; if (period > esp->max_period) { period = offset = 0; @@ -1463,9 +1463,7 @@ static void esp_msgin_sdtr(struct esp *esp, struct esp_target_data *tp) goto do_reject; one_clock = esp->ccycle / 1000; - rounded_up = (period << 2); - rounded_up = (rounded_up + one_clock - 1) / one_clock; - stp = rounded_up; + stp = DIV_ROUND_UP(period << 2, one_clock); if (stp && esp->rev >= FAS236) { if (stp >= 50) stp--; |