提交 31389947 编写于 作者: N Nguyen Anh Quynh 提交者: Avi Kivity

KVM: Remove unnecessary initialization and checks in mark_page_dirty()

Signed-off-by: NAvi Kivity <avi@qumranet.com>
上级 50a3485c
...@@ -970,7 +970,7 @@ EXPORT_SYMBOL_GPL(gfn_to_page); ...@@ -970,7 +970,7 @@ EXPORT_SYMBOL_GPL(gfn_to_page);
void mark_page_dirty(struct kvm *kvm, gfn_t gfn) void mark_page_dirty(struct kvm *kvm, gfn_t gfn)
{ {
int i; int i;
struct kvm_memory_slot *memslot = NULL; struct kvm_memory_slot *memslot;
unsigned long rel_gfn; unsigned long rel_gfn;
for (i = 0; i < kvm->nmemslots; ++i) { for (i = 0; i < kvm->nmemslots; ++i) {
...@@ -979,7 +979,7 @@ void mark_page_dirty(struct kvm *kvm, gfn_t gfn) ...@@ -979,7 +979,7 @@ void mark_page_dirty(struct kvm *kvm, gfn_t gfn)
if (gfn >= memslot->base_gfn if (gfn >= memslot->base_gfn
&& gfn < memslot->base_gfn + memslot->npages) { && gfn < memslot->base_gfn + memslot->npages) {
if (!memslot || !memslot->dirty_bitmap) if (!memslot->dirty_bitmap)
return; return;
rel_gfn = gfn - memslot->base_gfn; rel_gfn = gfn - memslot->base_gfn;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册