Re: [PATCH 2/2] staging: r8188eu: convert rtw_set_802_11_add_wep error code semantics

From: Dan Carpenter
Date: Mon Aug 01 2022 - 05:18:46 EST


On Sun, Jul 31, 2022 at 10:12:56AM -0700, Joe Perches wrote:
> > I'm happy of course to rewrite this to address any concerns, but
> > I was hoping I could clarify what you've said though? Apologies if I've
> > missed it, but how is this function now returning 1 on success? It sets
> > ret to 0 (success) at the start and then sets it to one of two negative
> > error codes depending on what happens. Am I missing something here?
> > (Perfectly possible that I am).
> >
> > In terms of do nothing gotos, do you mean gotos that just set an error
> > code then jump to the end? If you'd prefer, as the function just returns
> > right after the exit label, I can just return the codes directly and have
> > a 'return 0;' like you say above?
> >
> > Thanks as always for your insight.
>
> Yes, you've got it right.
>
> I think Dan is suggesting something like the below, but
> not necessarily in a single patch:

I always like your style, Joe.

regards,
dan carpenter