linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Phillip Potter <phil@philpotter.co.uk>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: gregkh@linuxfoundation.org, Larry.Finger@lwfinger.net,
	paskripkin@gmail.com, straube.linux@gmail.com, martin@kaiser.cx,
	abdun.nihaal@gmail.com, philipp.g.hortmann@gmail.com,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: r8188eu: convert rtw_pwr_wakeup to correct error code semantics
Date: Tue, 26 Jul 2022 23:14:27 +0100	[thread overview]
Message-ID: <YuBnQzsF3g1bL82T@equinox> (raw)
In-Reply-To: <20220726154602.GQ2316@kadam>

On Tue, Jul 26, 2022 at 06:46:02PM +0300, Dan Carpenter wrote:
> On Tue, Jul 26, 2022 at 04:35:59PM +0300, Dan Carpenter wrote:
> > On Mon, Jul 25, 2022 at 11:07:45PM +0100, Phillip Potter wrote:
> > > Convert the rtw_pwr_wakeup function to use 0 on success and an appropriate
> > > error code on error. For the first failure block where ips_leave is
> > > invoked, use -ENOMEM as this is the main cause of failure here anyway.
> > > For the second failure block, use -EBUSY, as it seems the most
> > > appropriate.
> > > 
> > > Finally, within the functions rtw_wx_set_mode, rtw_wx_set_wap,
> > > rtw_wx_set_scan and rtw_wx_set_essid, pass the error code on from
> > > rtw_pwr_wakeup as appropriate now that it is converted.
> > > 
> > > This gets the driver closer to removal of the non-standard _SUCCESS and
> > > _FAIL definitions, which are inverted compared to the standard in-kernel
> > > error code mechanism.
> > > 
> > > Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
> > > ---
> > > 
> > > Changes from V1: Act on feedback from Dan Carpenter:
> > > * Try to use more appropriate error codes than -EPERM.
> > > * Revert the places where existing -1 was converted as they are out of
> > >   scope.
> > > * Preserve error codes in places where calling function already uses
> > >   proper negative semantics, so that they can be passed through to the
> > >   caller.
> > > 
> > 
> > This is a much better patch, right?  Everything hangs together better.
> > 
> > There are seven callers which need to be updated and all of them are
> > updated.
> > 
> > Reviewed-by: Dan Carpenter
> 
> Oops.  I messed up my R-b tag.
> 
> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> regards,
> dan carpenter

Agreed, much cleaner this way. Thanks very much for the Reviewed-by tag
:-)

I'll attempt to structure the others in a similar fashion, as far as is
possible anyway.

All the best,
Phil

  reply	other threads:[~2022-07-26 22:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25 22:07 [PATCH v2] staging: r8188eu: convert rtw_pwr_wakeup to correct error code semantics Phillip Potter
2022-07-26  5:09 ` Philipp Hortmann
2022-07-26 13:35 ` Dan Carpenter
2022-07-26 15:46   ` Dan Carpenter
2022-07-26 22:14     ` Phillip Potter [this message]
2022-07-27  6:33 ` Greg KH
2022-07-27 12:43   ` Dan Carpenter
2022-07-27 12:47     ` Greg KH

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=YuBnQzsF3g1bL82T@equinox \
    --to=phil@philpotter.co.uk \
    --cc=Larry.Finger@lwfinger.net \
    --cc=abdun.nihaal@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=martin@kaiser.cx \
    --cc=paskripkin@gmail.com \
    --cc=philipp.g.hortmann@gmail.com \
    --cc=straube.linux@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).