From: Lai Jiangshan <jiangshan.ljs@xxxxxxxxxxxx> struct kvm_mmu_page *sp is the only field in struct mmu_page_and_offset. Unfold it. Signed-off-by: Lai Jiangshan <jiangshan.ljs@xxxxxxxxxxxx> --- arch/x86/kvm/mmu/mmu.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index dc159db46b34..a5563e5ee2e5 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -1743,9 +1743,7 @@ static int nonpaging_sync_page(struct kvm_vcpu *vcpu, #define KVM_PAGE_ARRAY_NR 16 struct kvm_mmu_pages { - struct mmu_page_and_offset { - struct kvm_mmu_page *sp; - } page[KVM_PAGE_ARRAY_NR]; + struct kvm_mmu_page *sp[KVM_PAGE_ARRAY_NR]; unsigned int nr; }; @@ -1755,10 +1753,10 @@ static int mmu_pages_add(struct kvm_mmu_pages *pvec, struct kvm_mmu_page *sp) if (sp->unsync) for (i=0; i < pvec->nr; i++) - if (pvec->page[i].sp == sp) + if (pvec->sp[i] == sp) return 0; - pvec->page[pvec->nr].sp = sp; + pvec->sp[pvec->nr] = sp; pvec->nr++; return (pvec->nr == KVM_PAGE_ARRAY_NR); } @@ -1894,7 +1892,7 @@ static bool is_obsolete_sp(struct kvm *kvm, struct kvm_mmu_page *sp) #define for_each_sp(pvec, sp, i) \ for (i = mmu_pages_first(&pvec); \ - i < pvec.nr && ({ sp = pvec.page[i].sp; 1;}); \ + i < pvec.nr && ({ sp = pvec.sp[i]; 1;}); \ i = mmu_pages_next(&pvec, i)) static int mmu_pages_next(struct kvm_mmu_pages *pvec, int i) @@ -1902,7 +1900,7 @@ static int mmu_pages_next(struct kvm_mmu_pages *pvec, int i) int n; for (n = i+1; n < pvec->nr; n++) { - struct kvm_mmu_page *sp = pvec->page[n].sp; + struct kvm_mmu_page *sp = pvec->sp[n]; int level = sp->role.level; if (level == PG_LEVEL_4K) @@ -1921,7 +1919,7 @@ static int mmu_pages_first(struct kvm_mmu_pages *pvec) if (pvec->nr == 0) return 0; - sp = pvec->page[0].sp; + sp = pvec->sp[0]; level = sp->role.level; WARN_ON(level == PG_LEVEL_4K); -- 2.19.1.6.gb485710b