public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Jean Delvare <jdelvare@suse.de>,
	Vasyl Gomonovych <gomonovych@gmail.com>,
	linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] PNP: pnpbios: Use PTR_ERR_OR_ZERO()
Date: Sun, 17 Dec 2017 18:36:58 +0100	[thread overview]
Message-ID: <2350906.AG48QEUOht@aspire.rjw.lan> (raw)
In-Reply-To: <20171129215523.47246478@endymion>

On Wednesday, November 29, 2017 9:55:23 PM CET Jean Delvare wrote:
> On Wed, 29 Nov 2017 17:20:57 +0100, Vasyl Gomonovych wrote:
> > Fix ptr_ret.cocci warnings:
> > drivers/pnp/pnpbios/core.c:584:1-3: WARNING: PTR_ERR_OR_ZERO can be used
> > 
> > Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
> > 
> > Generated by: scripts/coccinelle/api/ptr_ret.cocci
> > 
> > Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>
> > ---
> >  drivers/pnp/pnpbios/core.c | 5 +----
> >  1 file changed, 1 insertion(+), 4 deletions(-)
> > 
> > diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
> > index e681140b85d8..077f334fdbae 100644
> > --- a/drivers/pnp/pnpbios/core.c
> > +++ b/drivers/pnp/pnpbios/core.c
> > @@ -581,10 +581,7 @@ static int __init pnpbios_thread_init(void)
> >  
> >  	init_completion(&unload_sem);
> >  	task = kthread_run(pnp_dock_thread, NULL, "kpnpbiosd");
> > -	if (IS_ERR(task))
> > -		return PTR_ERR(task);
> > -
> > -	return 0;
> > +	return PTR_ERR_OR_ZERO(task);
> >  }
> >  
> >  /* Start the kernel thread later: */
> 
> Looks good to me.
> 
> Reviewed-by: Jean Delvare <jdelvare@suse.de>
> 
> 

Applied, thanks!

      reply	other threads:[~2017-12-17 17:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-29 16:20 [PATCH] PNP: pnpbios: Use PTR_ERR_OR_ZERO() Vasyl Gomonovych
2017-11-29 20:55 ` Jean Delvare
2017-12-17 17:36   ` Rafael J. Wysocki [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=2350906.AG48QEUOht@aspire.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=gomonovych@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jdelvare@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /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