From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sg-1-34.ptr.blmpb.com (sg-1-34.ptr.blmpb.com [118.26.132.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCB352D8DA8 for ; Fri, 6 Mar 2026 06:17:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=118.26.132.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772777853; cv=none; b=PTm2k9ptQULevoXYV/yle3jI4IxhlZFduQCueh+ChEIK5vCZEG1dHmSvPrFKmGNpSqgD9FrJggX/4lPWnOCW8inTVHLt6lmzwUuazrl0sMzHDQjSyMKmGyZuNGDLR1RohX+sGi8xc+MLONXbm+cYQ4QibHkd6ylRAg22ny8ZpU0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772777853; c=relaxed/simple; bh=Fli6r8wlAgbwy/oIcoJwpmBmU/A92Zm0IYOtfBLNhZg=; h=References:Cc:Date:Mime-Version:Content-Type:From:Subject:To: Message-Id:In-Reply-To; b=LJDxGN6L90cBAisYuDQqVx0jvFUsPdLy8WxYtcw9fnVIZ4KbPDJuhhJvoy4QURw9oIx4nYGtvDgyVKtdQb9zSS/ZAPoKmEOKKYlggVhyOugvMnj507bGp9Yc/zQNpEnvEex7qF+PhKVh61RKJCENZLU7krpAA6cOv2yhJEqQJJs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lanxincomputing.com; spf=pass smtp.mailfrom=lanxincomputing.com; dkim=pass (2048-bit key) header.d=lanxincomputing-com.20200927.dkim.feishu.cn header.i=@lanxincomputing-com.20200927.dkim.feishu.cn header.b=Zoloxuc3; arc=none smtp.client-ip=118.26.132.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lanxincomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lanxincomputing.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lanxincomputing-com.20200927.dkim.feishu.cn header.i=@lanxincomputing-com.20200927.dkim.feishu.cn header.b="Zoloxuc3" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=s1; d=lanxincomputing-com.20200927.dkim.feishu.cn; t=1772777841; h=from:subject:mime-version:from:date:message-id:subject:to:cc: reply-to:content-type:mime-version:in-reply-to:message-id; bh=yN5rn7GLGptMebKvf73Ps4IUabQw/g3Ysx/1ALo9Qq0=; b=Zoloxuc3N7cEjeP6U8Yuka1GJ65GRmmQwebEQHEgrN93vgwgSp3ho86TEthu+OjI0nK7t0 Tyl+XuGQ+Ap9YqbdlG99cH35KTxIgJGYgKYFZClnsLxq3YqErV/JshkFGz/UKTNXHCBBby fbBv9WkwtIIYY1IOaAEcjZT4N2cAqJH4xx0KK4y0B6UuTRvGWownCTShj0yPR5e/x801fv 7JlL3BZNRruNU7KOE/g+43fmpV3Zv3l5e/o9Ds0NSTTTa8tFhzk4I5wo8FnpzhvWbH7XKh SHKq2eKk7ZXAHt9gd6WxLerFsDkLDz/aZWJlSISkOJDH0FleOUX+tdHlPbbyMQ== User-Agent: Mozilla Thunderbird Received: from [127.0.0.1] ([61.181.102.80]) by smtp.feishu.cn with ESMTPS; Fri, 06 Mar 2026 14:17:19 +0800 References: <20260305235416.4147213-1-xin@zytor.com> X-Lms-Return-Path: Cc: , , , , , , , Date: Fri, 6 Mar 2026 14:17:16 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 From: "BillXiang" Subject: Re: [PATCH v1] KVM: VMX: Remove unnecessary parentheses Content-Transfer-Encoding: 7bit To: "Xin Li (Intel)" , , Message-Id: <1795684a-b453-440e-88bb-035993d9deab@lanxincomputing.com> In-Reply-To: <20260305235416.4147213-1-xin@zytor.com> X-Original-From: BillXiang Content-Language: en-US On 3/6/2026 7:54 AM, Xin Li (Intel) wrote: > From: Xin Li > > Drop redundant parentheses; & takes precedence over &&. I would not recommend relying on default operator precedence. > > Signed-off-by: Xin Li > --- > arch/x86/kvm/vmx/capabilities.h | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/arch/x86/kvm/vmx/capabilities.h b/arch/x86/kvm/vmx/capabilities.h > index 4e371c93ae16..0dad9e7c4ff4 100644 > --- a/arch/x86/kvm/vmx/capabilities.h > +++ b/arch/x86/kvm/vmx/capabilities.h > @@ -107,7 +107,7 @@ static inline bool cpu_has_load_perf_global_ctrl(void) > > static inline bool cpu_has_load_cet_ctrl(void) > { > - return (vmcs_config.vmentry_ctrl & VM_ENTRY_LOAD_CET_STATE); > + return vmcs_config.vmentry_ctrl & VM_ENTRY_LOAD_CET_STATE; > } > > static inline bool cpu_has_save_perf_global_ctrl(void) > @@ -162,7 +162,7 @@ static inline bool cpu_has_vmx_ept(void) > static inline bool vmx_umip_emulated(void) > { > return !boot_cpu_has(X86_FEATURE_UMIP) && > - (vmcs_config.cpu_based_2nd_exec_ctrl & SECONDARY_EXEC_DESC); > + vmcs_config.cpu_based_2nd_exec_ctrl & SECONDARY_EXEC_DESC; > } > > static inline bool cpu_has_vmx_rdtscp(void) > @@ -376,9 +376,9 @@ static inline bool cpu_has_vmx_invvpid_global(void) > > static inline bool cpu_has_vmx_intel_pt(void) > { > - return (vmcs_config.misc & VMX_MISC_INTEL_PT) && > - (vmcs_config.cpu_based_2nd_exec_ctrl & SECONDARY_EXEC_PT_USE_GPA) && > - (vmcs_config.vmentry_ctrl & VM_ENTRY_LOAD_IA32_RTIT_CTL); > + return vmcs_config.misc & VMX_MISC_INTEL_PT && > + vmcs_config.cpu_based_2nd_exec_ctrl & SECONDARY_EXEC_PT_USE_GPA && > + vmcs_config.vmentry_ctrl & VM_ENTRY_LOAD_IA32_RTIT_CTL; > } Removing the parentheses could significantly reduce code readability here. > > /* > > base-commit: 5128b972fb2801ad9aca54d990a75611ab5283a9