]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drivers/xen/xenbus: Simplify return statement in join()
authorThorsten Blum <thorsten.blum@linux.dev>
Wed, 12 Nov 2025 17:14:07 +0000 (18:14 +0100)
committerJuergen Gross <jgross@suse.com>
Mon, 17 Nov 2025 06:55:10 +0000 (07:55 +0100)
Don't unnecessarily negate 'buffer' and simplify the return statement.

Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <20251112171410.3140-2-thorsten.blum@linux.dev>

drivers/xen/xenbus/xenbus_xs.c

index 528682bf0c7f24dcb4dc08f962cf2847d4801f18..7c6c12925326c593e1d3e18bb1ac5f7d00c1b3c5 100644 (file)
@@ -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)