aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2017-06-22 13:04:16 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2017-08-31 12:29:07 +0200
commitf9406b84ba3f081dd0cd38bc28db4b8cd9134398 (patch)
tree46d6804385b30df16d499a3b2f7436f8605fa270 /hw
parent7b9a27cdbb5b510c7826b816f20259131169f9cd (diff)
piix: 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: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'hw')
-rw-r--r--hw/pci-host/piix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c
index 072a04e318..894e131c00 100644
--- a/hw/pci-host/piix.c
+++ b/hw/pci-host/piix.c
@@ -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));