public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Colton Lewis <coltonlewis@google.com>
Cc: kvm@vger.kernel.org, mizhang@google.com, ljr.kernel@gmail.com,
	 jmattson@google.com, aaronlewis@google.com, pbonzini@redhat.com,
	 shuah@kernel.org, linux-kselftest@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/6] KVM: x86: selftests: Set up AMD VM in pmu_counters_test
Date: Tue, 21 Jan 2025 12:56:54 -0800	[thread overview]
Message-ID: <Z5AKFlSJ9wgbX_MS@google.com> (raw)
In-Reply-To: <gsntplkh2wia.fsf@coltonlewis-kvm.c.googlers.com>

On Mon, Jan 20, 2025, Colton Lewis wrote:
> > > +static void test_core_counters(void)
> > > +{
> > > +	uint8_t nr_counters = nr_core_counters();
> > > +	bool core_ext = kvm_cpu_has(X86_FEATURE_PERF_CTR_EXT_CORE);
> > > +	bool perfmon_v2 = kvm_cpu_has(X86_FEATURE_PERFMON_V2);
> > > +	struct kvm_vcpu *vcpu;
> > > +	struct kvm_vm *vm;
> > > +
> > > +	for (uint8_t ce = 0; ce <= core_ext; ce++) {
> 
> > Kernel style is to not declared variables inside for-loops.
> 
> I ran it through checkpatch and it didn't complain.

...


> > > +					vcpu_set_cpuid_property(
> 
> > Google3!  (Never, ever wrap immediately after the opening paranethesis).
> 
> Checkpatch didn't complain.

Checkpatch is a perl script, not sentient AI.  It's nothing more than a tool to
help detect common goofs, typos, egregious flaws, etc.  The absense of checkpatch
warnings/errors does not mean a patch has no issues.  Coding style in particular
is quite subjective and prone to "exceptions to the rule", which makes is especially
hard to "enforce" via checkpatch.

As explained in Documentation/process/4.Coding.rst, what matters most is consistency:

  A code base as large as the kernel requires some uniformity of code to make it
  possible for developers to quickly understand any part of it.  So there is no
  longer room for strangely-formatted code.

https://www.kernel.org/doc/html/v5.0/process/4.Coding.html#coding-style

  reply	other threads:[~2025-01-21 20:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-18 20:53 [PATCH v2 0/6] Extend pmu_counters_test to AMD CPUs Colton Lewis
2024-09-18 20:53 ` [PATCH v2 1/6] KVM: x86: selftests: Fix typos in macro variable use Colton Lewis
2024-09-18 20:53 ` [PATCH v2 2/6] KVM: x86: selftests: Define AMD PMU CPUID leaves Colton Lewis
2025-01-08 17:58   ` Sean Christopherson
2025-01-20 17:06     ` Colton Lewis
2024-09-18 20:53 ` [PATCH v2 3/6] KVM: x86: selftests: Set up AMD VM in pmu_counters_test Colton Lewis
2025-01-08 18:35   ` Sean Christopherson
2025-01-20 18:03     ` Colton Lewis
2025-01-21 20:56       ` Sean Christopherson [this message]
2024-09-18 20:53 ` [PATCH v2 4/6] KVM: x86: selftests: Test read/write core counters Colton Lewis
2025-01-08 18:54   ` Sean Christopherson
2025-01-20 19:54     ` Colton Lewis
2024-09-18 20:53 ` [PATCH v2 5/6] KVM: x86: selftests: Test core events Colton Lewis
2025-01-08 19:31   ` Sean Christopherson
2025-01-20 20:01     ` Colton Lewis
2024-09-18 20:53 ` [PATCH v2 6/6] KVM: x86: selftests: Test PerfMonV2 Colton Lewis
2025-01-08 19:42   ` Sean Christopherson
2025-01-20 20:07     ` Colton Lewis
2024-10-31 20:09 ` [PATCH v2 0/6] Extend pmu_counters_test to AMD CPUs Colton Lewis
2025-01-09 19:47 ` Sean Christopherson
2025-01-20 20:11   ` Colton Lewis

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=Z5AKFlSJ9wgbX_MS@google.com \
    --to=seanjc@google.com \
    --cc=aaronlewis@google.com \
    --cc=coltonlewis@google.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=ljr.kernel@gmail.com \
    --cc=mizhang@google.com \
    --cc=pbonzini@redhat.com \
    --cc=shuah@kernel.org \
    /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