mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-01 10:43:43 +00:00
KVM: Allow calling kvm_release_page_{clean,dirty}() on a NULL page pointer
Allow passing a NULL @page to kvm_release_page_{clean,dirty}(), there's no tangible benefit to forcing the callers to pre-check @page, and it ends up generating a lot of duplicate boilerplate code. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Tested-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Sean Christopherson <seanjc@google.com> Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20241010182427.1434605-3-seanjc@google.com>
This commit is contained in:
parent
037bc38b29
commit
85e88b2bba
@ -3167,7 +3167,7 @@ static void kvm_set_page_accessed(struct page *page)
|
||||
|
||||
void kvm_release_page_clean(struct page *page)
|
||||
{
|
||||
if (WARN_ON(!page))
|
||||
if (!page)
|
||||
return;
|
||||
|
||||
kvm_set_page_accessed(page);
|
||||
@ -3192,7 +3192,7 @@ EXPORT_SYMBOL_GPL(kvm_release_pfn_clean);
|
||||
|
||||
void kvm_release_page_dirty(struct page *page)
|
||||
{
|
||||
if (WARN_ON(!page))
|
||||
if (!page)
|
||||
return;
|
||||
|
||||
kvm_set_page_dirty(page);
|
||||
|
Loading…
Reference in New Issue
Block a user