projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3e0d473
)
xen: Switch to use kmemdup() helper
author
Ruan Jinjie
<ruanjinjie@huawei.com>
Tue, 15 Aug 2023 09:24:34 +0000
(17:24 +0800)
committer
Juergen Gross
<jgross@suse.com>
Mon, 21 Aug 2023 07:54:05 +0000
(09:54 +0200)
Use kmemdup() helper instead of open-coding to
simplify the code.
Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Chen Jiahao <chenjiahao16@huawei.com>
Link:
https://lore.kernel.org/r/20230815092434.1206386-1-ruanjinjie@huawei.com
Signed-off-by: Juergen Gross <jgross@suse.com>
drivers/xen/xen-acpi-processor.c
patch
|
blob
|
history
diff --git
a/drivers/xen/xen-acpi-processor.c
b/drivers/xen/xen-acpi-processor.c
index
9cb61db
..
2967039
100644
(file)
--- a/
drivers/xen/xen-acpi-processor.c
+++ b/
drivers/xen/xen-acpi-processor.c
@@
-473,11
+473,8
@@
static int xen_upload_processor_pm_data(void)
if (!_pr)
continue;
- if (!pr_backup) {
- pr_backup = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL);
- if (pr_backup)
- memcpy(pr_backup, _pr, sizeof(struct acpi_processor));
- }
+ if (!pr_backup)
+ pr_backup = kmemdup(_pr, sizeof(*_pr), GFP_KERNEL);
(void)upload_pm_data(_pr);
}