Skip to content

Commit

Permalink
piix: use DIV_ROUND_UP
Browse files Browse the repository at this point in the history
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: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
  • Loading branch information
elmarco committed Aug 31, 2017
1 parent 7b9a27c commit f9406b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/pci-host/piix.c
Expand Up @@ -140,7 +140,7 @@ static void i440fx_update_memory_mappings(PCII440FXState *d)
memory_region_transaction_begin();
for (i = 0; i < 13; i++) {
pam_update(&d->pam_regions[i], i,
pd->config[I440FX_PAM + ((i + 1) / 2)]);
pd->config[I440FX_PAM + (DIV_ROUND_UP(i, 2))]);
}
memory_region_set_enabled(&d->smram_region,
!(pd->config[I440FX_SMRAM] & SMRAM_D_OPEN));
Expand Down

0 comments on commit f9406b8

Please sign in to comment.