@@ -103,6 +103,7 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val)
103
103
{
104
104
unsigned index ;
105
105
bool mask_before , mask_after ;
106
+ union kvm_ioapic_redirect_entry * e ;
106
107
107
108
switch (ioapic -> ioregsel ) {
108
109
case IOAPIC_REG_VERSION :
@@ -122,19 +123,20 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val)
122
123
ioapic_debug ("change redir index %x val %x\n" , index , val );
123
124
if (index >= IOAPIC_NUM_PINS )
124
125
return ;
125
- mask_before = ioapic -> redirtbl [index ].fields .mask ;
126
+ e = & ioapic -> redirtbl [index ];
127
+ mask_before = e -> fields .mask ;
126
128
if (ioapic -> ioregsel & 1 ) {
127
- ioapic -> redirtbl [ index ]. bits &= 0xffffffff ;
128
- ioapic -> redirtbl [ index ]. bits |= (u64 ) val << 32 ;
129
+ e -> bits &= 0xffffffff ;
130
+ e -> bits |= (u64 ) val << 32 ;
129
131
} else {
130
- ioapic -> redirtbl [ index ]. bits &= ~0xffffffffULL ;
131
- ioapic -> redirtbl [ index ]. bits |= (u32 ) val ;
132
- ioapic -> redirtbl [ index ]. fields .remote_irr = 0 ;
132
+ e -> bits &= ~0xffffffffULL ;
133
+ e -> bits |= (u32 ) val ;
134
+ e -> fields .remote_irr = 0 ;
133
135
}
134
- mask_after = ioapic -> redirtbl [ index ]. fields .mask ;
136
+ mask_after = e -> fields .mask ;
135
137
if (mask_before != mask_after )
136
138
kvm_fire_mask_notifiers (ioapic -> kvm , index , mask_after );
137
- if (ioapic -> redirtbl [ index ]. fields .trig_mode == IOAPIC_LEVEL_TRIG
139
+ if (e -> fields .trig_mode == IOAPIC_LEVEL_TRIG
138
140
&& ioapic -> irr & (1 << index ))
139
141
ioapic_service (ioapic , index );
140
142
break ;
0 commit comments