[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 10/14] hw/mips/malta: Remove fl_sectors variable
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH v3 10/14] hw/mips/malta: Remove fl_sectors variable |
Date: |
Thu, 7 Mar 2019 14:03:19 +0100 |
From: Philippe Mathieu-Daudé <address@hidden>
Variable fl_sectors is used just twice. Since
fl_sectors = bios_size >> 16 and bios_size = FLASH_SIZE there,
we can simply use FLASH_SIZE >> 16, and eliminate variable.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
---
hw/mips/mips_malta.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index 639ccefa98..750ea86b63 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -1210,7 +1210,6 @@ void mips_malta_init(MachineState *machine)
DriveInfo *dinfo;
DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
int fl_idx = 0;
- int fl_sectors = bios_size >> 16;
int be;
DeviceState *dev = qdev_create(NULL, TYPE_MIPS_MALTA);
@@ -1273,13 +1272,13 @@ void mips_malta_init(MachineState *machine)
printf("Register parallel flash %d size " TARGET_FMT_lx " at "
"addr %08llx '%s' %x\n",
fl_idx, blk_getlength(pflash_blk), FLASH_ADDRESS,
- blk_name(pflash_blk), fl_sectors);
+ blk_name(pflash_blk), FLASH_SIZE >> 16);
#endif
}
fl = pflash_cfi01_register(FLASH_ADDRESS, NULL, "mips_malta.bios",
BIOS_SIZE,
pflash_blk,
- 65536, fl_sectors,
+ 65536, FLASH_SIZE >> 16,
4, 0x0000, 0x0000, 0x0000, 0x0000, be);
bios = pflash_cfi01_get_memory(fl);
fl_idx++;
--
2.17.2
- [Qemu-devel] [PATCH v3 00/14] pflash: Fixes and cleanups, Markus Armbruster, 2019/03/07
- [Qemu-devel] [PATCH v3 10/14] hw/mips/malta: Remove fl_sectors variable,
Markus Armbruster <=
- [Qemu-devel] [PATCH v3 04/14] pflash: Rename *CFI_PFLASH* to *PFLASH_CFI*, Markus Armbruster, 2019/03/07
- [Qemu-devel] [PATCH v3 02/14] pflash_cfi01: Do not exit() on guest aborting "write to buffer", Markus Armbruster, 2019/03/07
- [Qemu-devel] [PATCH v3 12/14] mips_malta: Clean up definition of flash memory size somewhat, Markus Armbruster, 2019/03/07
- [Qemu-devel] [PATCH v3 01/14] pflash: Rename pflash_t to PFlashCFI01, PFlashCFI02, Markus Armbruster, 2019/03/07
- [Qemu-devel] [PATCH v3 13/14] pflash: Clean up after commit 368a354f02b, part 1, Markus Armbruster, 2019/03/07
- [Qemu-devel] [PATCH v3 09/14] hw/mips/malta: Fix the DEBUG_BOARD_INIT code, Markus Armbruster, 2019/03/07
- [Qemu-devel] [PATCH v3 14/14] pflash: Clean up after commit 368a354f02b, part 2, Markus Armbruster, 2019/03/07
- [Qemu-devel] [PATCH v3 06/14] sam460ex: Don't size flash memory to match backing image, Markus Armbruster, 2019/03/07