diff options
author | hbuxiaofei <hbuxiaofei@gmail.com> | 2022-11-02 16:05:01 +0800 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2022-11-08 15:32:42 +0000 |
commit | 5a9cde6532ea2caf690a30d31da6c4ed658e3643 (patch) | |
tree | d0952757d418a08f3ea12839cb2a9b52c813101c | |
parent | 78771e779a3aca3f6d7ce7aff60ae0f835fbc14f (diff) | |
download | kvmtool-5a9cde6532ea2caf690a30d31da6c4ed658e3643.tar.gz |
hw/i8042: Fix value uninitialized in kbd_io()
GCC Version:
gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1)
hw/i8042.c: In function ‘kbd_io’:
hw/i8042.c:153:19: error: ‘value’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
state.write_cmd = val;
~~~~~~~~~~~~~~~~^~~~~
hw/i8042.c:298:5: note: ‘value’ was declared here
u8 value;
^~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:508: hw/i8042.o] Error 1
Signed-off-by: hbuxiaofei <hbuxiaofei@gmail.com>
Link: https://lore.kernel.org/r/20221102080501.69274-1-hbuxiaofei@gmail.com
Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r-- | hw/i8042.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -295,7 +295,7 @@ static void kbd_reset(void) static void kbd_io(struct kvm_cpu *vcpu, u64 addr, u8 *data, u32 len, u8 is_write, void *ptr) { - u8 value; + u8 value = 0; if (is_write) value = ioport__read8(data); |