KVM: x86: simplify pic_ioport_read()
authorDavid Hildenbrand <david@redhat.com>
Fri, 7 Apr 2017 08:50:40 +0000 (10:50 +0200)
committerRadim Krčmář <rkrcmar@redhat.com>
Wed, 12 Apr 2017 18:17:15 +0000 (20:17 +0200)
Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/i8259.c

index d481f3346eb5ba076007f51cb5476a64e6549a10..bdcd4139eca9233bbd9e82615a1ed3c45c2ad060 100644 (file)
@@ -417,19 +417,16 @@ static u32 pic_poll_read(struct kvm_kpic_state *s, u32 addr1)
        return ret;
 }
 
-static u32 pic_ioport_read(void *opaque, u32 addr1)
+static u32 pic_ioport_read(void *opaque, u32 addr)
 {
        struct kvm_kpic_state *s = opaque;
-       unsigned int addr;
        int ret;
 
-       addr = addr1;
-       addr &= 1;
        if (s->poll) {
-               ret = pic_poll_read(s, addr1);
+               ret = pic_poll_read(s, addr);
                s->poll = 0;
        } else
-               if (addr == 0)
+               if ((addr & 1) == 0)
                        if (s->read_reg_select)
                                ret = s->isr;
                        else