Skip to content

Commit 1a68aef

Browse files
committed
Merge tag 'for-linus-6.19-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull xen updates from Juergen Gross: "This round it contains only three small cleanup patches" * tag 'for-linus-6.19-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: drivers/xen: use min() instead of min_t() drivers/xen/xenbus: Replace deprecated strcpy in xenbus_transaction_end drivers/xen/xenbus: Simplify return statement in join()
2 parents 249872f + 150215b commit 1a68aef

3 files changed

Lines changed: 7 additions & 13 deletions

File tree

drivers/xen/grant-table.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,7 @@ void gnttab_foreach_grant_in_range(struct page *page,
12041204
unsigned int glen;
12051205
unsigned long xen_pfn;
12061206

1207-
len = min_t(unsigned int, PAGE_SIZE - offset, len);
1207+
len = min(PAGE_SIZE - offset, len);
12081208
goffset = xen_offset_in_page(offset);
12091209

12101210
xen_pfn = page_to_xen_pfn(page) + XEN_PFN_DOWN(offset);

drivers/xen/xenbus/xenbus_xs.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ static char *join(const char *dir, const char *name)
407407
buffer = kasprintf(GFP_NOIO | __GFP_HIGH, "%s", dir);
408408
else
409409
buffer = kasprintf(GFP_NOIO | __GFP_HIGH, "%s/%s", dir, name);
410-
return (!buffer) ? ERR_PTR(-ENOMEM) : buffer;
410+
return buffer ?: ERR_PTR(-ENOMEM);
411411
}
412412

413413
static char **split_strings(char *strings, unsigned int len, unsigned int *num)
@@ -546,18 +546,12 @@ int xenbus_transaction_start(struct xenbus_transaction *t)
546546
EXPORT_SYMBOL_GPL(xenbus_transaction_start);
547547

548548
/* End a transaction.
549-
* If abandon is true, transaction is discarded instead of committed.
549+
* If abort is true, transaction is discarded instead of committed.
550550
*/
551-
int xenbus_transaction_end(struct xenbus_transaction t, int abort)
551+
int xenbus_transaction_end(struct xenbus_transaction t, bool abort)
552552
{
553-
char abortstr[2];
554-
555-
if (abort)
556-
strcpy(abortstr, "F");
557-
else
558-
strcpy(abortstr, "T");
559-
560-
return xs_error(xs_single(t, XS_TRANSACTION_END, abortstr, NULL));
553+
return xs_error(xs_single(t, XS_TRANSACTION_END, abort ? "F" : "T",
554+
NULL));
561555
}
562556
EXPORT_SYMBOL_GPL(xenbus_transaction_end);
563557

include/xen/xenbus.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ int xenbus_exists(struct xenbus_transaction t,
158158
const char *dir, const char *node);
159159
int xenbus_rm(struct xenbus_transaction t, const char *dir, const char *node);
160160
int xenbus_transaction_start(struct xenbus_transaction *t);
161-
int xenbus_transaction_end(struct xenbus_transaction t, int abort);
161+
int xenbus_transaction_end(struct xenbus_transaction t, bool abort);
162162

163163
/* Single read and scanf: returns -errno or num scanned if > 0. */
164164
__scanf(4, 5)

0 commit comments

Comments
 (0)