From 98cb6f30f708ef416572bf65bd26ac9f998ae0dc Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Wed, 22 Jul 2009 23:34:35 +0200 Subject: janitor: add DIV_ROUND_UP and use it. Signed-off-by: Pierre Habouzit Signed-off-by: Junio C Hamano --- preload-index.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'preload-index.c') diff --git a/preload-index.c b/preload-index.c index 14d5281183..92899333c2 100644 --- a/preload-index.c +++ b/preload-index.c @@ -76,7 +76,7 @@ static void preload_index(struct index_state *index, const char **pathspec) if (threads > MAX_PARALLEL) threads = MAX_PARALLEL; offset = 0; - work = (index->cache_nr + threads - 1) / threads; + work = DIV_ROUND_UP(index->cache_nr, threads); for (i = 0; i < threads; i++) { struct thread_data *p = data+i; p->index = index; -- cgit v1.2.3