linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: bL_switcher: use IS_ERR_OR_NULL() to simplify code
@ 2021-06-24  7:42 Tang Bin
  2021-06-24  9:23 ` Russell King (Oracle)
  0 siblings, 1 reply; 2+ messages in thread
From: Tang Bin @ 2021-06-24  7:42 UTC (permalink / raw)
  To: linux; +Cc: linux-arm-kernel, linux-kernel, Tang Bin

Use IS_ERR_OR_NULL() instead of IS_ERR() to simplify code.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
---
 arch/arm/common/bL_switcher.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/arm/common/bL_switcher.c b/arch/arm/common/bL_switcher.c
index 9a9aa5354..b8e8e2567 100644
--- a/arch/arm/common/bL_switcher.c
+++ b/arch/arm/common/bL_switcher.c
@@ -352,11 +352,9 @@ int bL_switch_request_cb(unsigned int cpu, unsigned int new_cluster_id,
 
 	t = &bL_threads[cpu];
 
-	if (IS_ERR(t->task))
-		return PTR_ERR(t->task);
-	if (!t->task)
-		return -ESRCH;
-
+	if (IS_ERR_OR_NULL(t->task))
+		return t->task ? PTR_ERR(t->task) : -ESRCH;
+
 	spin_lock(&t->lock);
 	if (t->completer) {
 		spin_unlock(&t->lock);
-- 
2.20.1.windows.1




_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-06-24  9:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-24  7:42 [PATCH] ARM: bL_switcher: use IS_ERR_OR_NULL() to simplify code Tang Bin
2021-06-24  9:23 ` Russell King (Oracle)

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