From: Joe Perches <joe@perches.com>
To: Henry Sloan <henryksloan@gmail.com>
Cc: pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/6] KVM: Fix minor indentation and brace style issues
Date: Sat, 05 Mar 2022 13:07:27 -0800 [thread overview]
Message-ID: <5104a7ff8bcb00ffa439cbe4ea7990a65a2f2e73.camel@perches.com> (raw)
In-Reply-To: <20220305205528.463894-7-henryksloan@gmail.com>
On Sat, 2022-03-05 at 15:55 -0500, Henry Sloan wrote:
> Signed-off-by: Henry Sloan <henryksloan@gmail.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.
next prev parent reply other threads:[~2022-03-05 21:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-05 20:55 [PATCH 0/6] KVM: fix checkpatch warnings Henry Sloan
2022-03-05 20:55 ` [PATCH 1/6] KVM: Use typical SPDX comment style Henry Sloan
2022-03-05 20:55 ` [PATCH 2/6] KVM: Replace bare 'unsigned' with 'unsigned int' Henry Sloan
2022-03-06 0:49 ` Joe Perches
2022-03-05 20:55 ` [PATCH 3/6] KVM: Replace '__attribute__((weak))' with '__weak' Henry Sloan
2022-03-05 20:55 ` [PATCH 4/6] KVM: Add blank lines after some declarations Henry Sloan
2022-03-05 20:55 ` [PATCH 5/6] KVM: Use typical style for block comments Henry Sloan
2022-03-05 20:55 ` [PATCH 6/6] KVM: Fix minor indentation and brace style issues Henry Sloan
2022-03-05 21:07 ` Joe Perches [this message]
2022-03-05 21:53 ` [PATCH v2 " Henry Sloan
2022-03-06 1:28 ` [PATCH v2 2/6] KVM: Replace bare 'unsigned' with 'unsigned int' Henry Sloan
2022-03-06 1:37 ` Joe Perches
[not found] ` <CAFJXJGHc3D3U+BOBW2BqSX-vhsXSCZ-=R2ydfMtVML02+C3MuQ@mail.gmail.com>
2022-03-06 1:53 ` Joe Perches
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=5104a7ff8bcb00ffa439cbe4ea7990a65a2f2e73.camel@perches.com \
--to=joe@perches.com \
--cc=henryksloan@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®