提交 237abac6 编写于 作者: J Julia Lawall 提交者: James Bottomley

[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: NJulia Lawall <julia@diku.dk>
Cc: David Miller <davem@davemloft.net>
Reviewed-by: NMatthew Wilcox <willy@linux.intel.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
上级 973b7360
......@@ -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--;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册