From: Ingo Molnar <mingo@kernel.org>
To: "Compostella, Jeremy" <jeremy.compostella@intel.com>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH v2 2/2] x86/cpu/intel: Clean-up TME code
Date: Thu, 28 Sep 2023 22:55:56 +0200 [thread overview]
Message-ID: <ZRXoXLV69TQ7Wvkr@gmail.com> (raw)
In-Reply-To: <87h6nhu7k6.fsf@jcompost-mobl.amr.corp.intel.com>
* Compostella, Jeremy <jeremy.compostella@intel.com> wrote:
> -/* Values for mktme_status (SW only construct) */
> -#define MKTME_ENABLED 0
> -#define MKTME_DISABLED 1
> -#define MKTME_UNINITIALIZED 2
> -static int mktme_status = MKTME_UNINITIALIZED;
> -
> static void detect_tme(struct cpuinfo_x86 *c)
> {
> u64 tme_activate, tme_policy, tme_crypto_algs;
> int keyid_bits = 0, nr_keyids = 0;
> static u64 tme_activate_cpu0 = 0;
> + static enum {
> + MKTME_ENABLED,
> + MKTME_DISABLED,
> + MKTME_UNINITIALIZED
> + } mktme_status = MKTME_UNINITIALIZED;
Please don't move the new enum inside the function, even if
that's the only place it's used.
We almost always keep constant definitions outside function scope.
We also try to avoid static variables inside functions.
Thanks,
Ingo
prev parent reply other threads:[~2023-09-28 20:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-26 0:00 [PATCH v2 2/2] x86/cpu/intel: Clean-up TME code Compostella, Jeremy
2023-09-28 20:55 ` Ingo Molnar [this message]
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=ZRXoXLV69TQ7Wvkr@gmail.com \
--to=mingo@kernel.org \
--cc=jeremy.compostella@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=x86@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