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

Thorsten Blum posted 1 patch 1 week, 1 day ago
Failed in applying to current master (apply log)
There is a newer version of this series
drivers/xen/xenbus/xenbus_xs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] drivers/xen/xenbus: Simplify return statement in join()
Posted by Thorsten Blum 1 week, 1 day ago
Don't unnecessarily negate 'buffer' and simplify the return statement.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/xen/xenbus/xenbus_xs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
index 528682bf0c7f..7c6c12925326 100644
--- a/drivers/xen/xenbus/xenbus_xs.c
+++ b/drivers/xen/xenbus/xenbus_xs.c
@@ -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)
-- 
2.51.0
Re: [PATCH] drivers/xen/xenbus: Simplify return statement in join()
Posted by Jason Andryuk 4 days, 22 hours ago
On 2025-10-21 09:49, Thorsten Blum wrote:
> Don't unnecessarily negate 'buffer' and simplify the return statement.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>

Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>