From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtFvx-0002qN-Sc for qemu-devel@nongnu.org; Mon, 02 Nov 2015 09:18:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtFvt-0006CF-JE for qemu-devel@nongnu.org; Mon, 02 Nov 2015 09:18:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50903) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtFvt-0006C9-Bs for qemu-devel@nongnu.org; Mon, 02 Nov 2015 09:18:01 -0500 References: <1446052836-31737-1-git-send-email-somlo@cmu.edu> <1446052836-31737-4-git-send-email-somlo@cmu.edu> From: Laszlo Ersek Message-ID: <56377096.60302@redhat.com> Date: Mon, 2 Nov 2015 15:17:58 +0100 MIME-Version: 1.0 In-Reply-To: <1446052836-31737-4-git-send-email-somlo@cmu.edu> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 3/4] fw_cfg: remove offset argument from callback prototype List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gabriel L. Somlo" , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, markmb@redhat.com, pbonzini@redhat.com, kraxel@redhat.com, jordan.l.justen@intel.com On 10/28/15 18:20, Gabriel L. Somlo wrote: > 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. >=20 > 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). >=20 > Cc: Laszlo Ersek > Cc: Gerd Hoffmann > Cc: Marc Mar=C3=AD > Signed-off-by: Gabriel Somlo > --- > hw/arm/virt-acpi-build.c | 2 +- > hw/i386/acpi-build.c | 2 +- > hw/nvram/fw_cfg.c | 2 +- > include/hw/nvram/fw_cfg.h | 3 +-- > 4 files changed, 4 insertions(+), 5 deletions(-) >=20 > diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c > index 1aaff1f..4eed24d 100644 > --- a/hw/arm/virt-acpi-build.c > +++ b/hw/arm/virt-acpi-build.c > @@ -626,7 +626,7 @@ static void acpi_ram_update(MemoryRegion *mr, GArra= y *data) > memory_region_set_dirty(mr, 0, size); > } > =20 > -static void virt_acpi_build_update(void *build_opaque, uint32_t offset= ) > +static void virt_acpi_build_update(void *build_opaque) > { > AcpiBuildState *build_state =3D build_opaque; > AcpiBuildTables tables; > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c > index 95e0c65..29e30ce 100644 > --- a/hw/i386/acpi-build.c > +++ b/hw/i386/acpi-build.c > @@ -1818,7 +1818,7 @@ static void acpi_ram_update(MemoryRegion *mr, GAr= ray *data) > memory_region_set_dirty(mr, 0, size); > } > =20 > -static void acpi_build_update(void *build_opaque, uint32_t offset) > +static void acpi_build_update(void *build_opaque) > { > AcpiBuildState *build_state =3D build_opaque; > AcpiBuildTables tables; > diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c > index 31fa5c8..5de6dbc 100644 > --- a/hw/nvram/fw_cfg.c > +++ b/hw/nvram/fw_cfg.c > @@ -266,7 +266,7 @@ static int fw_cfg_select(FWCfgState *s, uint16_t ke= y) > arch =3D !!(key & FW_CFG_ARCH_LOCAL); > e =3D &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); > } > } > =20 > diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h > index 47ff118..6c459f3 100644 > --- a/include/hw/nvram/fw_cfg.h > +++ b/include/hw/nvram/fw_cfg.h > @@ -70,8 +70,7 @@ typedef struct FWCfgDmaAccess { > uint64_t address; > } QEMU_PACKED FWCfgDmaAccess; > =20 > -typedef void (*FWCfgCallback)(void *opaque, uint8_t *data); > -typedef void (*FWCfgReadCallback)(void *opaque, uint32_t offset); > +typedef void (*FWCfgReadCallback)(void *opaque); > =20 > /** > * fw_cfg_add_bytes: >=20 Reviewed-by: Laszlo Ersek