From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: Zhu Yanjun <yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
tariqt-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/1] mlx4_en: remove unnecessary returned value check
Date: Wed, 12 Jul 2017 12:46:18 +0300 [thread overview]
Message-ID: <20170712094618.GC1528@mtr-leonro.local> (raw)
In-Reply-To: <20170712083647.GB2866@yuvallap>
[-- 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 --]
prev parent reply other threads:[~2017-07-12 9:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170712094618.GC1528@mtr-leonro.local \
--to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=tariqt-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
--cc=yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox