diff mbox series

[1/8] fw_cfg_mem: add read memory region callback

Message ID 20180912160118.21158-2-liq3ea@163.com
State New
Headers show
Series Add missed read callback for some memory region | expand

Commit Message

Li Qiang Sept. 12, 2018, 4:01 p.m. UTC
From: Li Qiang <liq3ea@gmail.com>

Signed-off-by: Li Qiang <liq3ea@gmail.com>
---
 hw/nvram/fw_cfg.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Eric Blake Sept. 12, 2018, 4:48 p.m. UTC | #1
On 9/12/18 11:01 AM, Li Qiang wrote:
> From: Li Qiang <liq3ea@gmail.com>
> 
> Signed-off-by: Li Qiang <liq3ea@gmail.com>

This commit message doesn't state why. The cover letter does, but that 
doesn't get checked into git. A year from now, if someone lands on this 
commit during a bisect, it would help if the commit message told them 
why you are adding a no-op callback here, instead of trying to fix the 
caller to treat a NULL callback as acceptable.
diff mbox series

Patch

diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index d79a568f54..6de7809f1a 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -434,6 +434,11 @@  static bool fw_cfg_data_mem_valid(void *opaque, hwaddr addr,
     return addr == 0;
 }
 
+static uint64_t fw_cfg_ctl_mem_read(void *opaque, hwaddr addr, unsigned size)
+{
+    return 0;
+}
+
 static void fw_cfg_ctl_mem_write(void *opaque, hwaddr addr,
                                  uint64_t value, unsigned size)
 {
@@ -468,6 +473,7 @@  static bool fw_cfg_comb_valid(void *opaque, hwaddr addr,
 }
 
 static const MemoryRegionOps fw_cfg_ctl_mem_ops = {
+    .read = fw_cfg_ctl_mem_read,
     .write = fw_cfg_ctl_mem_write,
     .endianness = DEVICE_BIG_ENDIAN,
     .valid.accepts = fw_cfg_ctl_mem_valid,