summaryrefslogtreecommitdiff
path: root/drivers/xen/xenbus/xenbus_xs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/xen/xenbus/xenbus_xs.c')
-rw-r--r--drivers/xen/xenbus/xenbus_xs.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
index f794014814be..15f18374020e 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_strings(char *strings, unsigned int len, unsigned int *num)
@@ -546,18 +546,12 @@ int xenbus_transaction_start(struct xenbus_transaction *t)
EXPORT_SYMBOL_GPL(xenbus_transaction_start);
/* End a transaction.
- * If abandon is true, transaction is discarded instead of committed.
+ * If abort is true, transaction is discarded instead of committed.
*/
-int xenbus_transaction_end(struct xenbus_transaction t, int abort)
+int xenbus_transaction_end(struct xenbus_transaction t, bool abort)
{
- char abortstr[2];
-
- if (abort)
- strcpy(abortstr, "F");
- else
- strcpy(abortstr, "T");
-
- return xs_error(xs_single(t, XS_TRANSACTION_END, abortstr, NULL));
+ return xs_error(xs_single(t, XS_TRANSACTION_END, abort ? "F" : "T",
+ NULL));
}
EXPORT_SYMBOL_GPL(xenbus_transaction_end);