From: "Gujulan Elango, Hari Prasath (H.)" <hgujulan@visteon.com>
To: Jes Sorensen <Jes.Sorensen@redhat.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"Larry.Finger@lwfinger.net" <Larry.Finger@lwfinger.net>,
"Babu, Viswanathan (V.)" <vbabu3@visteon.com>
Subject: Re: [PATCH] staging: rtl8723au : remove goto & return error directly
Date: Tue, 12 May 2015 10:37:45 +0000 [thread overview]
Message-ID: <20150512103213.GA5519@IND12F0122> (raw)
In-Reply-To: <wrfj3838o4w8.fsf@ultrasam.lan.trained-monkey.org>
On Thu, May 07, 2015 at 10:09:59AM -0400, Jes Sorensen wrote:
> "Gujulan Elango, Hari Prasath (H.)" <hgujulan@visteon.com> writes:
> > On Thu, May 07, 2015 at 03:19:34PM +0300, Dan Carpenter wrote:
> >> On Thu, May 07, 2015 at 08:03:06AM -0400, Jes Sorensen wrote:
> >> > "Gujulan Elango, Hari Prasath (H.)" <hgujulan@visteon.com> writes:
> >> > > Remove the goto and return error directly thereby removing a variable
> >> > >
> >> > > Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
> >> > > ---
> >> > > drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 7 ++-----
> >> > > 1 file changed, 2 insertions(+), 5 deletions(-)
> >> >
> >> > NACK!
> >>
> >> SHOUTING!
> >>
> >> >
> >> > The goto is cleaner and more consistent, rather than hiding a return in
> >> > the middle of the code.
> >>
> >> More consistent with what? There are already returns earlier in the
> >> function. Do-nothing gotos are pointless and annoying.
> >>
> >> regards,
> >> dan carpenter
> >>
> >
> > I sent this patch because goto & return was mixed up in this function.
> > There was a return as well as goto used. And i guess goto is not
> > encouraged anywhere. In this case especially,I couldn't see any
> > significant cleanup being done in the goto label.
>
> I will accept a patch to remove the returns in the middle of the
> function, if you wish to submit that.
>
> A return at the very beginning of a function is OK, but in the middle of
> a larger function they make it harder to catch when code exists.
>
> Jes
Is this accepted as it is or should I send v2 with the goto retained but
the return in the middle of the function also converted to goto for
consistency.I agree that goto's are used at many places in the kernel
but this is really a small function where it doesn't seem to help
much.Also there is no signficant cleanup being done in the definition of
the label.
regards
Hari
next prev parent reply other threads:[~2015-05-12 10:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-07 11:22 [PATCH] staging: rtl8723au : remove goto & return error directly Gujulan Elango, Hari Prasath (H.)
2015-05-07 12:03 ` Jes Sorensen
2015-05-07 12:19 ` Dan Carpenter
2015-05-07 13:49 ` Gujulan Elango, Hari Prasath (H.)
2015-05-07 14:09 ` Jes Sorensen
2015-05-12 10:37 ` Gujulan Elango, Hari Prasath (H.) [this message]
2015-05-12 11:16 ` Jes Sorensen
2015-05-07 14:08 ` Jes Sorensen
2015-05-07 14:29 ` Joe Perches
2015-05-07 14:44 ` Jes Sorensen
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=20150512103213.GA5519@IND12F0122 \
--to=hgujulan@visteon.com \
--cc=Jes.Sorensen@redhat.com \
--cc=Larry.Finger@lwfinger.net \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-wireless@vger.kernel.org \
--cc=vbabu3@visteon.com \
/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;
as well as URLs for NNTP newsgroup(s).