s390/cpum_sf: Use DIV_ROUND_UP
authorThomas Richter <tmricht@linux.ibm.com>
Fri, 3 Jan 2020 10:37:12 +0000 (11:37 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 22 Jan 2020 12:05:35 +0000 (13:05 +0100)
Use macro DIV_ROUND_UP() for calculation of number of SDBT
SDBT pages required for index pages. This macro is already
used throughout the file.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/perf_cpum_sf.c

index 7dec1fb..b095b1c 100644 (file)
@@ -1716,7 +1716,7 @@ static void *aux_buffer_setup(struct perf_event *event, void **pages,
        sfb = &aux->sfb;
 
        /* Allocate sdbt_index for fast reference */
-       n_sdbt = (nr_pages + CPUM_SF_SDB_PER_TABLE - 1) / CPUM_SF_SDB_PER_TABLE;
+       n_sdbt = DIV_ROUND_UP(nr_pages, CPUM_SF_SDB_PER_TABLE);
        aux->sdbt_index = kmalloc_array(n_sdbt, sizeof(void *), GFP_KERNEL);
        if (!aux->sdbt_index)
                goto no_sdbt_index;