Re: [PATCH 2/2] KVM: fix some typo and one code style

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2018-11-05 14:45+0800, Wei Yang:
> This patch fix some typo in comment and merge two lines to one within 80
> characters.
> 
> Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx>
> ---
> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
> @@ -4240,7 +4240,7 @@ static inline bool is_last_gpte(struct kvm_mmu *mmu,
>  				unsigned level, unsigned gpte)
>  {
>  	/*
> -	 * The RHS has bit 7 set iff level < mmu->last_nonleaf_level.
> +	 * The RHS has bit 7 set if level < mmu->last_nonleaf_level.
>  	 * If it is clear, there are no large pages at this level, so clear
>  	 * PT_PAGE_SIZE_MASK in gpte if that is the case.
>  	 */
> @@ -4248,7 +4248,7 @@ static inline bool is_last_gpte(struct kvm_mmu *mmu,
>  
>  	/*
>  	 * PT_PAGE_TABLE_LEVEL always terminates.  The RHS has bit 7 set
> -	 * iff level <= PT_PAGE_TABLE_LEVEL, which for our purpose means

Both "iff" look intended as it stands for "if and only if".

> +	 * if level <= PT_PAGE_TABLE_LEVEL, which for our purpose means
>  	 * level == PT_PAGE_TABLE_LEVEL; set PT_PAGE_SIZE_MASK in gpte then.
>  	 */
>  	gpte |= level - PT_PAGE_TABLE_LEVEL - 1;
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> @@ -9531,7 +9531,7 @@ static void kvm_del_async_pf_gfn(struct kvm_vcpu *vcpu, gfn_t gfn)
>  				return;
>  			k = kvm_async_pf_hash_fn(vcpu->arch.apf.gfns[j]);
>  			/*
> -			 * k lies cyclically in ]i,j]
> +			 * k lies cyclically in [i,j]

And here, I think the notation is to hint the two cases where the range
is either (i,k] or [0,j] ∪ (i,max].  I don't think it contains enough
information to distinguish ( and [ with any useful interpretation, so
rewriting it sounds better.  [i,j] is even worse, though.

I don't really see how to do that without being verbose and maybe
someone understands that notation, so I'll keep it for now.

>  			 * |    i.k.j |
>  			 * |....j i.k.| or  |.k..j i...|
>  			 */
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> @@ -1569,8 +1569,7 @@ kvm_pfn_t __gfn_to_pfn_memslot(struct kvm_memory_slot *slot, gfn_t gfn,
>  		writable = NULL;
>  	}
>  
> -	return hva_to_pfn(addr, atomic, async, write_fault,
> -			  writable);
> +	return hva_to_pfn(addr, atomic, async, write_fault, writable);

I generally prefer patches to do only one thing.  In this case fixing
typos so I also dropped this hunk while queueing,

thanks.



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux