All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Ingo Molnar" <mingo@kernel.org>, "Arnd Bergmann" <arnd@kernel.org>
Cc: "Thomas Gleixner" <tglx@linutronix.de>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"Kuppuswamy Sathyanarayanan"
	<sathyanarayanan.kuppuswamy@linux.intel.com>,
	"Rick Edgecombe" <rick.p.edgecombe@intel.com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	"Tom Lendacky" <thomas.lendacky@amd.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: coco: mark cc_mask as __maybe_unused
Date: Mon, 10 Mar 2025 14:50:18 +0100	[thread overview]
Message-ID: <f034fd64-41e9-45fd-a58f-41dae347307c@app.fastmail.com> (raw)
In-Reply-To: <Z8grEnsAcMrm9sCc@gmail.com>

On Wed, Mar 5, 2025, at 11:44, Ingo Molnar wrote:
> * Arnd Bergmann <arnd@kernel.org> wrote:
>
>> @@ -25,7 +25,7 @@ u64 cc_mkdec(u64 val);
>>  void cc_random_init(void);
>>  #else
>>  #define cc_vendor (CC_VENDOR_NONE)
>> -static const u64 cc_mask = 0;
>> +static const __maybe_unused u64 cc_mask = 0;
>
> So I detest __maybe_unused with a vengeance: the 'maybe' unnecessarily 
> inserts uncertainty & probability language into the text, while there's 
> nothing uncertain about this interface or the code. Why cannot the 
> compiler figure it out?

Right, I'm also trying to remove a lot of the __maybe_unused
annotations in places like power management and device_id tables
where we now have better solutions in place.

> Anyway, I'd suggest we change direct usage of cc_mask to a 
> get_cc_mask() inline function instead, this will resolve the warning, 
> plus it avoids some messy looking variable shadowing in tdx.c AFAICS:
>
>   arch/x86/coco/tdx/tdx.c:static void tdx_setup(u64 *cc_mask)

I've sent a v2 now.

      Arnd

      parent reply	other threads:[~2025-03-10 13:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-04 14:33 [PATCH] x86: coco: mark cc_mask as __maybe_unused Arnd Bergmann
2025-03-04 19:55 ` Sathyanarayanan Kuppuswamy
2025-03-05  9:02 ` Kirill A. Shutemov
2025-03-05 10:44 ` Ingo Molnar
2025-03-05 22:17   ` Borislav Petkov
2025-03-05 22:20     ` Borislav Petkov
2025-03-05 22:45       ` Arnd Bergmann
2025-03-05 22:50         ` Borislav Petkov
2025-03-06  5:38           ` Huang, Kai
2025-03-10 13:10           ` Arnd Bergmann
2025-03-10 13:50   ` Arnd Bergmann [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=f034fd64-41e9-45fd-a58f-41dae347307c@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=Jason@zx2c4.com \
    --cc=arnd@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.