projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5d22036
)
hw/tpm: Remove HOST_PAGE_ALIGN from tpm_ppi_init
author
Richard Henderson
<richard.henderson@linaro.org>
Tue, 2 Jan 2024 01:57:47 +0000
(12:57 +1100)
committer
Richard Henderson
<richard.henderson@linaro.org>
Thu, 29 Feb 2024 21:35:36 +0000
(11:35 -1000)
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>
hw/tpm/tpm_ppi.c
patch
|
blob
|
history
diff --git
a/hw/tpm/tpm_ppi.c
b/hw/tpm/tpm_ppi.c
index 7f74e26ec6c9fb10ce3b76a25956a7c58a8b946e..f27ed6c35ed81ba1cd9b18dfd46830830d7df578 100644
(file)
--- 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));