From: Julia Lawall <julia.lawall@lip6.fr>
To: walter harms <wharms@bfs.de>
Cc: mgandhi@redhat.com, Johannes Thumshirn <jth@kernel.org>,
Dan Carpenter <dan.carpenter@oracle.com>,
Laurence Oberman <loberman@redhat.com>,
linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH RESEND] Eliminate extra 'out_free' label from fcoe_init function
Date: Fri, 2 Jun 2017 18:07:49 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.20.1706021807250.19640@hadrien> (raw)
In-Reply-To: <593161A9.9000100@bfs.de>
On Fri, 2 Jun 2017, walter harms wrote:
>
>
> Am 02.06.2017 14:39, schrieb Milan P. Gandhi:
> > Simplify the check for return code of fcoe_if_init routine
> > in fcoe_init function such that we could eliminate need for
> > extra 'out_free' label and duplicate mutex_unlock statement.
> >
> > Signed-off-by: Milan P. Gandhi <mgandhi@redhat.com>
> > ---
> > drivers/scsi/fcoe/fcoe.c | 7 +++----
> > 1 file changed, 3 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
> > index ea21e7b..a2cf3d0 100644
> > --- a/drivers/scsi/fcoe/fcoe.c
> > +++ b/drivers/scsi/fcoe/fcoe.c
> > @@ -2523,14 +2523,13 @@ static int __init fcoe_init(void)
> > fcoe_dev_setup();
> >
> > rc = fcoe_if_init();
> > + mutex_unlock(&fcoe_config_mutex);
> > +
> > if (rc)
> > - goto out_free;
> > + goto out_destroy;
> >
> > - mutex_unlock(&fcoe_config_mutex);
> > return 0;
> >
> if you do that, why not
> if (!rc) return 0;
I agree with Dan. If's should be for failures.
julia
>
> re,
> wh
>
>
>
> > -out_free:
> > - mutex_unlock(&fcoe_config_mutex);
> > out_destroy:
> > destroy_workqueue(fcoe_wq);
> > return rc;
> > --
> > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2017-06-02 16:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-02 12:39 [PATCH RESEND] Eliminate extra 'out_free' label from fcoe_init function Milan P. Gandhi
2017-06-02 13:01 ` walter harms
2017-06-02 16:07 ` Julia Lawall [this message]
2017-06-03 2:35 ` Dan Carpenter
2017-06-02 16:06 ` Julia Lawall
2017-06-03 2:34 ` Dan Carpenter
2017-06-05 4:12 ` Milan P. Gandhi
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=alpine.DEB.2.20.1706021807250.19640@hadrien \
--to=julia.lawall@lip6.fr \
--cc=dan.carpenter@oracle.com \
--cc=jth@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=loberman@redhat.com \
--cc=mgandhi@redhat.com \
--cc=wharms@bfs.de \
/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