linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Giedrius Statkevičius" <giedrius.statkevicius@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	Matteo Semenzato <mattew8898@gmail.com>
Cc: lidza.louina@gmail.com, markh@compro.net,
	devel@driverdev.osuosl.org, gregkh@linuxfoundation.org,
	driverdev-devel@linuxdriverproject.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dgnc: move more repeating code under 'failed' label
Date: Mon, 09 Mar 2015 17:23:49 +0200	[thread overview]
Message-ID: <54FDBB05.60408@gmail.com> (raw)
In-Reply-To: <20150309130645.GF10964@mwanda>

On 2015.03.09 15:06, Dan Carpenter wrote:
> Added Matteo to the CC list because he was working on this function as
> well and I remembered something I wanted to tell him.
> 
> On Sun, Mar 08, 2015 at 07:46:37PM +0200, Giedrius Statkevičius wrote:
>> Currently the label is only used to return a error code to the caller but more
>> repeating code is before each "goto failed;" thus we can move that code to the
>> label. Also, remove some empty unneeded lines together with this patch in those
>> if's and at the end of dgnc_found_board().
>>
> 
> This function totally sucks.
> 
> This patch is useless because we will never use the brd->state in the
> cases where we fail.  We shouldn't be saving inconsistent crap into
> dgnc_Board[] because that is barf inducing ugly even though it's not a
> bug given that we don't use it.
> 
> Only do:
> 
> 	dgnc_Board[dgnc_NumBoards] = brd;
> 
> when the brd is fully configured at the end of the dgnc_found_board()
> function.
> 
> regards,
> dan carpenter

First time I've made this patch I was purely looking at this from a
cosmetical point. But now that I've looked more at this I see that you
have a good point.  I've made a patch that tries to address this issue
and posted it in another thread.

-- 
Thanks,
Giedrius

      reply	other threads:[~2015-03-09 15:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-08 17:46 [PATCH] dgnc: move more repeating code under 'failed' label Giedrius Statkevičius
2015-03-09 13:06 ` Dan Carpenter
2015-03-09 15:23   ` Giedrius Statkevičius [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=54FDBB05.60408@gmail.com \
    --to=giedrius.statkevicius@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=lidza.louina@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markh@compro.net \
    --cc=mattew8898@gmail.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).