Skip to content

Commit

Permalink
s390/cpum_sf: Use DIV_ROUND_UP
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Richter authored and Vasily Gorbik committed Jan 22, 2020
1 parent 32dab68 commit ee09c91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/s390/kernel/perf_cpum_sf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ee09c91

Please sign in to comment.