q35: use DIV_ROUND_UP

I used the clang-tidy qemu-round check to generate the fix:
https://github.com/elmarco/clang-tools-extra

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
Marc-André Lureau 2017-06-22 13:04:16 +02:00
parent f9406b84ba
commit fa141081b9
1 changed files with 1 additions and 1 deletions

View File

@ -315,7 +315,7 @@ static void mch_update_pam(MCHPCIState *mch)
memory_region_transaction_begin();
for (i = 0; i < 13; i++) {
pam_update(&mch->pam_regions[i], i,
pd->config[MCH_HOST_BRIDGE_PAM0 + ((i + 1) / 2)]);
pd->config[MCH_HOST_BRIDGE_PAM0 + (DIV_ROUND_UP(i, 2))]);
}
memory_region_transaction_commit();
}