mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Coly Li <i@coly.li>
To: Vasyl Gomonovych <gomonovych@gmail.com>
Cc: kent.overstreet@gmail.com, shli@kernel.org, mingo@kernel.org,
	axboe@fb.com, gregkh@linuxfoundation.org,
	kstewart@linuxfoundation.org, linux-bcache@vger.kernel.org,
	linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bcache: Use PTR_ERR_OR_ZERO()
Date: Tue, 28 Nov 2017 11:38:30 +0800	[thread overview]
Message-ID: <42696b58-1a5e-8a09-42ed-93ddb4621628@coly.li> (raw)
In-Reply-To: <1511823900-3151-1-git-send-email-gomonovych@gmail.com>

On 28/11/2017 7:05 AM, Vasyl Gomonovych wrote:
> Fix ptr_ret.cocci warnings:
> drivers/md/bcache/btree.c:1800: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>

Looks good to me. Reviewed-by: Coly Li <colyli@suse.de>

Thanks.

Coly Li

> ---
>  drivers/md/bcache/btree.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
> index 658c54b3b07a..f43e49979cb2 100644
> --- a/drivers/md/bcache/btree.c
> +++ b/drivers/md/bcache/btree.c
> @@ -1797,10 +1797,7 @@ static int bch_gc_thread(void *arg)
>  int bch_gc_thread_start(struct cache_set *c)
>  {
>  	c->gc_thread = kthread_run(bch_gc_thread, c, "bcache_gc");
> -	if (IS_ERR(c->gc_thread))
> -		return PTR_ERR(c->gc_thread);
> -
> -	return 0;
> +	return PTR_ERR_OR_ZERO(c->gc_thread);
>  }
>  
>  /* Initial partial gc */
> 

  reply	other threads:[~2017-11-28  3:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27 23:05 Vasyl Gomonovych
2017-11-28  3:38 ` Coly Li [this message]
2017-11-28 16:18 ` Michael Lyle

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=42696b58-1a5e-8a09-42ed-93ddb4621628@coly.li \
    --to=i@coly.li \
    --cc=axboe@fb.com \
    --cc=gomonovych@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kent.overstreet@gmail.com \
    --cc=kstewart@linuxfoundation.org \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=shli@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

all inboxes | Powered by JetHome®