From: kernel test robot <lkp(a)intel.com>
drivers/md/bcache/btree.c:1810: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
Fixes: 1898b575e1d4 ("bcache: Make gc wakeup sane, remove set_task_state()")
CC: Kent Overstreet <kent.overstreet(a)gmail.com>
Signed-off-by: kernel test robot <lkp(a)intel.com>
---
tree:
https://android.googlesource.com/kernel/goldfish android-3.18
head: 1898b575e1d49f3c959d792fa32168cde137b7c7
commit: 1898b575e1d49f3c959d792fa32168cde137b7c7 [18/18] bcache: Make gc wakeup sane,
remove set_task_state()
btree.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -1807,10 +1807,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 */