Skip to content

Commit 70f93da

Browse files
Gleb Natapovavikivity
authored andcommitted
KVM: Use temporary variable to shorten lines.
Cosmetic only. No logic is changed by this patch. Signed-off-by: Gleb Natapov <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
1 parent 0105d1a commit 70f93da

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

virt/kvm/ioapic.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val)
103103
{
104104
unsigned index;
105105
bool mask_before, mask_after;
106+
union kvm_ioapic_redirect_entry *e;
106107

107108
switch (ioapic->ioregsel) {
108109
case IOAPIC_REG_VERSION:
@@ -122,19 +123,20 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val)
122123
ioapic_debug("change redir index %x val %x\n", index, val);
123124
if (index >= IOAPIC_NUM_PINS)
124125
return;
125-
mask_before = ioapic->redirtbl[index].fields.mask;
126+
e = &ioapic->redirtbl[index];
127+
mask_before = e->fields.mask;
126128
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;
129131
} 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;
133135
}
134-
mask_after = ioapic->redirtbl[index].fields.mask;
136+
mask_after = e->fields.mask;
135137
if (mask_before != mask_after)
136138
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
138140
&& ioapic->irr & (1 << index))
139141
ioapic_service(ioapic, index);
140142
break;

0 commit comments

Comments
 (0)