Skip to contentSkip to conversation

platform: mellanox: mlx-platform: Initialize shift variable to 0

PATCH In review Hans de Goede 1 participant 2 messages Mar 7, 2023 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform: mellanox: mlx-platform: Initialize shift variable to 0

Initialize shift variable in mlxplat_mlxcpld_verify_bus_topology() to 0 to avoid the following compile error:

drivers/platform/x86/mlx-platform.c:6013
mlxplat_mlxcpld_verify_bus_topology() error: uninitialized symbol 'shift'.

Fixes 50b823fdd357 ("platform: mellanox: mlx-platform: Move bus shift assignment out of the loop")
Cc Vadim Pasternak <[email protected]>
Cc Michael Shych <[email protected]>
---
 drivers/platform/x86/mlx-platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/mlx-platform.c +1 -1
index 7b6779cdb134..67367f010139 100644
@@ -5980,7 +5980,7 @@ MODULE_DEVICE_TABLE(dmi, mlxplat_dmi_table);
 static int mlxplat_mlxcpld_verify_bus_topology(int *nr)
 {
 	struct i2c_adapter *search_adap;
-	int shift, i;
+	int i, shift = 0;
 
 	/* Scan adapters from expected id to verify it is free. */
 	*nr = MLXPLAT_CPLD_PHYS_ADAPTER_DEF_NR;
Signature · 1 line
2.39.1
#1 lore raw

Hi,

Quoted 10 lines · Hans de Goede

Initialize shift variable in mlxplat_mlxcpld_verify_bus_topology() to 0 to avoid the following compile error:

drivers/platform/x86/mlx-platform.c:6013
mlxplat_mlxcpld_verify_bus_topology() error: uninitialized symbol 'shift'.

Fixes 50b823fdd357 ("platform: mellanox: mlx-platform: Move bus shift assignment out of the loop")
Cc Vadim Pasternak <[email protected]>
Cc Michael Shych <[email protected]>

I've added this to my review-hans (soon to be fixes) branch now.

Regards,

Hans

Quoted 17 lines
---
 drivers/platform/x86/mlx-platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/mlx-platform.c +1 -1
index 7b6779cdb134..67367f010139 100644
@@ -5980,7 +5980,7 @@ MODULE_DEVICE_TABLE(dmi, mlxplat_dmi_table);
 static int mlxplat_mlxcpld_verify_bus_topology(int *nr)
 {
 	struct i2c_adapter *search_adap;
-	int shift, i;
+	int i, shift = 0;
 
 	/* Scan adapters from expected id to verify it is free. */
 	*nr = MLXPLAT_CPLD_PHYS_ADAPTER_DEF_NR;