Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1323272

[PATCH] aoe: remove unnecessary check for failing kthread creation

From Insu Yun <wuninsu@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] aoe: remove unnecessary check for failing kthread creation
Date 2016-02-01 17:00 +0100
Message-ID <qXp3t-50K-23@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


When kthread_run fails, it returns ERR, not NULL.
Therefore, NULL checking is redundant. 
(https://www.kernel.org/doc/htmldocs/device-drivers/API-kthread-run.html)

Signed-off-by: Insu Yun <wuninsu@gmail.com>
---
 drivers/block/aoe/aoecmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index d048d20..4213114 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -1327,7 +1327,7 @@ aoe_ktstart(struct ktstate *k)
 
 	init_completion(&k->rendez);
 	task = kthread_run(kthread, k, "%s", k->name);
-	if (task == NULL || IS_ERR(task))
+	if (IS_ERR(task))
 		return -ENOMEM;
 	k->task = task;
 	wait_for_completion(&k->rendez); /* allow kthread to start */
-- 
1.9.1

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH] aoe: remove unnecessary check for failing kthread creation Insu Yun <wuninsu@gmail.com> - 2016-02-01 17:00 +0100
  Re: [PATCH] aoe: remove unnecessary check for failing kthread  creation Ed Cashin <ed.cashin@acm.org> - 2016-02-03 02:40 +0100

csiph-web