Commit ee09c914 authored by Thomas Richter's avatar Thomas Richter Committed by Vasily Gorbik

s390/cpum_sf: Use DIV_ROUND_UP

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: default avatarThomas Richter <tmricht@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 32dab682
...@@ -1716,7 +1716,7 @@ static void *aux_buffer_setup(struct perf_event *event, void **pages, ...@@ -1716,7 +1716,7 @@ static void *aux_buffer_setup(struct perf_event *event, void **pages,
sfb = &aux->sfb; sfb = &aux->sfb;
/* Allocate sdbt_index for fast reference */ /* 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); aux->sdbt_index = kmalloc_array(n_sdbt, sizeof(void *), GFP_KERNEL);
if (!aux->sdbt_index) if (!aux->sdbt_index)
goto no_sdbt_index; goto no_sdbt_index;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment