@@ -255,15 +255,10 @@ static void fw_cfg_write(FWCfgState *s, uint8_t value)
/* nothing, write support removed in QEMU v2.4+ */
}
-static inline uint16_t fw_cfg_file_slots(const FWCfgState *s)
-{
- return FW_CFG_FILE_SLOTS_DFLT;
-}
-
/* Note: this function returns an exclusive limit. */
static inline uint32_t fw_cfg_max_entry(const FWCfgState *s)
{
- return FW_CFG_FILE_FIRST + fw_cfg_file_slots(s);
+ return FW_CFG_FILE_FIRST + FW_CFG_FILE_SLOTS_DFLT;
}
static int fw_cfg_select(FWCfgState *s, uint16_t key)
@@ -845,13 +840,13 @@ void fw_cfg_add_file_callback(FWCfgState *s, const char *filename,
int order = 0;
if (!s->files) {
- dsize = sizeof(uint32_t) + sizeof(FWCfgFile) * fw_cfg_file_slots(s);
+ dsize = sizeof(uint32_t) + sizeof(FWCfgFile) * FW_CFG_FILE_SLOTS_DFLT;
s->files = g_malloc0(dsize);
fw_cfg_add_bytes(s, FW_CFG_FILE_DIR, s->files, dsize);
}
count = be32_to_cpu(s->files->count);
- assert(count < fw_cfg_file_slots(s));
+ assert(count < FW_CFG_FILE_SLOTS_DFLT);
/* Find the insertion point, sorting by file name. */
for (index = count;
@@ -926,7 +921,7 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *filename,
}
}
- assert(index < fw_cfg_file_slots(s));
+ assert(index < FW_CFG_FILE_SLOTS_DFLT);
/* add new one */
fw_cfg_add_file_callback(s, filename, NULL, NULL, NULL, data, len, true);
Now than fw_cfg_file_slots() only returns FW_CFG_FILE_SLOTS_DFLT, we can inline it. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- hw/nvram/fw_cfg.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)