diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2024-01-02 12:57:47 +1100 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2024-02-29 11:35:36 -1000 |
commit | b61af9b0d192c23bf5bcf01f206d87b8518f216e (patch) | |
tree | aee6d2cb382a60d63010b8911432ddaa2e6b8dab /hw | |
parent | 5d2203691ed5d1657616c402d30b3143382fc25d (diff) | |
download | qemu-b61af9b0d192c23bf5bcf01f206d87b8518f216e.zip qemu-b61af9b0d192c23bf5bcf01f206d87b8518f216e.tar.gz qemu-b61af9b0d192c23bf5bcf01f206d87b8518f216e.tar.bz2 |
hw/tpm: Remove HOST_PAGE_ALIGN from tpm_ppi_init
This removes a hidden use of qemu_host_page_size, hoisting
two uses of qemu_real_host_page_size to a local variable.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/tpm/tpm_ppi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/tpm/tpm_ppi.c b/hw/tpm/tpm_ppi.c index 7f74e26..f27ed6c 100644 --- a/hw/tpm/tpm_ppi.c +++ b/hw/tpm/tpm_ppi.c @@ -47,8 +47,10 @@ void tpm_ppi_reset(TPMPPI *tpmppi) void tpm_ppi_init(TPMPPI *tpmppi, MemoryRegion *m, hwaddr addr, Object *obj) { - tpmppi->buf = qemu_memalign(qemu_real_host_page_size(), - HOST_PAGE_ALIGN(TPM_PPI_ADDR_SIZE)); + size_t host_page_size = qemu_real_host_page_size(); + + tpmppi->buf = qemu_memalign(host_page_size, + ROUND_UP(TPM_PPI_ADDR_SIZE, host_page_size)); memory_region_init_ram_device_ptr(&tpmppi->ram, obj, "tpm-ppi", TPM_PPI_ADDR_SIZE, tpmppi->buf); vmstate_register_ram(&tpmppi->ram, DEVICE(obj)); |