From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53488C433FE for ; Tue, 8 Mar 2022 16:22:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348320AbiCHQXU (ORCPT ); Tue, 8 Mar 2022 11:23:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348106AbiCHQXT (ORCPT ); Tue, 8 Mar 2022 11:23:19 -0500 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1CCB50E33 for ; Tue, 8 Mar 2022 08:22:22 -0800 (PST) Received: by mail-pl1-x633.google.com with SMTP id t19so13963060plr.5 for ; Tue, 08 Mar 2022 08:22:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=xW2imMOutmquafxF6rHzfFkEBpMTI0PWyZxcGyPtb50=; b=MCD+dvcy259RSICUkCH75otGlkyAbPXPKDoUEleaC2vus6Waenni04K+yoC1lkqvTl nCCOOHMtejyt5BFBlIKi4g6Smi8klWMZFbGixfK7emKCYEXxikHDwveMZU2ftutnlw8b l89l7xo+s291rz85/nUEMPRFEzS3sQhrC2UIQ3eFQzRfK7A3yydVnADQHa08z2S8x0kx VS4v2QqRfM9Vwjy4GhoSBCx/fuFHgtIg/3ox3wvywh2m2cw/248YKQPFSZT4Nb82ZT86 6+691BC0qmioMGzkZ79SoGigpBBxE85TrMNe7Tp2DIZPB91z3bwRUAQ4BWu9/BHlUe/n tJAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xW2imMOutmquafxF6rHzfFkEBpMTI0PWyZxcGyPtb50=; b=pKo1Yx+16N6FzysVvcdhWYIspjpz/750B23JUrBLYmZe5CMPK4j2zZ+pjPvC9LA16+ gIgc9x1GWeYjF1Ni+a/s4K5ki/ZWYH5jpCwPSV7Q6DHm3BCml1DcG8nfuIB3DeHSR0Lw pJqcSpG9AmhVB7xBvHg2ViT+VWRJKexq2aDt5uK7F6N/SGvcl5wm2FFspAEmflKooYfK D432kYWpJ8vGSm+gu5CKJs+YAO2+XkjF1aM5+ze9dWnsjVB89BzuHBz/bXHjfGZLwxho iM2svarI0AODJ6W6ZmcUUTy3OQpcrXcnMsuSVCWp4SlfoRGVJVCJqNgg02jLEtfhpSLw jcfQ== X-Gm-Message-State: AOAM530eurCOQhpUN264U3CPpnbd6LM48Ugq0S6hT82JATcwQIGPaUtd J7irUeuDhNOdZxG8L/Xd4UHPayXgdBEgrg== X-Google-Smtp-Source: ABdhPJz6ARuYB4YZ7aXIng0pjWq4qPANAL65m0PtT31NQs0c0fE7sDf+xOj6vXdW+JuOFPDnB5TA9w== X-Received: by 2002:a17:902:7049:b0:151:e52e:ae42 with SMTP id h9-20020a170902704900b00151e52eae42mr12259055plt.118.1646756542191; Tue, 08 Mar 2022 08:22:22 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id d5-20020a056a00244500b004f6f049432esm11261271pfj.176.2022.03.08.08.22.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 08:22:21 -0800 (PST) Date: Tue, 8 Mar 2022 16:22:18 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, dmatlack@google.com Subject: Re: [PATCH v2 03/25] KVM: x86/mmu: constify uses of struct kvm_mmu_role_regs Message-ID: References: <20220221162243.683208-1-pbonzini@redhat.com> <20220221162243.683208-4-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220221162243.683208-4-pbonzini@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 21, 2022, Paolo Bonzini wrote: > struct kvm_mmu_role_regs is computed just once and then accessed. Use > const to make this clearer, even though the const fields of struct > kvm_mmu_role_regs already prevent modifications to the contents of the > struct, or rather make them harder. > > Reviewed-by: David Matlack > Signed-off-by: Paolo Bonzini > --- > arch/x86/kvm/mmu/mmu.c | 25 ++++++++++++++----------- > 1 file changed, 14 insertions(+), 11 deletions(-) > > diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c > index 4f9bbd02fb8b..97566ac539e3 100644 > --- a/arch/x86/kvm/mmu/mmu.c > +++ b/arch/x86/kvm/mmu/mmu.c > @@ -197,7 +197,7 @@ struct kvm_mmu_role_regs { > * the single source of truth for the MMU's state. > */ > #define BUILD_MMU_ROLE_REGS_ACCESSOR(reg, name, flag) \ > -static inline bool __maybe_unused ____is_##reg##_##name(struct kvm_mmu_role_regs *regs)\ > +static inline bool __maybe_unused ____is_##reg##_##name(const struct kvm_mmu_role_regs *regs)\ This is one of the very rare times I think it's worth splitting the prototype, it's not like the function name is grep-friendly anyways. Either way, Reviewed-by: Sean Christopherson static inline bool __maybe_unused \ ____is_##reg##_##name(const struct kvm_mmu_role_regs *regs) \ { \ return !!(regs->reg & flag); \ }