From: Lai Jiangshan <[email protected]>
Use i = 0 andd i++ instead.
Signed-off-by: Lai Jiangshan <[email protected]>
---
arch/x86/kvm/mmu/mmu.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index 304a515bd073..7cfc4bc89f60 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -1886,19 +1886,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.sp[i]; 1;}); \
- i = mmu_pages_next(&pvec, i))
-
-static int mmu_pages_next(struct kvm_mmu_pages *pvec, int i)
-{
- return i + 1;
-}
-
-static int mmu_pages_first(struct kvm_mmu_pages *pvec)
-{
- return 0;
-}
+ for (i = 0; i < pvec.nr && ({ sp = pvec.sp[i]; 1;}); i++)
static int mmu_sync_children(struct kvm_vcpu *vcpu,
struct kvm_mmu_page *parent, bool can_yield)
--
2.19.1.6.gb485710b
On Sun, Jun 05, 2022, Lai Jiangshan wrote:
> From: Lai Jiangshan <[email protected]>
>
> Use i = 0 andd i++ instead.
s/andd/and, but even better would be to write a full changelog.
Drop mmu_pages_{next,first}() and open code their now trivial
implementations in for_each_sp(), the sole caller.