[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 15/26] loader: use file path size from fw_cfg.h
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PATCH v6 15/26] loader: use file path size from fw_cfg.h |
Date: |
Sun, 29 Sep 2013 13:59:06 +0300 |
Avoid a bit of code duplication, make
max file path constant reusable.
Suggested-by: Laszlo Ersek <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
include/hw/nvram/fw_cfg.h | 4 +++-
hw/core/loader.c | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
index 2ab0fc2..72b1549 100644
--- a/include/hw/nvram/fw_cfg.h
+++ b/include/hw/nvram/fw_cfg.h
@@ -46,12 +46,14 @@
#define FW_CFG_INVALID 0xffff
+#define FW_CFG_MAX_FILE_PATH 56
+
#ifndef NO_QEMU_PROTOS
typedef struct FWCfgFile {
uint32_t size; /* file size */
uint16_t select; /* write this to 0x510 to read it */
uint16_t reserved;
- char name[56];
+ char name[FW_CFG_MAX_FILE_PATH];
} FWCfgFile;
typedef struct FWCfgFiles {
diff --git a/hw/core/loader.c b/hw/core/loader.c
index 449bd4c..060729f 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -663,7 +663,7 @@ int rom_add_file(const char *file, const char *fw_dir,
rom_insert(rom);
if (rom->fw_file && fw_cfg) {
const char *basename;
- char fw_file_name[56];
+ char fw_file_name[FW_CFG_MAX_FILE_PATH];
void *data;
basename = strrchr(rom->fw_file, '/');
--
MST
- [Qemu-devel] [PATCH v6 05/26] fw_cfg: interface to trigger callback on read, (continued)
- [Qemu-devel] [PATCH v6 05/26] fw_cfg: interface to trigger callback on read, Michael S. Tsirkin, 2013/09/29
- [Qemu-devel] [PATCH v6 01/26] qemu: add Error to typedefs, Michael S. Tsirkin, 2013/09/29
- [Qemu-devel] [PATCH v6 06/26] loader: support for unmapped ROM blobs, Michael S. Tsirkin, 2013/09/29
- [Qemu-devel] [PATCH v6 07/26] pcie_host: expose UNMAPPED macro, Michael S. Tsirkin, 2013/09/29
- [Qemu-devel] [PATCH v6 08/26] pcie_host: expose address format, Michael S. Tsirkin, 2013/09/29
- [Qemu-devel] [PATCH v6 09/26] q35: use macro for MCFG property name, Michael S. Tsirkin, 2013/09/29
- [Qemu-devel] [PATCH v6 10/26] q35: expose mmcfg size as a property, Michael S. Tsirkin, 2013/09/29
- [Qemu-devel] [PATCH v6 12/26] acpi: add rules to compile ASL source, Michael S. Tsirkin, 2013/09/29
- [Qemu-devel] [PATCH v6 11/26] i386: add ACPI table files from seabios, Michael S. Tsirkin, 2013/09/29
- [Qemu-devel] [PATCH v6 14/26] acpi: ssdt pcihp: updat generated file, Michael S. Tsirkin, 2013/09/29
- [Qemu-devel] [PATCH v6 15/26] loader: use file path size from fw_cfg.h,
Michael S. Tsirkin <=
- [Qemu-devel] [PATCH v6 13/26] acpi: pre-compiled ASL files, Michael S. Tsirkin, 2013/09/29
- [Qemu-devel] [PATCH v6 16/26] i386: add bios linker/loader, Michael S. Tsirkin, 2013/09/29
- [Qemu-devel] [PATCH v6 17/26] loader: allow adding ROMs in done callbacks, Michael S. Tsirkin, 2013/09/29
- [Qemu-devel] [PATCH v6 18/26] i386: define pc guest info, Michael S. Tsirkin, 2013/09/29
- [Qemu-devel] [PATCH v6 19/26] acpi/piix: add macros for acpi property names, Michael S. Tsirkin, 2013/09/29
- [Qemu-devel] [PATCH v6 20/26] piix: APIs for pc guest info, Michael S. Tsirkin, 2013/09/29
- [Qemu-devel] [PATCH v6 21/26] ich9: APIs for pc guest info, Michael S. Tsirkin, 2013/09/29
- [Qemu-devel] [PATCH v6 22/26] pvpanic: add API to access io port, Michael S. Tsirkin, 2013/09/29
- [Qemu-devel] [PATCH v6 23/26] hpet: add API to find it, Michael S. Tsirkin, 2013/09/29
- [Qemu-devel] [PATCH v6 24/26] i386: ACPI table generation code from seabios, Michael S. Tsirkin, 2013/09/29