diff mbox series

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

Message ID 20230307105842.286118-1-hdegoede@redhat.com (mailing list archive)
State Accepted, archived
Headers show
Series platform: mellanox: mlx-platform: Initialize shift variable to 0 | expand

Commit Message

Hans de Goede March 7, 2023, 10:58 a.m. UTC
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 <vadimp@nvidia.com>
Cc: Michael Shych <michaelsh@nvidia.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/mlx-platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hans de Goede March 7, 2023, 11:08 a.m. UTC | #1
Hi,

On 3/7/23 11:58, Hans de Goede wrote:
> 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 <vadimp@nvidia.com>
> Cc: Michael Shych <michaelsh@nvidia.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

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

Regards,

Hans


> ---
>  drivers/platform/x86/mlx-platform.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
> index 7b6779cdb134..67367f010139 100644
> --- a/drivers/platform/x86/mlx-platform.c
> +++ b/drivers/platform/x86/mlx-platform.c
> @@ -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;
diff mbox series

Patch

diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
index 7b6779cdb134..67367f010139 100644
--- a/drivers/platform/x86/mlx-platform.c
+++ b/drivers/platform/x86/mlx-platform.c
@@ -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;