lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <562db460-95d9-cc0f-9867-6b24022334d1@mellanox.com>
Date:   Mon, 24 Jul 2017 16:01:31 +0300
From:   Tariq Toukan <tariqt@...lanox.com>
To:     Zhu Yanjun <yanjun.zhu@...cle.com>, tariqt@...lanox.com,
        netdev@...r.kernel.org, linux-rdma@...r.kernel.org,
        yuval.shaia@...cle.com, leon@...nel.org
Subject: Re: [PATCH 1/1] mlx4_en: remove unnecessary error check



On 24/07/2017 11:22 AM, Zhu Yanjun wrote:
> The function mlx4_en_get_profile always return zero. So it is not
> necessary to check its return value.
> 
> CC: Joe Jin <joe.jin@...cle.com>
> CC: Junxiao Bi <junxiao.bi@...cle.com>
> Signed-off-by: Zhu Yanjun <yanjun.zhu@...cle.com>
> ---
>   drivers/net/ethernet/mellanox/mlx4/en_main.c | 9 ++-------
>   1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_main.c b/drivers/net/ethernet/mellanox/mlx4/en_main.c
> index 2b0cbca..686e18d 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_main.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_main.c
> @@ -147,7 +147,7 @@ void mlx4_en_update_loopback_state(struct net_device *dev,
>   	mutex_unlock(&priv->mdev->state_lock);
>   }
>   
> -static int mlx4_en_get_profile(struct mlx4_en_dev *mdev)
> +static void mlx4_en_get_profile(struct mlx4_en_dev *mdev)
>   {
>   	struct mlx4_en_profile *params = &mdev->profile;
>   	int i;
> @@ -176,8 +176,6 @@ static int mlx4_en_get_profile(struct mlx4_en_dev *mdev)
>   		params->prof[i].rss_rings = 0;
>   		params->prof[i].inline_thold = inline_thold;
>   	}
> -
> -	return 0;
>   }
>   
>   static void *mlx4_en_get_netdev(struct mlx4_dev *dev, void *ctx, u8 port)
> @@ -309,10 +307,7 @@ static void *mlx4_en_add(struct mlx4_dev *dev)
>   	}
>   
>   	/* Build device profile according to supplied module parameters */
> -	if (mlx4_en_get_profile(mdev)) {
> -		mlx4_err(mdev, "Bad module parameters, aborting\n");
> -		goto err_mr;
> -	}
> +	mlx4_en_get_profile(mdev);
>   
>   	/* Configure which ports to start according to module parameters */
>   	mdev->port_cnt = 0;
> 
Reviewed-by: Tariq Toukan <tariqt@...lanox.com>

Thank you Zhu.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ