diff mbox series

[4/5] kvm/kvm_main: The npages variable does not need to be initialized and assigned, it is used after assignment

Message ID 20220812103009.8362-1-kunyu@nfschina.com (mailing list archive)
State New, archived
Headers show
Series [1/5] kvm/kvm_main: Modify the offset type to size_t, which is consistent with the calling function | expand

Commit Message

Li kunyu Aug. 12, 2022, 10:30 a.m. UTC
The npages variable does not need to be initialized and assigned, it is
first assigned before it is used.

Signed-off-by: Li kunyu <kunyu@nfschina.com>
---
 virt/kvm/kvm_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sean Christopherson Aug. 18, 2022, 11:51 p.m. UTC | #1
Please use "KVM: " for the shortlog scope, and write an actual shortlog.  E.g.

  KVM: Drop unnecessary initialization of "npages" in hva_to_pfn_slow()

On Fri, Aug 12, 2022, Li kunyu wrote:
> The npages variable does not need to be initialized and assigned, it is
> first assigned before it is used.
> 
> Signed-off-by: Li kunyu <kunyu@nfschina.com>
> ---

With a proper shortlog,

Reviewed-by: Sean Christopherson <seanjc@google.com>
Li kunyu Aug. 19, 2022, 1:32 a.m. UTC | #2
thanks, re-send these two patches after modification.
diff mbox series

Patch

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 82f2b90718a9..f047799bf19b 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -2516,7 +2516,7 @@  static int hva_to_pfn_slow(unsigned long addr, bool *async, bool write_fault,
 {
 	unsigned int flags = FOLL_HWPOISON;
 	struct page *page;
-	int npages = 0;
+	int npages;
 
 	might_sleep();