aboutsummaryrefslogtreecommitdiff
path: root/hw/block/pflash_cfi01.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2019-06-26 18:40:09 +0200
committerPhilippe Mathieu-Daudé <philmd@redhat.com>2019-07-02 02:16:50 +0200
commitc1474acd5d284d69d1543713ef00b90b9712619f (patch)
tree3b25ad7b890d0db6b239db39c37cdf9c68ec0b71 /hw/block/pflash_cfi01.c
parente8aa2d95ea2015ce95d712543c78e09a0130be3b (diff)
downloadqemu-c1474acd5d284d69d1543713ef00b90b9712619f.zip
qemu-c1474acd5d284d69d1543713ef00b90b9712619f.tar.gz
qemu-c1474acd5d284d69d1543713ef00b90b9712619f.tar.bz2
hw/block/pflash: Simplify trace_pflash_data_read/write()
Use a field width format to have a single function to log the different width accesses. Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20190627202719.17739-4-philmd@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'hw/block/pflash_cfi01.c')
-rw-r--r--hw/block/pflash_cfi01.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c
index 74fc1bc..db4a246 100644
--- a/hw/block/pflash_cfi01.c
+++ b/hw/block/pflash_cfi01.c
@@ -248,7 +248,6 @@ static uint32_t pflash_data_read(PFlashCFI01 *pfl, hwaddr offset,
switch (width) {
case 1:
ret = p[offset];
- trace_pflash_data_read8(offset, ret);
break;
case 2:
if (be) {
@@ -258,7 +257,6 @@ static uint32_t pflash_data_read(PFlashCFI01 *pfl, hwaddr offset,
ret = p[offset];
ret |= p[offset + 1] << 8;
}
- trace_pflash_data_read16(offset, ret);
break;
case 4:
if (be) {
@@ -272,12 +270,12 @@ static uint32_t pflash_data_read(PFlashCFI01 *pfl, hwaddr offset,
ret |= p[offset + 2] << 16;
ret |= p[offset + 3] << 24;
}
- trace_pflash_data_read32(offset, ret);
break;
default:
DPRINTF("BUG in %s\n", __func__);
abort();
}
+ trace_pflash_data_read(offset, width << 1, ret);
return ret;
}
@@ -415,7 +413,7 @@ static inline void pflash_data_write(PFlashCFI01 *pfl, hwaddr offset,
{
uint8_t *p = pfl->storage;
- trace_pflash_data_write(offset, value, width, pfl->counter);
+ trace_pflash_data_write(offset, width << 1, value, pfl->counter);
switch (width) {
case 1:
p[offset] = value;