lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5104a7ff8bcb00ffa439cbe4ea7990a65a2f2e73.camel@perches.com>
Date:   Sat, 05 Mar 2022 13:07:27 -0800
From:   Joe Perches <joe@...ches.com>
To:     Henry Sloan <henryksloan@...il.com>
Cc:     pbonzini@...hat.com, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 6/6] KVM: Fix minor indentation and brace style issues

On Sat, 2022-03-05 at 15:55 -0500, Henry Sloan wrote:
> Signed-off-by: Henry Sloan <henryksloan@...il.com>
> ---
>  virt/kvm/kvm_main.c | 36 +++++++++++++++++++-----------------
>  virt/kvm/pfncache.c |  2 +-
>  2 files changed, 20 insertions(+), 18 deletions(-)
> 
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
[]
> @@ -2154,9 +2157,9 @@ static int kvm_clear_dirty_log_protect(struct kvm *kvm,
>  	n = ALIGN(log->num_pages, BITS_PER_LONG) / 8;
>  
>  	if (log->first_page > memslot->npages ||
> -	    log->num_pages > memslot->npages - log->first_page ||
> -	    (log->num_pages < memslot->npages - log->first_page && (log->num_pages & 63)))
> -	    return -EINVAL;
> +		log->num_pages > memslot->npages - log->first_page ||
> +		(log->num_pages < memslot->npages - log->first_page && (log->num_pages & 63)))
> +		return -EINVAL;

The change to indentation on the return statement is good
but the change to the indentation on the if statement block is not.

Perhaps a better change might be:

	if (log->first_page > memslot->npages ||
	    log->num_pages > memslot->npages - log->first_page ||
	    (log->num_pages < memslot->npages - log->first_page &&
	     (log->num_pages & 63)))
		return -EINVAL;

>  
>  	kvm_arch_sync_dirty_log(kvm, memslot);
>  
> @@ -2517,7 +2520,7 @@ static int hva_to_pfn_remapped(struct vm_area_struct *vma,
>  	 * tail pages of non-compound higher order allocations, which
>  	 * would then underflow the refcount when the caller does the
>  	 * required put_page. Don't allow those pages here.
> -	 */ 
> +	 */
>  	if (!kvm_try_get_pfn(pfn))
>  		r = -EFAULT;
>  
> @@ -2906,7 +2909,7 @@ int kvm_vcpu_read_guest(struct kvm_vcpu *vcpu, gpa_t gpa, void *data, unsigned l
>  EXPORT_SYMBOL_GPL(kvm_vcpu_read_guest);
>  
>  static int __kvm_read_guest_atomic(struct kvm_memory_slot *slot, gfn_t gfn,
> -			           void *data, int offset, unsigned long len)
> +						void *data, int offset, unsigned long len)
>  {
>  	int r;
>  	unsigned long addr;
> @@ -2923,7 +2926,7 @@ static int __kvm_read_guest_atomic(struct kvm_memory_slot *slot, gfn_t gfn,
>  }
>  
>  int kvm_vcpu_read_guest_atomic(struct kvm_vcpu *vcpu, gpa_t gpa,
> -			       void *data, unsigned long len)
> +						void *data, unsigned long len)

These whitespace changes are somewhat odd and unnecessary.
It's generally preferred to align to arguments to the open parenthesis.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ