The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: "Naveen Krishna Chatradhi" <naveenkrishna.chatradhi@amd.com>,
	"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, "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Suma Hegde" <suma.hegde@amd.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Carlos Bilbao <carlos.bilbao.osdev@gmail.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] platform/x86/amd/hsmp: mark hsmp_msg_desc_table[] as maybe_unused
Date: Mon, 28 Oct 2024 16:35:46 +0000	[thread overview]
Message-ID: <20241028163553.2452486-1-arnd@kernel.org> (raw)

From: Arnd Bergmann <arnd@arndb.de>

After the file got split, there are now W=1 warnings for users that
include it without referencing hsmp_msg_desc_table:

In file included from arch/x86/include/asm/amd_hsmp.h:6,
                 from drivers/platform/x86/amd/hsmp/plat.c:12:
arch/x86/include/uapi/asm/amd_hsmp.h:91:35: error: 'hsmp_msg_desc_table' defined but not used [-Werror=unused-const-variable=]
   91 | static const struct hsmp_msg_desc hsmp_msg_desc_table[] = {
      |                                   ^~~~~~~~~~~~~~~~~~~

Mark it as __attribute__((maybe_unused)) to shut up the warning but
keep it in the file in case it is used from userland. The __maybe_unused
shorthand unfurtunately isn't available in userspace, so this has to
be the long form.

Fixes: e47c018a0ee6 ("platform/x86/amd/hsmp: Move platform device specific code to plat.c")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
Ideally this array wouldn't be part of the UAPI at all, since it is
not really a interface, but it's hard to know what part  of the header
is actually used outside of the kernel.
---
 arch/x86/include/uapi/asm/amd_hsmp.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/uapi/asm/amd_hsmp.h b/arch/x86/include/uapi/asm/amd_hsmp.h
index e5d182c7373c..4a7cace06204 100644
--- a/arch/x86/include/uapi/asm/amd_hsmp.h
+++ b/arch/x86/include/uapi/asm/amd_hsmp.h
@@ -88,7 +88,8 @@ struct hsmp_msg_desc {
  *
  * Not supported messages would return -ENOMSG.
  */
-static const struct hsmp_msg_desc hsmp_msg_desc_table[] = {
+static const struct hsmp_msg_desc hsmp_msg_desc_table[]
+				__attribute__((unused)) = {
 	/* RESERVED */
 	{0, 0, HSMP_RSVD},
 
-- 
2.39.5


             reply	other threads:[~2024-10-28 16:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-28 16:35 Arnd Bergmann [this message]
2024-10-29 12:55 ` [PATCH] platform/x86/amd/hsmp: mark hsmp_msg_desc_table[] as maybe_unused Ilpo Järvinen
2024-10-30 14:16   ` Hans de Goede
2024-10-30 14:19     ` Arnd Bergmann
2024-10-30 17:17       ` Hans de Goede

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=20241028163553.2452486-1-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=bp@alien8.de \
    --cc=carlos.bilbao.osdev@gmail.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=naveenkrishna.chatradhi@amd.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=suma.hegde@amd.com \
    --cc=tglx@linutronix.de \
    --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