diff mbox series

[platform-next,1/1] Squash to commit cbf3f15f51c5 ("platform: mellanox: Split logic in init and exit flow")

Message ID 20230212083350.52633-1-vadimp@nvidia.com (mailing list archive)
State Accepted, archived
Headers show
Series [platform-next,1/1] Squash to commit cbf3f15f51c5 ("platform: mellanox: Split logic in init and exit flow") | expand

Commit Message

Vadim Pasternak Feb. 12, 2023, 8:33 a.m. UTC
Squash to branch review-hans.

Fix robot warning: drivers/platform/x86/mlx-platform.c:6121:6:
warning: variable 'i' is used uninitialized whenever 'if' condition is
true [-Wsometimes-uninitialized].

drivers/platform/x86/mlx-platform.c:6062:7: note: initialize the
variable 'i' to silence this warning
	int i, err;
		^
		= 0

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reported-by: kernel test robot <lkp@intel.com>
---
 drivers/platform/x86/mlx-platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hans de Goede Feb. 13, 2023, 11:11 a.m. UTC | #1
Hi,

On 2/12/23 09:33, Vadim Pasternak wrote:
> Squash to branch review-hans.
> 
> Fix robot warning: drivers/platform/x86/mlx-platform.c:6121:6:
> warning: variable 'i' is used uninitialized whenever 'if' condition is
> true [-Wsometimes-uninitialized].
> 
> drivers/platform/x86/mlx-platform.c:6062:7: note: initialize the
> variable 'i' to silence this warning
> 	int i, err;
> 		^
> 		= 0
> 
> Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
> Reported-by: kernel test robot <lkp@intel.com>

Thank you.

Squashed into the original commit as requested and pushed
to review-hans + for-next.

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 1bf9ef6e8c97..7b6779cdb134 100644
> --- a/drivers/platform/x86/mlx-platform.c
> +++ b/drivers/platform/x86/mlx-platform.c
> @@ -6083,7 +6083,7 @@ static void mlxplat_post_exit(void)
>  
>  static int mlxplat_post_init(struct mlxplat_priv *priv)
>  {
> -	int i, err;
> +	int i = 0, err;
>  
>  	/* Add hotplug driver */
>  	if (mlxplat_hotplug) {
diff mbox series

Patch

diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
index 1bf9ef6e8c97..7b6779cdb134 100644
--- a/drivers/platform/x86/mlx-platform.c
+++ b/drivers/platform/x86/mlx-platform.c
@@ -6083,7 +6083,7 @@  static void mlxplat_post_exit(void)
 
 static int mlxplat_post_init(struct mlxplat_priv *priv)
 {
-	int i, err;
+	int i = 0, err;
 
 	/* Add hotplug driver */
 	if (mlxplat_hotplug) {