fw_cfg: remove offset argument from callback prototype
authorGabriel L. Somlo <somlo@cmu.edu>
Thu, 5 Nov 2015 14:32:49 +0000 (09:32 -0500)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 15 Dec 2015 10:45:59 +0000 (11:45 +0100)
Read callbacks are now only invoked at item selection, before any
data is read. As such, the value of the offset argument passed to
the callback will always be 0. Also, the two callback instances
currently in use both leave their offset argument unused.

This patch removes the offset argument from the fw_cfg read callback
prototype, and from the currently available instances. The unused
(write) callback prototype is also removed (write support was removed
earlier, in commit 023e3148).

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Marc MarĂ­ <markmb@redhat.com>
Signed-off-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1446733972-1602-4-git-send-email-somlo@cmu.edu
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/arm/virt-acpi-build.c
hw/i386/acpi-build.c
hw/nvram/fw_cfg.c
include/hw/nvram/fw_cfg.h

index 3c2c5d6bfa9265eefa3975aacd5dc7a5a4c05d22..8fd0b1c57b8049dfecb8ac9cfacabac9ebb33ec4 100644 (file)
@@ -631,7 +631,7 @@ static void acpi_ram_update(MemoryRegion *mr, GArray *data)
     memory_region_set_dirty(mr, 0, size);
 }
 
-static void virt_acpi_build_update(void *build_opaque, uint32_t offset)
+static void virt_acpi_build_update(void *build_opaque)
 {
     AcpiBuildState *build_state = build_opaque;
     AcpiBuildTables tables;
index 95e0c657a7b3417d1d9c774fe5ced73b87e17d4e..29e30ce79a1a4f0b9483916eb562b7e98565d25f 100644 (file)
@@ -1818,7 +1818,7 @@ static void acpi_ram_update(MemoryRegion *mr, GArray *data)
     memory_region_set_dirty(mr, 0, size);
 }
 
-static void acpi_build_update(void *build_opaque, uint32_t offset)
+static void acpi_build_update(void *build_opaque)
 {
     AcpiBuildState *build_state = build_opaque;
     AcpiBuildTables tables;
index 6e6414b723171f80783eba8d0e11e4ba740e95ad..c2d3a0a5489c93a0ee2b3076b771034977cdaaae 100644 (file)
@@ -266,7 +266,7 @@ static int fw_cfg_select(FWCfgState *s, uint16_t key)
         arch = !!(key & FW_CFG_ARCH_LOCAL);
         e = &s->entries[arch][key & FW_CFG_ENTRY_MASK];
         if (e->read_callback) {
-            e->read_callback(e->callback_opaque, s->cur_offset);
+            e->read_callback(e->callback_opaque);
         }
     }
 
index a1cfaa4a2fcc2517ba378394d326682aa8060d38..664eaf6452b8bcb8a4671115db3ac37cfdfd3c6c 100644 (file)
@@ -70,8 +70,7 @@ typedef struct FWCfgDmaAccess {
     uint64_t address;
 } QEMU_PACKED FWCfgDmaAccess;
 
-typedef void (*FWCfgCallback)(void *opaque, uint8_t *data);
-typedef void (*FWCfgReadCallback)(void *opaque, uint32_t offset);
+typedef void (*FWCfgReadCallback)(void *opaque);
 
 /**
  * fw_cfg_add_bytes: