Skip to contentSkip to conversation

platform/x86: mlx-platform: Properly use mlxplat_mlxcpld_msn201x_items

PATCH In review Nathan Chancellor 3 participants 3 messages Sep 26, 2018 – Oct 19, 2018 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: mlx-platform: Properly use mlxplat_mlxcpld_msn201x_items

Clang warns that mlxplat_mlxcpld_msn201x_items is not going to be emitted in the final assembly because it's only used in ARRAY_SIZE right now, which is a compile time evaluation since the array's size is known.

drivers/platform/x86/mlx-platform.c:555:32: warning: variable 'mlxplat_mlxcpld_msn201x_items' is not needed and will not be emitted [-Wunneeded-internal-declaration]

static struct mlxreg_core_item mlxplat_mlxcpld_msn201x_items[] = {
                               ^

1 warning generated.

It appears this was a copy and paste mistake from when this item was first added. Use the definition in mlxplat_mlxcpld_msn201x_data so that Clang no longer warns.

Fixes a49a41482f61 ("platform/x86: mlx-platform: Add support for new msn201x system type")
---
 drivers/platform/x86/mlx-platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/mlx-platform.c +1 -1
index d89936c93ba0..c2c3a1a19879 100644
@@ -575,7 +575,7 @@ static struct mlxreg_core_item mlxplat_mlxcpld_msn201x_items[] = {
 
 static
 struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_msn201x_data = {
-	.items = mlxplat_mlxcpld_msn21xx_items,
+	.items = mlxplat_mlxcpld_msn201x_items,
 	.counter = ARRAY_SIZE(mlxplat_mlxcpld_msn201x_items),
 	.cell = MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET,
 	.mask = MLXPLAT_CPLD_AGGR_MASK_DEF,
Signature · 1 line
2.19.0
Acked-by on v1 1/1
#1 lore raw
Quoted 27 lines

-----Original Message-----
From: Nathan Chancellor <[email protected]>
Sent: Wednesday, September 26, 2018 8:21 AM
To: Vadim Pasternak <[email protected]>; Darren Hart <[email protected]>; Andy Shevchenko <[email protected]>
Cc: [email protected]; [email protected]; Nathan Chancellor <[email protected]>
Subject: [PATCH] platform/x86: mlx-platform: Properly use mlxplat_mlxcpld_msn201x_items

Clang warns that mlxplat_mlxcpld_msn201x_items is not going to be emitted in the final assembly because it's only used in ARRAY_SIZE right now, which is a compile time evaluation since the array's size is known.

drivers/platform/x86/mlx-platform.c:555:32: warning: variable 'mlxplat_mlxcpld_msn201x_items' is not needed and will not be emitted [- Wunneeded-internal-declaration] static struct mlxreg_core_item

mlxplat_mlxcpld_msn201x_items[] = {
                               ^

1 warning generated.

It appears this was a copy and paste mistake from when this item was first added. Use the definition in mlxplat_mlxcpld_msn201x_data so that Clang no longer warns.

Quoted 5 lines
Fixes a49a41482f61 ("platform/x86: mlx-platform: Add support for new

msn201x system type")

---

Quoted 20 lines
 drivers/platform/x86/mlx-platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/mlx- renamed from drivers/platform/x86/mlx-platform.c +0 -0

platform.c
index d89936c93ba0..c2c3a1a19879 100644

drivers/platform/x86/mlx-platform.c +1 -1
@@ -575,7 +575,7 @@ static struct mlxreg_core_item
 mlxplat_mlxcpld_msn201x_items[] = {
 
 static
 struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_msn201x_data = {
-	.items = mlxplat_mlxcpld_msn21xx_items,
+	.items = mlxplat_mlxcpld_msn201x_items,
 	.counter = ARRAY_SIZE(mlxplat_mlxcpld_msn201x_items),
 	.cell = MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET,

.mask = MLXPLAT_CPLD_AGGR_MASK_DEF,
--
2.19.0

#2 lore raw
Quoted 24 lines · Vadim Pasternak
Quoted 24 lines

-----Original Message-----
From: Nathan Chancellor <[email protected]>
Sent: Wednesday, September 26, 2018 8:21 AM
To: Vadim Pasternak <[email protected]>; Darren Hart <[email protected]>; Andy Shevchenko <[email protected]>
Cc: [email protected]; [email protected]; Nathan Chancellor <[email protected]>
Subject: [PATCH] platform/x86: mlx-platform: Properly use mlxplat_mlxcpld_msn201x_items

Clang warns that mlxplat_mlxcpld_msn201x_items is not going to be emitted in the final assembly because it's only used in ARRAY_SIZE right now, which is a compile time evaluation since the array's size is known.

drivers/platform/x86/mlx-platform.c:555:32: warning: variable 'mlxplat_mlxcpld_msn201x_items' is not needed and will not be emitted [- Wunneeded-internal-declaration] static struct mlxreg_core_item

mlxplat_mlxcpld_msn201x_items[] = {
                               ^

1 warning generated.

Quoted 4 lines
Quoted 4 lines

It appears this was a copy and paste mistake from when this item was first added. Use the definition in mlxplat_mlxcpld_msn201x_data so that Clang no longer warns.

Pushed and applied, thanks!

Quoted 29 lines
Quoted 5 lines
Fixes a49a41482f61 ("platform/x86: mlx-platform: Add support for new

msn201x system type")

---

Quoted 20 lines
 drivers/platform/x86/mlx-platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/mlx- renamed from drivers/platform/x86/mlx-platform.c +0 -0

platform.c
index d89936c93ba0..c2c3a1a19879 100644

drivers/platform/x86/mlx-platform.c +1 -1
@@ -575,7 +575,7 @@ static struct mlxreg_core_item
 mlxplat_mlxcpld_msn201x_items[] = {
 
 static
 struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_msn201x_data = {
-     .items = mlxplat_mlxcpld_msn21xx_items,
+     .items = mlxplat_mlxcpld_msn201x_items,
      .counter = ARRAY_SIZE(mlxplat_mlxcpld_msn201x_items),
      .cell = MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET,

.mask = MLXPLAT_CPLD_AGGR_MASK_DEF,
--
2.19.0

Signature · 2 lines
With Best Regards,
Andy Shevchenko