Skip to contentSkip to conversation

xen: xenbus: Use helper function IS_ERR_OR_NULL()

PATCH Applied Li Zetao 2 participants 3 messages Aug 17, 2023 – Aug 22, 2023 Xen hypervisor interface

lore
Share & tools
lore

Li Zetao

author
#0 lore raw

PATCH 1/1 xen: xenbus: Use helper function IS_ERR_OR_NULL()

Use IS_ERR_OR_NULL() to detect an error pointer or a null pointer open-coding to simplify the code.

---
 drivers/xen/xenbus/xenbus_probe_frontend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/xen/xenbus/xenbus_probe_frontend.c +1 -1
index 3f3836cb7279..fcb335bb7b18 100644
@@ -429,7 +429,7 @@ static void xenbus_check_frontend(char *class, char *dev)
 		printk(KERN_DEBUG "XENBUS: frontend %s %s\n",
 				frontend, xenbus_strstate(fe_state));
 		backend = xenbus_read(XBT_NIL, frontend, "backend", NULL);
-		if (!backend || IS_ERR(backend))
+		if (IS_ERR_OR_NULL(backend))
 			goto out;
 		err = xenbus_scanf(XBT_NIL, backend, "state", "%i", &be_state);
 		if (err == 1)
Signature · 1 line
2.34.1