* [PATCH 1/1] mlx4_en: remove unnecessary error check
@ 2017-07-24 8:22 Zhu Yanjun
2017-07-24 13:01 ` Tariq Toukan
[not found] ` <1500884564-310-1-git-send-email-yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
0 siblings, 2 replies; 3+ messages in thread
From: Zhu Yanjun @ 2017-07-24 8:22 UTC (permalink / raw)
To: tariqt, netdev, linux-rdma, yuval.shaia, leon
The function mlx4_en_get_profile always return zero. So it is not
necessary to check its return value.
CC: Joe Jin <joe.jin@oracle.com>
CC: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.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;
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] mlx4_en: remove unnecessary error check
2017-07-24 8:22 [PATCH 1/1] mlx4_en: remove unnecessary error check Zhu Yanjun
@ 2017-07-24 13:01 ` Tariq Toukan
[not found] ` <1500884564-310-1-git-send-email-yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
1 sibling, 0 replies; 3+ messages in thread
From: Tariq Toukan @ 2017-07-24 13:01 UTC (permalink / raw)
To: Zhu Yanjun, tariqt, netdev, linux-rdma, yuval.shaia, leon
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@oracle.com>
> CC: Junxiao Bi <junxiao.bi@oracle.com>
> Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.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@mellanox.com>
Thank you Zhu.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] mlx4_en: remove unnecessary error check
[not found] ` <1500884564-310-1-git-send-email-yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
@ 2017-07-25 0:26 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2017-07-25 0:26 UTC (permalink / raw)
To: yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA
Cc: tariqt-VPRAkNaXOzVWk0Htik3J/w, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA, leon-DgEjT+Ai2ygdnm+yROfE0A
From: Zhu Yanjun <yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Date: Mon, 24 Jul 2017 04:22:44 -0400
> The function mlx4_en_get_profile always return zero. So it is not
> necessary to check its return value.
>
> CC: Joe Jin <joe.jin-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> CC: Junxiao Bi <junxiao.bi-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Zhu Yanjun <yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-07-25 0:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-24 8:22 [PATCH 1/1] mlx4_en: remove unnecessary error check Zhu Yanjun
2017-07-24 13:01 ` Tariq Toukan
[not found] ` <1500884564-310-1-git-send-email-yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-07-25 0:26 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).