diff options
| author | Thorsten Blum <thorsten.blum@linux.dev> | 2025-10-31 12:21:31 +0100 |
|---|---|---|
| committer | Juergen Gross <jgross@suse.com> | 2025-11-17 08:48:40 +0100 |
| commit | a73d4a055622d0973e371382b16a13f9795ffec7 (patch) | |
| tree | 34b3f94b2421b89f9d076c0c05c7212071e68004 /drivers | |
| parent | 6fec913ff1c9811e35e1bb64779efce9bb41b7ec (diff) | |
drivers/xen/xenbus: Replace deprecated strcpy in xenbus_transaction_end
strcpy() is deprecated; inline the read-only string instead. Fix the
function comment and use bool instead of int while we're at it.
Link: https://github.com/KSPP/linux/issues/88
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <20251031112145.103257-2-thorsten.blum@linux.dev>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/xen/xenbus/xenbus_xs.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c index 7c6c12925326..bddc714877c1 100644 --- a/drivers/xen/xenbus/xenbus_xs.c +++ b/drivers/xen/xenbus/xenbus_xs.c @@ -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); |
