[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>
This commit is contained in:
committed by
James Bottomley
parent
973b73605c
commit
237abac6ff
@@ -1453,7 +1453,7 @@ static void esp_msgin_sdtr(struct esp *esp, struct esp_target_data *tp)
|
|||||||
offset = 0;
|
offset = 0;
|
||||||
|
|
||||||
if (offset) {
|
if (offset) {
|
||||||
int rounded_up, one_clock;
|
int one_clock;
|
||||||
|
|
||||||
if (period > esp->max_period) {
|
if (period > esp->max_period) {
|
||||||
period = offset = 0;
|
period = offset = 0;
|
||||||
@@ -1463,9 +1463,7 @@ static void esp_msgin_sdtr(struct esp *esp, struct esp_target_data *tp)
|
|||||||
goto do_reject;
|
goto do_reject;
|
||||||
|
|
||||||
one_clock = esp->ccycle / 1000;
|
one_clock = esp->ccycle / 1000;
|
||||||
rounded_up = (period << 2);
|
stp = DIV_ROUND_UP(period << 2, one_clock);
|
||||||
rounded_up = (rounded_up + one_clock - 1) / one_clock;
|
|
||||||
stp = rounded_up;
|
|
||||||
if (stp && esp->rev >= FAS236) {
|
if (stp && esp->rev >= FAS236) {
|
||||||
if (stp >= 50)
|
if (stp >= 50)
|
||||||
stp--;
|
stp--;
|
||||||
|
Reference in New Issue
Block a user