From 8e725ff0419ad74dc79abfbdcd4cfba936a5d167 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Fri, 9 May 2025 11:58:01 +0100 Subject: [PATCH] platform: mellanox: nvsw-sn2200: Fix .items in nvsw_sn2201_busbar_hotplug MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Clang warns (or errors with CONFIG_WERROR=y): drivers/platform/mellanox/nvsw-sn2201.c:531:32: error: variable 'nvsw_sn2201_busbar_items' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] 531 | static struct mlxreg_core_item nvsw_sn2201_busbar_items[] = { | ^~~~~~~~~~~~~~~~~~~~~~~~ nvsw_sn2201_busbar_items is only used in ARRAY_SIZE(), which uses sizeof(), so this variable is only used at compile time. It appears that this may be a copy and paste issue, so use nvsw_sn2201_busbar_items as the .items member in nvsw_sn2201_busbar_hotplug, clearing up the warning. Fixes: 56b0bb7f9069 ("platform: mellanox: nvsw-sn2200: Add support for new system flavour") Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20250509-nvsw-sn2200-fix-items-busbar-hotplug-v1-1-8844fff38dc8@kernel.org Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen --- drivers/platform/mellanox/nvsw-sn2201.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/mellanox/nvsw-sn2201.c b/drivers/platform/mellanox/nvsw-sn2201.c index 8c31189a94dde..db31c8bf22553 100644 --- a/drivers/platform/mellanox/nvsw-sn2201.c +++ b/drivers/platform/mellanox/nvsw-sn2201.c @@ -551,7 +551,7 @@ static struct mlxreg_core_item nvsw_sn2201_busbar_items[] = { static struct mlxreg_core_hotplug_platform_data nvsw_sn2201_busbar_hotplug = { - .items = nvsw_sn2201_items, + .items = nvsw_sn2201_busbar_items, .count = ARRAY_SIZE(nvsw_sn2201_busbar_items), .cell = NVSW_SN2201_SYS_INT_STATUS_OFFSET, .mask = NVSW_SN2201_CPLD_AGGR_BUSBAR_MASK_DEF, -- 2.47.2