* [PATCH 1/1] mlx4_en: remove unnecessary returned value check
@ 2017-07-12 6:44 Zhu Yanjun
[not found] ` <1499841873-10275-1-git-send-email-yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Zhu Yanjun @ 2017-07-12 6:44 UTC (permalink / raw)
To: tariqt-VPRAkNaXOzVWk0Htik3J/w, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA, leon-DgEjT+Ai2ygdnm+yROfE0A
The function __mlx4_zone_remove_one_entry always returns zero. So
it is not necessary to check it.
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>
---
drivers/net/ethernet/mellanox/mlx4/alloc.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/alloc.c b/drivers/net/ethernet/mellanox/mlx4/alloc.c
index 249a458..bfb185d 100644
--- a/drivers/net/ethernet/mellanox/mlx4/alloc.c
+++ b/drivers/net/ethernet/mellanox/mlx4/alloc.c
@@ -283,7 +283,7 @@ int mlx4_zone_add_one(struct mlx4_zone_allocator *zone_alloc,
}
/* Should be called under a lock */
-static int __mlx4_zone_remove_one_entry(struct mlx4_zone_entry *entry)
+static void __mlx4_zone_remove_one_entry(struct mlx4_zone_entry *entry)
{
struct mlx4_zone_allocator *zone_alloc = entry->allocator;
@@ -315,8 +315,6 @@ static int __mlx4_zone_remove_one_entry(struct mlx4_zone_entry *entry)
}
zone_alloc->mask = mask;
}
-
- return 0;
}
void mlx4_zone_allocator_destroy(struct mlx4_zone_allocator *zone_alloc)
@@ -468,7 +466,8 @@ int mlx4_zone_remove_one(struct mlx4_zone_allocator *zones, u32 uid)
goto out;
}
- res = __mlx4_zone_remove_one_entry(zone);
+ __mlx4_zone_remove_one_entry(zone);
+ res = 0;
out:
spin_unlock(&zones->lock);
--
2.7.4
--
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 related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] mlx4_en: remove unnecessary returned value check
[not found] ` <1499841873-10275-1-git-send-email-yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
@ 2017-07-12 8:36 ` Yuval Shaia
2017-07-12 9:46 ` Leon Romanovsky
0 siblings, 1 reply; 3+ messages in thread
From: Yuval Shaia @ 2017-07-12 8:36 UTC (permalink / raw)
To: Zhu Yanjun
Cc: tariqt-VPRAkNaXOzVWk0Htik3J/w, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA, leon-DgEjT+Ai2ygdnm+yROfE0A
On Wed, Jul 12, 2017 at 02:44:33AM -0400, Zhu Yanjun wrote:
> The function __mlx4_zone_remove_one_entry always returns zero. So
> it is not necessary to check it.
>
> 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>
> ---
> drivers/net/ethernet/mellanox/mlx4/alloc.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/alloc.c b/drivers/net/ethernet/mellanox/mlx4/alloc.c
> index 249a458..bfb185d 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/alloc.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/alloc.c
> @@ -283,7 +283,7 @@ int mlx4_zone_add_one(struct mlx4_zone_allocator *zone_alloc,
> }
>
> /* Should be called under a lock */
> -static int __mlx4_zone_remove_one_entry(struct mlx4_zone_entry *entry)
> +static void __mlx4_zone_remove_one_entry(struct mlx4_zone_entry *entry)
> {
> struct mlx4_zone_allocator *zone_alloc = entry->allocator;
>
> @@ -315,8 +315,6 @@ static int __mlx4_zone_remove_one_entry(struct mlx4_zone_entry *entry)
> }
> zone_alloc->mask = mask;
> }
> -
> - return 0;
> }
>
> void mlx4_zone_allocator_destroy(struct mlx4_zone_allocator *zone_alloc)
> @@ -468,7 +466,8 @@ int mlx4_zone_remove_one(struct mlx4_zone_allocator *zones, u32 uid)
> goto out;
> }
>
> - res = __mlx4_zone_remove_one_entry(zone);
> + __mlx4_zone_remove_one_entry(zone);
> + res = 0;
Will look better if initialization will move to variable declaration.
Besides this minor thing - lgtm.
Reviewed-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
>
> out:
> spin_unlock(&zones->lock);
> --
> 2.7.4
>
--
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
* Re: [PATCH 1/1] mlx4_en: remove unnecessary returned value check
2017-07-12 8:36 ` Yuval Shaia
@ 2017-07-12 9:46 ` Leon Romanovsky
0 siblings, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2017-07-12 9:46 UTC (permalink / raw)
To: Yuval Shaia
Cc: Zhu Yanjun, tariqt-VPRAkNaXOzVWk0Htik3J/w,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-rdma-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 1772 bytes --]
On Wed, Jul 12, 2017 at 11:36:48AM +0300, Yuval Shaia wrote:
> On Wed, Jul 12, 2017 at 02:44:33AM -0400, Zhu Yanjun wrote:
> > The function __mlx4_zone_remove_one_entry always returns zero. So
> > it is not necessary to check it.
> >
> > 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>
> > ---
> > drivers/net/ethernet/mellanox/mlx4/alloc.c | 7 +++----
> > 1 file changed, 3 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/mellanox/mlx4/alloc.c b/drivers/net/ethernet/mellanox/mlx4/alloc.c
> > index 249a458..bfb185d 100644
> > --- a/drivers/net/ethernet/mellanox/mlx4/alloc.c
> > +++ b/drivers/net/ethernet/mellanox/mlx4/alloc.c
> > @@ -283,7 +283,7 @@ int mlx4_zone_add_one(struct mlx4_zone_allocator *zone_alloc,
> > }
> >
> > /* Should be called under a lock */
> > -static int __mlx4_zone_remove_one_entry(struct mlx4_zone_entry *entry)
> > +static void __mlx4_zone_remove_one_entry(struct mlx4_zone_entry *entry)
> > {
> > struct mlx4_zone_allocator *zone_alloc = entry->allocator;
> >
> > @@ -315,8 +315,6 @@ static int __mlx4_zone_remove_one_entry(struct mlx4_zone_entry *entry)
> > }
> > zone_alloc->mask = mask;
> > }
> > -
> > - return 0;
> > }
> >
> > void mlx4_zone_allocator_destroy(struct mlx4_zone_allocator *zone_alloc)
> > @@ -468,7 +466,8 @@ int mlx4_zone_remove_one(struct mlx4_zone_allocator *zones, u32 uid)
> > goto out;
> > }
> >
> > - res = __mlx4_zone_remove_one_entry(zone);
> > + __mlx4_zone_remove_one_entry(zone);
> > + res = 0;
>
> Will look better if initialization will move to variable declaration.
>
Yes, please.
Thanks
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-07-12 9:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-12 6:44 [PATCH 1/1] mlx4_en: remove unnecessary returned value check Zhu Yanjun
[not found] ` <1499841873-10275-1-git-send-email-yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-07-12 8:36 ` Yuval Shaia
2017-07-12 9:46 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox