summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/i8259.c
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2017-04-07 10:50:39 +0200
committerRadim Krčmář <rkrcmar@redhat.com>2017-04-12 20:17:15 +0200
commit84a5c79e7048b94100d28f313b00dcbbe457c398 (patch)
treeb47e3f97df0b89e1d17f67e0b893c6ca12d1f058 /arch/x86/kvm/i8259.c
parentKVM: x86: drop picdev_in_range() (diff)
downloadlinux-84a5c79e7048b94100d28f313b00dcbbe457c398.tar.xz
linux-84a5c79e7048b94100d28f313b00dcbbe457c398.zip
KVM: x86: set data directly in picdev_read()
Now it looks almost as picdev_write(). Signed-off-by: David Hildenbrand <david@redhat.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Diffstat (limited to 'arch/x86/kvm/i8259.c')
-rw-r--r--arch/x86/kvm/i8259.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
index 5b5c87f4d8bd..d481f3346eb5 100644
--- a/arch/x86/kvm/i8259.c
+++ b/arch/x86/kvm/i8259.c
@@ -484,7 +484,7 @@ static int picdev_write(struct kvm_pic *s,
static int picdev_read(struct kvm_pic *s,
gpa_t addr, int len, void *val)
{
- unsigned char data = 0;
+ unsigned char *data = (unsigned char *)val;
if (len != 1) {
memset(val, 0, len);
@@ -497,19 +497,18 @@ static int picdev_read(struct kvm_pic *s,
case 0xa0:
case 0xa1:
pic_lock(s);
- data = pic_ioport_read(&s->pics[addr >> 7], addr);
+ *data = pic_ioport_read(&s->pics[addr >> 7], addr);
pic_unlock(s);
break;
case 0x4d0:
case 0x4d1:
pic_lock(s);
- data = elcr_ioport_read(&s->pics[addr & 1], addr);
+ *data = elcr_ioport_read(&s->pics[addr & 1], addr);
pic_unlock(s);
break;
default:
return -EOPNOTSUPP;
}
- *(unsigned char *)val = data;
return 0;
}