mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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>
This commit is contained in:
committed by
Juergen Gross
parent
6fec913ff1
commit
a73d4a0556
@@ -546,18 +546,12 @@ int xenbus_transaction_start(struct xenbus_transaction *t)
|
|||||||
EXPORT_SYMBOL_GPL(xenbus_transaction_start);
|
EXPORT_SYMBOL_GPL(xenbus_transaction_start);
|
||||||
|
|
||||||
/* End a transaction.
|
/* 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];
|
return xs_error(xs_single(t, XS_TRANSACTION_END, abort ? "F" : "T",
|
||||||
|
NULL));
|
||||||
if (abort)
|
|
||||||
strcpy(abortstr, "F");
|
|
||||||
else
|
|
||||||
strcpy(abortstr, "T");
|
|
||||||
|
|
||||||
return xs_error(xs_single(t, XS_TRANSACTION_END, abortstr, NULL));
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(xenbus_transaction_end);
|
EXPORT_SYMBOL_GPL(xenbus_transaction_end);
|
||||||
|
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ int xenbus_exists(struct xenbus_transaction t,
|
|||||||
const char *dir, const char *node);
|
const char *dir, const char *node);
|
||||||
int xenbus_rm(struct xenbus_transaction t, const char *dir, const char *node);
|
int xenbus_rm(struct xenbus_transaction t, const char *dir, const char *node);
|
||||||
int xenbus_transaction_start(struct xenbus_transaction *t);
|
int xenbus_transaction_start(struct xenbus_transaction *t);
|
||||||
int xenbus_transaction_end(struct xenbus_transaction t, int abort);
|
int xenbus_transaction_end(struct xenbus_transaction t, bool abort);
|
||||||
|
|
||||||
/* Single read and scanf: returns -errno or num scanned if > 0. */
|
/* Single read and scanf: returns -errno or num scanned if > 0. */
|
||||||
__scanf(4, 5)
|
__scanf(4, 5)
|
||||||
|
|||||||
Reference in New Issue
Block a user