From: Shivank Garg <shivankg@amd.com>
To: <pbonzini@redhat.com>, <seanjc@google.com>
Cc: <david@redhat.com>, <kvm@vger.kernel.org>,
<linux-coco@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
<shivankg@amd.com>
Subject: [PATCH V3 kvm-x86/gmem 2/2] KVM: guest_memfd: remove redundant gmem variable initialization
Date: Sun, 12 Oct 2025 07:16:07 +0000 [thread overview]
Message-ID: <20251012071607.17646-2-shivankg@amd.com> (raw)
In-Reply-To: <20251012071607.17646-1-shivankg@amd.com>
Remove redundant initialization of gmem in __kvm_gmem_get_pfn() as it is
already initialized at the top of the function.
No functional change intended.
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Shivank Garg <shivankg@amd.com>
---
Changelog:
V3:
- Split into distinct patches per Sean's feedback, drop whitespace and
ULONG_MAX change.
V2:
- https://lore.kernel.org/all/20250902080307.153171-2-shivankg@amd.com
- Incorporate David's suggestions.
V1:
- https://lore.kernel.org/all/20250901051532.207874-3-shivankg@amd.com
virt/kvm/guest_memfd.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/virt/kvm/guest_memfd.c b/virt/kvm/guest_memfd.c
index 22dacf49a04d..caa87efc8f7a 100644
--- a/virt/kvm/guest_memfd.c
+++ b/virt/kvm/guest_memfd.c
@@ -668,7 +668,6 @@ static struct folio *__kvm_gmem_get_pfn(struct file *file,
return ERR_PTR(-EFAULT);
}
- gmem = file->private_data;
if (xa_load(&gmem->bindings, index) != slot) {
WARN_ON_ONCE(xa_load(&gmem->bindings, index));
return ERR_PTR(-EIO);
--
2.43.0
next prev parent reply other threads:[~2025-10-12 7:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-12 7:16 [PATCH V3 kvm-x86/gmem 1/2] KVM: guest_memfd: move kvm_gmem_get_index() and use in kvm_gmem_prepare_folio() Shivank Garg
2025-10-12 7:16 ` Shivank Garg [this message]
2025-10-13 14:04 ` Sean Christopherson
2025-10-13 18:16 ` Sean Christopherson
2025-10-14 5:49 ` Garg, Shivank
2025-10-14 13:28 ` Sean Christopherson
2025-10-15 18:02 ` Sean Christopherson
2025-10-16 5:27 ` Garg, Shivank
2025-10-20 15:51 ` Sean Christopherson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251012071607.17646-2-shivankg@amd.com \
--to=shivankg@amd.com \
--cc=david@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-coco@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.