summaryrefslogtreecommitdiff
path: root/arch/x86/include
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2024-10-28 16:35:46 +0000
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2024-11-12 12:15:36 +0200
commit0d5e2d9b8fcb58116df2a201c54af60c1ac50bf2 (patch)
tree44477576d8eaa65fad700c2817c87b9811b71f5c /arch/x86/include
parentb0955ce555478e24ed34c7d14f62fdf9c07b15cb (diff)
platform/x86/amd/hsmp: mark hsmp_msg_desc_table[] as maybe_unused
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 unfortunately isn't available in userspace, so this has to be the long form. While it is not envisioned a normal userspace program could benefit from having this table as part of UAPI, it seems there is non-zero chance this array is used by some userspace tests so it is retained for now (see the Link below). Fixes: e47c018a0ee6 ("platform/x86/amd/hsmp: Move platform device specific code to plat.c") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/platform-driver-x86/CAPhsuW7mDRswhVjYf+4iinO+sph_rQ1JykEof+apoiSOVwOXXQ@mail.gmail.com/ Link: https://lore.kernel.org/r/20241028163553.2452486-1-arnd@kernel.org Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/uapi/asm/amd_hsmp.h3
1 files changed, 2 insertions, 1 deletions
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},