Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Julia Lawall and committed by
James Bottomley
237abac6 973b7360

+2 -4
+2 -4
drivers/scsi/esp_scsi.c
··· 1453 1453 offset = 0; 1454 1454 1455 1455 if (offset) { 1456 - int rounded_up, one_clock; 1456 + int one_clock; 1457 1457 1458 1458 if (period > esp->max_period) { 1459 1459 period = offset = 0; ··· 1463 1463 goto do_reject; 1464 1464 1465 1465 one_clock = esp->ccycle / 1000; 1466 - rounded_up = (period << 2); 1467 - rounded_up = (rounded_up + one_clock - 1) / one_clock; 1468 - stp = rounded_up; 1466 + stp = DIV_ROUND_UP(period << 2, one_clock); 1469 1467 if (stp && esp->rev >= FAS236) { 1470 1468 if (stp >= 50) 1471 1469 stp--;