Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp701352rwp; Wed, 12 Jul 2023 22:38:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlHh/DtPDSrYg3aCJnYszmekvquuo37U0PL+lKdL021Hbf2hXBs/ByD255OG/0daU4dT6qH1 X-Received: by 2002:a05:620a:2450:b0:767:3bd4:dda0 with SMTP id h16-20020a05620a245000b007673bd4dda0mr904422qkn.39.1689226738595; Wed, 12 Jul 2023 22:38:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689226738; cv=none; d=google.com; s=arc-20160816; b=zpN1Pm41Gd603mBWLJftPJlm6J6yFTFuyKeGE4AKBuVYDKBwT0xcyHiCNUFYqT9hs+ INhcCxdJ9TlN3o56zVp9pP25dRhtp8OZcc/Xhc1WcsU3214IelroBIqKEfLgYLoDKnt5 rbqPRZyl2vTe302bU2VKKyxiexAvcsMY0ovftPilgOnMuESP2qiD+ipgDNJdEMGjR0x5 TJmgbsi9Bql0axpYbscGBrVPG2TWfMMHGpKOC0fdAXnr5/4KDPEiIH7p+TkX5FoOnhQB Ew9QDVd3+NmPhXIv7gW96xM/ww6wBZpfwQfVww84V9KKquEOjIqwntl1FtVVr0oQyc6e G3tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=jvatkfDYHCzc/v6qAGFyRVg8w34hfubtE7G647tEMHw=; fh=Gm40MoX+g85k3ktel+6OjyuE7Wf1Oy90njsX3UPjTiE=; b=PY8xE1LWRWEFVbKvybbCdEdH46pkX6m2a0pRdZbTt3ZyKR4MLKSx9tF51kXl0zCSYL GHIQXi95CF6u4IWZF1Aqx6hs8k1D/+KJVKRnsSas9UAwWqyi9kb+8zyqpOxCl8EQwtiu Z7DwEBXX8ZMqdzqw83izwqQt1WqncPhlZpeMBCqP3igjgfOfxTDfDpLiT4BjUZJSsDEE TJKRa6+E3X3m4DHvMdKa4YJCj1L4mL2BfYgoFTtE4JMbiGW21RIHFuD5oLzOD/Ns4RMj RdLhKFCWfUWLcT8MKDi0OVk584EeUReaFW1SJ6V/9umWL1vuhvKbJp3KkiAB4u3A/LWl 2omg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="mA/uVKEv"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv189-20020a632ec6000000b005348af160c2si4464874pgb.216.2023.07.12.22.38.47; Wed, 12 Jul 2023 22:38:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="mA/uVKEv"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233601AbjGMEyW (ORCPT + 99 others); Thu, 13 Jul 2023 00:54:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232119AbjGMEyU (ORCPT ); Thu, 13 Jul 2023 00:54:20 -0400 Received: from out-55.mta0.migadu.com (out-55.mta0.migadu.com [IPv6:2001:41d0:1004:224b::37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D90621BF9 for ; Wed, 12 Jul 2023 21:54:17 -0700 (PDT) Date: Wed, 12 Jul 2023 21:54:28 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1689224055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jvatkfDYHCzc/v6qAGFyRVg8w34hfubtE7G647tEMHw=; b=mA/uVKEvJgw2M8wAYWYl+WGAYZ/R/QfRxWBlDDWZB8+SwLbUbpICDlE6XivZmtOpWh6iIH TzjVbCXe3Mz78JIzu8M7rzjwIgEYOmR7Qme0Vdv1eIdpzlm4FrWiJCSgupkVx+1Zm3mU6P hA1AK5Dx2EI3X59RUf2T6nDYEQ9IsDg= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: chenqingyun001@208suo.com Cc: maz@kernel.org, catalin.marinas@arm.com, will@kernel.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com Subject: Re: [PATCH] KVM: arm64:Use #include instead of trailing whitespace braces {} are not necessary for any arm of this statement Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Qingyun, I'm guessing you did not read our developer documentation, nor did you run scripts/checkpatch.pl... - The shortlog should be at most 75 characters, but ideally less. - The body should not be a restatement of the shortlog, and actually provide meaningful information to the reader not yet captured in the shortlog. [*] https://www.kernel.org/doc/html/latest/process/submitting-patches.html On Thu, Jul 13, 2023 at 11:03:44AM +0800, chenqingyun001@208suo.com wrote: > include is a generic > Having extra spaces or tabs has no real effect > If there is only one statement in the if branch, > curly braces {} can be omitted > > Signed-off-by: Qingyun Chen > --- > arch/arm64/kvm/reset.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c > index b5dee8e57e77..4e6305dd1909 100644 > --- a/arch/arm64/kvm/reset.c > +++ b/arch/arm64/kvm/reset.c > @@ -19,7 +19,7 @@ > > #include > > -#include > +#include Changing the include provides absolutely nothing of value. All the things this compilation unit depends on are described in the asm header. Furthermore, use of the asm header appears all throughout the arm64 code. > #include > #include > #include > @@ -122,7 +122,7 @@ static int kvm_vcpu_finalize_sve(struct kvm_vcpu *vcpu) > kfree(buf); > return ret; > } > - > + > vcpu->arch.sve_state = buf; > vcpu_set_flag(vcpu, VCPU_SVE_FINALIZED); > return 0; > @@ -308,9 +308,9 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu) > > switch (vcpu->arch.target) { > default: > - if (vcpu_el1_is_32bit(vcpu)) { > + if (vcpu_el1_is_32bit(vcpu)) > pstate = VCPU_RESET_PSTATE_SVC; > - } else if (vcpu_has_nv(vcpu)) { > + else if (vcpu_has_nv(vcpu)) { No. What we have matches the kernel style guide. If one branch of a conditional statement requires braces, _all_ branches get braces. [*] https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces I strongly suggest you read up on the kernel developer documentation before your next contribution, as you're unlikely to win any favors with reviewers with problematic submissions such as this. -- Thanks, Oliver