linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] aoe: Use IS_ERR_OR_NULL() to clean code
@ 2024-08-23  5:26 zhangjiao2
  2024-08-23  7:30 ` Al Viro
  0 siblings, 1 reply; 2+ messages in thread
From: zhangjiao2 @ 2024-08-23  5:26 UTC (permalink / raw)
  To: axboe; +Cc: justin, linux-block, linux-kernel, Zhang Jiao

From: Zhang Jiao <zhangjiao2@cmss.chinamobile.com>

Use IS_ERR_OR_NULL() to make the code cleaner.

Signed-off-by: Zhang Jiao <zhangjiao2@cmss.chinamobile.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 cc9077b588d7..5514b7a6e5c2 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -1256,7 +1256,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_OR_NULL(task))
 		return -ENOMEM;
 	k->task = task;
 	wait_for_completion(&k->rendez); /* allow kthread to start */
-- 
2.33.0




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-23  7:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-23  5:26 [PATCH] aoe: Use IS_ERR_OR_NULL() to clean code zhangjiao2
2024-08-23  7:30 ` Al Viro

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).