lkml.org 
[lkml]   [2015]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] dgnc: move more repeating code under 'failed' label
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


\
 
 \ /
  Last update: 2015-03-09 16:41    [W:1.063 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site