summaryrefslogtreecommitdiff
path: root/translate-common.c
diff options
context:
space:
mode:
authorGabriel L. Somlo <somlo@cmu.edu>2015-11-05 09:32:52 -0500
committerGerd Hoffmann <kraxel@redhat.com>2015-12-15 11:46:13 +0100
commit6c8d56a2e95712a6206a2671d2b04b2e59cabc0b (patch)
tree89627eb6848783462bc15f84576f5d1e1986f170 /translate-common.c
parent38bf20931afe761fccda6e1eb91d64c7498ed9c9 (diff)
downloadqemu-6c8d56a2e95712a6206a2671d2b04b2e59cabc0b.zip
fw_cfg: replace ioport data read with generic method
IOPort read access is limited to one byte at a time by fw_cfg_comb_valid(). As such, fw_cfg_comb_read() may safely ignore its size argument (which will always be 1), and simply call its fw_cfg_read() helper function once, returning 8 bits via the least significant byte of a 64-bit return value. This patch replaces fw_cfg_comb_read() with the generic method fw_cfg_data_read(), and removes the unused fw_cfg_read() helper. When called with size = 1, fw_cfg_data_read() acts exactly like fw_cfg_read(), performing the same set of sanity checks, and executing the while loop at most once (subject to the current read offset being within range). 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> Message-id: 1446733972-1602-7-git-send-email-somlo@cmu.edu Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'translate-common.c')
0 files changed, 0 insertions, 0 deletions