LKML Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] KVM: x86: Fix print format and coding style
@ 2020-02-15  2:44 linmiaohe
  2020-02-17  8:57 ` Vitaly Kuznetsov
  0 siblings, 1 reply; 4+ messages in thread
From: linmiaohe @ 2020-02-15  2:44 UTC (permalink / raw)
  To: pbonzini, rkrcmar, sean.j.christopherson, vkuznets, wanpengli,
	jmattson, joro, tglx, mingo, bp, hpa
  Cc: linmiaohe, kvm, linux-kernel, x86

From: Miaohe Lin <linmiaohe@huawei.com>

Use %u to print u32 var and correct some coding style.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 arch/x86/kvm/i8254.c      | 2 +-
 arch/x86/kvm/mmu/mmu.c    | 3 +--
 arch/x86/kvm/vmx/nested.c | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
index b24c606ac04b..febca334c320 100644
--- a/arch/x86/kvm/i8254.c
+++ b/arch/x86/kvm/i8254.c
@@ -367,7 +367,7 @@ static void pit_load_count(struct kvm_pit *pit, int channel, u32 val)
 {
 	struct kvm_kpit_state *ps = &pit->pit_state;
 
-	pr_debug("load_count val is %d, channel is %d\n", val, channel);
+	pr_debug("load_count val is %u, channel is %d\n", val, channel);
 
 	/*
 	 * The largest possible initial count is 0; this is equivalent
diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index 7011a4e54866..9c228b9910b1 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -3568,8 +3568,7 @@ static bool fast_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa,
 		 * write-protected for dirty-logging or access tracking.
 		 */
 		if ((error_code & PFERR_WRITE_MASK) &&
-		    spte_can_locklessly_be_made_writable(spte))
-		{
+		    spte_can_locklessly_be_made_writable(spte)) {
 			new_spte |= PT_WRITABLE_MASK;
 
 			/*
diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index f2d8cb68dce8..6f3e515f28fd 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -4367,7 +4367,7 @@ int get_vmx_mem_address(struct kvm_vcpu *vcpu, unsigned long exit_qualification,
 	if (base_is_valid)
 		off += kvm_register_read(vcpu, base_reg);
 	if (index_is_valid)
-		off += kvm_register_read(vcpu, index_reg)<<scaling;
+		off += kvm_register_read(vcpu, index_reg) << scaling;
 	vmx_get_segment(vcpu, &s, seg_reg);
 
 	/*
-- 
2.19.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] KVM: x86: Fix print format and coding style
  2020-02-15  2:44 [PATCH] KVM: x86: Fix print format and coding style linmiaohe
@ 2020-02-17  8:57 ` Vitaly Kuznetsov
  2020-02-17 17:07   ` Paolo Bonzini
  0 siblings, 1 reply; 4+ messages in thread
From: Vitaly Kuznetsov @ 2020-02-17  8:57 UTC (permalink / raw)
  To: linmiaohe
  Cc: kvm, linux-kernel, x86, pbonzini, rkrcmar, sean.j.christopherson,
	wanpengli, jmattson, joro, tglx, mingo, bp, hpa

linmiaohe <linmiaohe@huawei.com> writes:

> From: Miaohe Lin <linmiaohe@huawei.com>
>
> Use %u to print u32 var and correct some coding style.
>
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  arch/x86/kvm/i8254.c      | 2 +-
>  arch/x86/kvm/mmu/mmu.c    | 3 +--
>  arch/x86/kvm/vmx/nested.c | 2 +-
>  3 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
> index b24c606ac04b..febca334c320 100644
> --- a/arch/x86/kvm/i8254.c
> +++ b/arch/x86/kvm/i8254.c
> @@ -367,7 +367,7 @@ static void pit_load_count(struct kvm_pit *pit, int channel, u32 val)
>  {
>  	struct kvm_kpit_state *ps = &pit->pit_state;
>  
> -	pr_debug("load_count val is %d, channel is %d\n", val, channel);
> +	pr_debug("load_count val is %u, channel is %d\n", val, channel);
>  
>  	/*
>  	 * The largest possible initial count is 0; this is equivalent
> diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
> index 7011a4e54866..9c228b9910b1 100644
> --- a/arch/x86/kvm/mmu/mmu.c
> +++ b/arch/x86/kvm/mmu/mmu.c
> @@ -3568,8 +3568,7 @@ static bool fast_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa,
>  		 * write-protected for dirty-logging or access tracking.
>  		 */
>  		if ((error_code & PFERR_WRITE_MASK) &&
> -		    spte_can_locklessly_be_made_writable(spte))
> -		{
> +		    spte_can_locklessly_be_made_writable(spte)) {
>  			new_spte |= PT_WRITABLE_MASK;
>  
>  			/*
> diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
> index f2d8cb68dce8..6f3e515f28fd 100644
> --- a/arch/x86/kvm/vmx/nested.c
> +++ b/arch/x86/kvm/vmx/nested.c
> @@ -4367,7 +4367,7 @@ int get_vmx_mem_address(struct kvm_vcpu *vcpu, unsigned long exit_qualification,
>  	if (base_is_valid)
>  		off += kvm_register_read(vcpu, base_reg);
>  	if (index_is_valid)
> -		off += kvm_register_read(vcpu, index_reg)<<scaling;
> +		off += kvm_register_read(vcpu, index_reg) << scaling;
>  	vmx_get_segment(vcpu, &s, seg_reg);
>  
>  	/*

I would've suggested we split such unrelated changes by source files in
the future to simplify (possible) stable backporting. Changes themselves
look good,

Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>

-- 
Vitaly


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] KVM: x86: Fix print format and coding style
  2020-02-17  8:57 ` Vitaly Kuznetsov
@ 2020-02-17 17:07   ` Paolo Bonzini
  0 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2020-02-17 17:07 UTC (permalink / raw)
  To: Vitaly Kuznetsov, linmiaohe
  Cc: kvm, linux-kernel, x86, rkrcmar, sean.j.christopherson,
	wanpengli, jmattson, joro, tglx, mingo, bp, hpa

On 17/02/20 09:57, Vitaly Kuznetsov wrote:
> I would've suggested we split such unrelated changes by source files in
> the future to simplify (possible) stable backporting. Changes themselves
> look good,

In this case I think it's trivial enough that we shouldn't have any
problem backporting to stable, but in general I agree.

Queued, thanks.

Paolo


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] KVM: x86: Fix print format and coding style
@ 2020-02-17  9:07 linmiaohe
  0 siblings, 0 replies; 4+ messages in thread
From: linmiaohe @ 2020-02-17  9:07 UTC (permalink / raw)
  To: Vitaly Kuznetsov
  Cc: kvm, linux-kernel, x86, pbonzini, rkrcmar, sean.j.christopherson,
	wanpengli, jmattson, joro, tglx, mingo, bp, hpa

Vitaly Kuznetsov <vkuznets@redhat.com> writes:
>linmiaohe <linmiaohe@huawei.com> writes:
>
>I would've suggested we split such unrelated changes by source files in
>the future to simplify (possible) stable backporting. Changes themselves
>look good,
>

I would take care, many thanks for your remind.

>Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>

Thanks for your review. :)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-15  2:44 [PATCH] KVM: x86: Fix print format and coding style linmiaohe
2020-02-17  8:57 ` Vitaly Kuznetsov
2020-02-17 17:07   ` Paolo Bonzini
2020-02-17  9:07 linmiaohe

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git