Skip to contentSkip to conversation

drivers/xen/xenbus: Simplify return statement in join()

PATCH RESEND New Thorsten Blum 1 participant 1 message Nov 12, 2025 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 drivers/xen/xenbus: Simplify return statement in join()

Don't unnecessarily negate 'buffer' and simplify the return statement.

---
 drivers/xen/xenbus/xenbus_xs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/xen/xenbus/xenbus_xs.c +1 -1
index 528682bf0c7f..7c6c12925326 100644
@@ -407,7 +407,7 @@ static char *join(const char *dir, const char *name)
 		buffer = kasprintf(GFP_NOIO | __GFP_HIGH, "%s", dir);
 	else
 		buffer = kasprintf(GFP_NOIO | __GFP_HIGH, "%s/%s", dir, name);
-	return (!buffer) ? ERR_PTR(-ENOMEM) : buffer;
+	return buffer ?: ERR_PTR(-ENOMEM);
 }
 
 static char **split(char *strings, unsigned int len, unsigned int *num)
Signature · 1 line
2.51.1